Start Workspace based in https://github.com/cloud-native-robotz-hackathon/starter-app-python.git
F1 -> Tasks: Run Task -> devfile -> devfile: “Run the application"
Install requirements
$ python -m venv ~/.venv/
$ source ~/.venv/bin/activate
$ cd starter-app-python
$ pip install -r requirements.txt
$ gunicorn -b 0.0.0.0:8080 app --reloadInstall the required packages
$ cd starter-app-python
$ pip install -r requirements.txt
$ gunicorn -b 0.0.0.0:8080 app --reloadIn the config.py set to following variables
ROBOT_API_ENDPOINT= IP or Hostname of edge-controller endpoint. If set ROBOT_API will be ignored and overwritten to:http://${ROBOT_API_ENDPOINT}:5000/ROBOT_API= URL of the robot REST Api, example: http://robot:5000/API_TOKEN= The token fo your robot/teamINFERENCING_API= The Url of the object detection inferencing service
To run this application on your local host:
$ gunicorn -b 0.0.0.0:8080 app --reloadTo interact with your booster while it's running locally, you can either open the page at http://localhost:5000 or use the curl command:
$ curl http://localhost:8080/status
$ curl -X POST http://localhost:8080/run
To update your application:
Changing python files will automatically reload the application. For chnages in static files (*.html) you will have to restart the app
The app is prepared with a S2I configuration. You can directly create a pipeline from this repo in the OpenSHift Developer View.
export VERSION=$(date +%Y%m%d%H%M)
git tag $VERSION
export IMAGE="quay.io/cloud-native-robotz-hackathon/starter-app-python:${VERSION}"
podman rmi $IMAGE
podman manifest rm ${IMAGE}
podman build --platform linux/amd64,linux/arm64 --manifest ${IMAGE} .
podman manifest push ${IMAGE}
git push --tags