diff --git a/.github/workflows/publication_vio_images.yml b/.github/workflows/publication_vio_images.yml index be989a3d..4cacc448 100644 --- a/.github/workflows/publication_vio_images.yml +++ b/.github/workflows/publication_vio_images.yml @@ -17,15 +17,21 @@ jobs: - dockerfile: ./edge_interface/Dockerfile image: ghcr.io/${{ github.repository }}/edge_interface context: ./edge_interface + - dockerfile: ./edge_streamlit/Dockerfile + image: ghcr.io/${{ github.repository }}/edge_streamlit + context: ./edge_streamlit - dockerfile: ./edge_orchestrator/Dockerfile image: ghcr.io/${{ github.repository }}/edge_orchestrator context: ./edge_orchestrator - dockerfile: ./edge_model_serving/tf_serving/Dockerfile - image: ghcr.io/${{ github.repository }}/edge_model_serving + image: ghcr.io/${{ github.repository }}/edge_tf_serving context: ./edge_model_serving - dockerfile: ./edge_model_serving/tflite_serving/Dockerfile image: ghcr.io/${{ github.repository }}/edge_tflite_serving context: ./edge_model_serving + - dockerfile: ./edge_model_serving/torch_serving/Dockerfile + image: ghcr.io/${{ github.repository }}/edge_torch_serving + context: ./edge_model_serving uses: ./.github/workflows/template_build_and_push_docker_images.yml with: context: ${{ matrix.context }} diff --git a/Makefile b/Makefile index f71ee9f7..acf620e0 100644 --- a/Makefile +++ b/Makefile @@ -26,15 +26,19 @@ edge_interface: edge_db: docker-compose up -d --build edge_db -.PHONY: hub_monitoring ## ⚙️ Start hub_monitoring inside a docker container +.PHONY: hub_streamlit ## 🚀 Start hub_streamlit inside a docker container +hub_streamlit: + docker-compose up -d --build hub_streamlit + +.PHONY: hub_monitoring ## 🚀 Start hub_monitoring inside a docker container hub_monitoring: docker-compose up -d --build hub_monitoring -.PHONY: hub_labelizer ## ⚙️ Start hub_labelizer inside a docker container +.PHONY: hub_labelizer ## 🚀 Start hub_labelizer inside a docker container hub_labelizer: docker-compose up -d --build hub_labelizer -.PHONY: hub_monitoring_db ## ⚙️ Start hub_monitoring database inside a docker container +.PHONY: hub_monitoring_db ## 🚀 Start hub_monitoring database inside a docker container hub_monitoring_db: docker-compose up -d --build hub_monitoring_db diff --git a/deployment/edge/ansible/Makefile b/deployment/edge/ansible/Makefile index fc071dcf..88e40575 100644 --- a/deployment/edge/ansible/Makefile +++ b/deployment/edge/ansible/Makefile @@ -17,10 +17,10 @@ ping-inventory: deploy-vio-on-inventory: ansible-playbook -v -i inventory.ini deploy_vio_on_edge.yml -.PHONY: register-inventory-on-gcp-hub ## 🚀 Register the edge devices on the GCP hub +.PHONY: register-inventory-on-gcp-hub ## 🚀 Register the inventory on the GCP hub register-inventory-on-gcp-hub: - ansible-playbook -v -i inventory.ini register_edge_on_gcp_hub.yml -e ansible_python_interpreter=.venv/bin/python + ansible-playbook -v -i inventory.ini register_inventory_on_gcp_hub.yml -e ansible_python_interpreter=.venv/bin/python -.PHONY: test-registering-localhost-on-gcp-hub ## 🚀 Test registering localhost on the GCP hub -test-registering-localhost-on-gcp-hub: - ansible-playbook -v -c local -l localhost -i inventory.ini register_edge_on_gcp_hub.yml -e ansible_python_interpreter=.venv/bin/python +.PHONY: test-register-localhost-on-gcp-hub ## 🚀 Test register localhost on the GCP hub +test-register-localhost-on-gcp-hub: + ansible-playbook -v -c local -l localhost -i inventory.ini register_inventory_on_gcp_hub.yml -e ansible_python_interpreter=.venv/bin/python diff --git a/deployment/edge/ansible/README.md b/deployment/edge/ansible/README.md index 42706b21..6a2b3dcd 100644 --- a/deployment/edge/ansible/README.md +++ b/deployment/edge/ansible/README.md @@ -2,18 +2,47 @@ Before launching ansible export a env to specify your local vio directory ``` export LOCAL_VIO_DIR= ``` +### Setup the edge + +Install openssh-server on the edge: +```bash + sudo apt-get install openssh-server +``` +Add public ssh key on the .ssh folder of the edge: +```bash + ssh-copy-id -i ~/.ssh/id_rsa.pub user@edge_ip +``` + +Then, try to connect through: +```bash + ssh user@edge_ip +``` + +Do not forget to install the google-cloud-storage package: +```bash + pip install google-cloud-storage==3.0.0 +``` + + +Install Docker on the edge help you with [this link](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository) +Don't forget [post-installation](https://docs.docker.com/engine/install/linux-postinstall/) steps to run docker as a non-root user. + +Install *make* on the edge: +```bash + sudo apt-get install build-essential +``` ### Install sshpass and the requirements On MacOS, you can install sshpass using brew: ```bash -brew install sshpass + brew install sshpass ``` Then install requirements: ```bash -pip install -r requirements.txt + pip install -r requirements.txt ``` ### Find the IP of the edge diff --git a/deployment/edge/ansible/files/docker-compose.template.yml b/deployment/edge/ansible/files/docker-compose.template.yml index 54ac0fd2..6cb2d033 100644 --- a/deployment/edge/ansible/files/docker-compose.template.yml +++ b/deployment/edge/ansible/files/docker-compose.template.yml @@ -32,22 +32,10 @@ services: GCP_BUCKET_NAME: tf-vio-bucket ACTIVE_CONFIG_NAME: marker_classification_with_1_fake_camera - edge_interface: - container_name: edge_interface - build: - context: edge_interface - dockerfile: Dockerfile - ports: - - 8080:80 - edge_streamlit: container_name: edge_streamlit build: context: edge_streamlit dockerfile: Dockerfile - # devices: - # - /dev/video0:/dev/video0 - # - /dev/video2:/dev/video2 ports: - 8502:8501 - profiles: [edge] diff --git a/deployment/edge/ansible/register_edge_on_gcp_hub.yml b/deployment/edge/ansible/register_inventory_on_gcp_hub.yml similarity index 75% rename from deployment/edge/ansible/register_edge_on_gcp_hub.yml rename to deployment/edge/ansible/register_inventory_on_gcp_hub.yml index 0c1c90ae..ff4686d0 100644 --- a/deployment/edge/ansible/register_edge_on_gcp_hub.yml +++ b/deployment/edge/ansible/register_inventory_on_gcp_hub.yml @@ -6,6 +6,15 @@ content: "{{ IP_ADDRESS }}" dest: "{{ REMOTE_VIO_DIR }}/edge_orchestrator/config/edge_ip.txt" + - name: Install pip through apt + ansible.builtin.apt: + name: python3-pip + + - name: Install google-cloud-storage + ansible.builtin.pip: + name: google-cloud-storage + version: 3.0.0 + - name: Upload edge_ip file on GCP google.cloud.gcp_storage_object: action: upload