diff --git a/.github/workflows/ansible.yaml b/.github/workflows/ansible.yaml index 8c0fe8feb..008018408 100644 --- a/.github/workflows/ansible.yaml +++ b/.github/workflows/ansible.yaml @@ -25,7 +25,7 @@ jobs: - name: ansible version run: | ansible-playbook --version - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: make robotx_ws run: | mkdir robotx_ws @@ -55,7 +55,7 @@ jobs: name: setup_firmware runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: basic install run: | sudo apt install ansible @@ -74,7 +74,7 @@ jobs: name: setup_dataset runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: basic install run: | sudo apt install ansible @@ -88,4 +88,4 @@ jobs: status: ${{ job.status }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/check_workflow.yaml b/.github/workflows/check_workflow.yaml index bc30ae320..6a3486e7c 100644 --- a/.github/workflows/check_workflow.yaml +++ b/.github/workflows/check_workflow.yaml @@ -14,7 +14,7 @@ jobs: - BuildTest - Release steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v2 with: diff --git a/.github/workflows/deploy_workflow.yaml b/.github/workflows/deploy_workflow.yaml index 2a1dfa588..8e5382212 100644 --- a/.github/workflows/deploy_workflow.yaml +++ b/.github/workflows/deploy_workflow.yaml @@ -15,7 +15,7 @@ jobs: get_template: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - uses: actions/upload-artifact@v2 with: name: templates @@ -73,7 +73,7 @@ jobs: with: name: templates path: ~/templates - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: OUXT-Polaris/${{ matrix.package_name }} token: ${{ secrets.WAMV_TAN_BOT_SECRET }} diff --git a/.github/workflows/docker/auto_logger/action.yaml b/.github/workflows/docker/auto_logger/action.yaml index c304a121f..6d2033abe 100644 --- a/.github/workflows/docker/auto_logger/action.yaml +++ b/.github/workflows/docker/auto_logger/action.yaml @@ -12,14 +12,14 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: basic install run: | sudo apt install make ansible - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: run ansible run: | - ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos_full.yml --connection local --become -e ansible_user=ubuntu + ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos.yml --connection local --become -e ansible_user=ubuntu - name: copy repos file run: | cp ansible/mv ansible/packages_exact.repos .github/workflows/docker/auto_logger/ diff --git a/.github/workflows/docker/dev_container/action.yaml b/.github/workflows/docker/dev_container/action.yaml index 0c3a0fbb7..a6749b3c8 100644 --- a/.github/workflows/docker/dev_container/action.yaml +++ b/.github/workflows/docker/dev_container/action.yaml @@ -21,8 +21,8 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: path: ./.github/workflows/docker/dev_container/tmp/ouxt_automation clean: false diff --git a/.github/workflows/docker/l4t_opencv/action.yaml b/.github/workflows/docker/l4t_opencv/action.yaml index 1722a9e38..b573a00a5 100644 --- a/.github/workflows/docker/l4t_opencv/action.yaml +++ b/.github/workflows/docker/l4t_opencv/action.yaml @@ -15,7 +15,7 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Setup QEMU user-mode emulation @@ -59,4 +59,4 @@ runs: platforms: linux/arm64/v8 no-cache: false cache-from: type=registry,ref=wamvtan/l4t_opencv:${{ inputs.opencv_version }}-buildcache - push: false \ No newline at end of file + push: false diff --git a/.github/workflows/docker/vrx/action.yaml b/.github/workflows/docker/vrx/action.yaml index 9002bd786..e5e8138e3 100644 --- a/.github/workflows/docker/vrx/action.yaml +++ b/.github/workflows/docker/vrx/action.yaml @@ -12,7 +12,7 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub diff --git a/.github/workflows/docker/wamv/.gitignore b/.github/workflows/docker/wamv/.gitignore new file mode 100644 index 000000000..c05e7776d --- /dev/null +++ b/.github/workflows/docker/wamv/.gitignore @@ -0,0 +1 @@ +repos diff --git a/.github/workflows/docker/wamv/Dockerfile b/.github/workflows/docker/wamv/Dockerfile new file mode 100644 index 000000000..7f10977b7 --- /dev/null +++ b/.github/workflows/docker/wamv/Dockerfile @@ -0,0 +1,34 @@ +FROM docker.io/hakuturu583/cuda_ros:lt4-humble-cuda-12.2.2-devel +SHELL ["/bin/bash", "-c"] + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive \ + apt-get install -y \ + python3-vcstool git python3-colcon-common-extensions python3-rosdep python3-pip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /wamv_ws/src +WORKDIR /wamv_ws/src +COPY ./repos/packages_exact.repos packages_exact.repos +RUN vcs import . < packages_exact.repos +WORKDIR ../ +ENV USE_NCCL 0 +ENV USE_DISTRIBUTED 1 +ENV TORCH_CUDA_ARCH_LIST 8.7 +RUN rosdep init && rosdep update + +RUN --mount=type=cache,target=/wamv_ws/build source /opt/ros/$ROS_DISTRO/setup.bash && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive \ + rosdep install -iry --from-paths src && \ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* + +RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ + colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF + +ADD entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/workflows/docker/wamv/action.yaml b/.github/workflows/docker/wamv/action.yaml new file mode 100644 index 000000000..9aecbc3d5 --- /dev/null +++ b/.github/workflows/docker/wamv/action.yaml @@ -0,0 +1,55 @@ +name: "Build WAM-V image action" +description: "Build WAM-V docker images" + +inputs: + docker_username: + description: "Username for Dockerhub" + required: true + docker_password: + description: "Password for Dockerhub" + required: true + module: + description: "Software module" + required: true + +runs: + using: "composite" + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ inputs.docker_username }} + password: ${{ inputs.docker_password }} + - name: Build and Push Docker Image + if: ${{ github.event_name != 'pull_request'}} + uses: docker/build-push-action@v2 + env: + DOCKER_BUILDKIT: 1 + with: + username: ${{ inputs.docker_username }} + password: ${{ inputs.docker_password }} + context: ./.github/workflows/docker/wamv + file: ./.github/workflows/docker/wamv/Dockerfile + tags: wamvtan/wamv_${{ inputs.module }}:latest + no-cache: false + cache-from: type=registry,ref=wamvtan/wamv_${{ inputs.module }}:buildcache + cache-to: type=registry,ref=wamvtan/wamv_${{ inputs.module }}:buildcache,mode=max + push: true + platforms: linux/arm64/v8 + - name: Build Docker Image + if: ${{ github.event_name == 'pull_request'}} + uses: docker/build-push-action@v2 + env: + DOCKER_BUILDKIT: 1 + with: + username: ${{ inputs.docker_username }} + password: ${{ inputs.docker_password }} + context: ./.github/workflows/docker/wamv + file: ./.github/workflows/docker/wamv/Dockerfile + tags: wamvtan/wamv_${{ inputs.module }}:latest + no-cache: false + cache-from: type=registry,ref=wamvtan/wamv_${{ inputs.module }}:buildcache + push: false + platforms: linux/arm64/v8 diff --git a/.github/workflows/docker/wamv/entrypoint.sh b/.github/workflows/docker/wamv/entrypoint.sh new file mode 100755 index 000000000..4e7d0fcbf --- /dev/null +++ b/.github/workflows/docker/wamv/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +source "/opt/ros/humble/setup.bash" +source /wamv_ws/install/setup.sh + +exec "$@" diff --git a/.github/workflows/docker/yolox/action.yaml b/.github/workflows/docker/yolox/action.yaml index 5d888186d..1a891ab48 100644 --- a/.github/workflows/docker/yolox/action.yaml +++ b/.github/workflows/docker/yolox/action.yaml @@ -12,7 +12,7 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub diff --git a/.github/workflows/docker/yolox_trainer/action.yaml b/.github/workflows/docker/yolox_trainer/action.yaml index 89483b935..9d06c3065 100644 --- a/.github/workflows/docker/yolox_trainer/action.yaml +++ b/.github/workflows/docker/yolox_trainer/action.yaml @@ -18,7 +18,7 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub diff --git a/.github/workflows/docker_push.yaml b/.github/workflows/docker_push.yaml index cdfdc50f6..7c08f7da0 100644 --- a/.github/workflows/docker_push.yaml +++ b/.github/workflows/docker_push.yaml @@ -19,7 +19,7 @@ jobs: matrix: opencv_version: ["4.4.0", "4.5.0"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/cleanup_runner - uses: ./.github/workflows/docker/l4t_opencv with: @@ -46,7 +46,7 @@ jobs: # gui: vnc # entrypoint: entrypoint_vnc.sh # steps: - # - uses: actions/checkout@v2 + # - uses: actions/checkout@v4 # - uses: ./.github/workflows/actions/cleanup_runner # - uses: ./.github/workflows/docker/dev_container # with: @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/cleanup_runner - uses: ./.github/workflows/docker/yolox with: @@ -76,7 +76,7 @@ jobs: os: [linux-x64] runner_version: [2.295.0] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/cleanup_runner - uses: ./.github/workflows/docker/yolox_trainer with: @@ -89,7 +89,7 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/cleanup_runner - uses: ./.github/workflows/docker/vrx with: @@ -100,9 +100,51 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/cleanup_runner - uses: ./.github/workflows/docker/vrx with: docker_username: ${{ secrets.DOCKER_USERNAME }} docker_password: ${{ secrets.DOCKER_PASSWORD }} + export_wamv_repos: + name: export_wamv_repos + runs-on: ubuntu-22.04 + timeout-minutes: 360 + strategy: + matrix: + module: ["perception", "control", "drivers", "localization", "planning"] + steps: + - uses: actions/checkout@v4 + - name: basic install + run: | + sudo apt install ansible + - name: Export repos file + run: ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos.yml --connection local -t ${{ matrix.module }} -t utility --become -e ansible_user=ubuntu + - uses: actions/upload-artifact@v3 + with: + name: repos_file_${{ matrix.module }} + path: | + ansible/packages.repos + ansible/packages_exact.repos + wamv: + needs: export_wamv_repos + name: build and push wamvtan/wamv + runs-on: ubuntu-22.04 + timeout-minutes: 360 + strategy: + matrix: + module: ["perception", "control", "drivers", "localization", "planning"] + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/actions/cleanup_runner + - uses: actions/download-artifact@v3 + with: + name: repos_file_${{ matrix.module }} + path: ./.github/workflows/docker/wamv/repos + - run: ls ./.github/workflows/docker/wamv/repos + - run: cat ./.github/workflows/docker/wamv/repos/packages_exact.repos + - uses: ./.github/workflows/docker/wamv + with: + docker_username: ${{ secrets.DOCKER_USERNAME }} + docker_password: ${{ secrets.DOCKER_PASSWORD }} + module: ${{ matrix.module }} diff --git a/.github/workflows/document.yaml b/.github/workflows/document.yaml index 0a543d029..106f07fc9 100644 --- a/.github/workflows/document.yaml +++ b/.github/workflows/document.yaml @@ -14,7 +14,7 @@ jobs: name: build document runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v1 with: @@ -35,4 +35,4 @@ jobs: if: ${{ github.event_name != 'pull_request'}} with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/site \ No newline at end of file + publish_dir: docs/site diff --git a/.github/workflows/generate_rosdep_yaml.yaml b/.github/workflows/generate_rosdep_yaml.yaml index e2a693b0a..342a6e9fa 100644 --- a/.github/workflows/generate_rosdep_yaml.yaml +++ b/.github/workflows/generate_rosdep_yaml.yaml @@ -18,10 +18,10 @@ jobs: - name: ansible version run: | ansible-playbook --version - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v4 - name: run ansible run: | - ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos_full.yml --connection local --become -e ansible_user=ubuntu + ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos.yml --connection local --become -e ansible_user=ubuntu - name: run script run: | python3 generate_rosdep_yaml.py ../robotx_ws/src/ @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-22.04 needs: generate_rosdep_yaml steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: OUXT-Polaris/ouxt_distro token: ${{ secrets.WAMV_TAN_BOT_SECRET }} @@ -97,4 +97,4 @@ jobs: token: ${{ secrets.WAMV_TAN_BOT_SECRET }} pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }} merge-method: squash - repository: OUXT-Polaris/ouxt_distro \ No newline at end of file + repository: OUXT-Polaris/ouxt_distro diff --git a/ansible/export_repos.yml b/ansible/export_repos.yml new file mode 100644 index 000000000..3d5a184ab --- /dev/null +++ b/ansible/export_repos.yml @@ -0,0 +1,11 @@ +--- +- name: Export repos file of development workspace + hosts: all + roles: + - role: ros2 + tags: always + - role: create_workspace + tags: always + - role: clone_packages + - role: export_repos + tags: always diff --git a/ansible/export_repos_full.yml b/ansible/export_repos_full.yml deleted file mode 100644 index 72d9e2a4f..000000000 --- a/ansible/export_repos_full.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Export repos file of development workspace - hosts: all - roles: - - ros2 - - create_workspace - - clone_packages - - export_repos \ No newline at end of file diff --git a/ansible/roles/clone_packages/tasks/main.yml b/ansible/roles/clone_packages/tasks/main.yml index 0f9ab829f..b0eacb46e 100644 --- a/ansible/roles/clone_packages/tasks/main.yml +++ b/ansible/roles/clone_packages/tasks/main.yml @@ -69,13 +69,14 @@ version: master accept_hostkey: yes tags: [perception] -- name: clone vision_opencv - git: - repo: https://github.com/OUXT-Polaris/vision_opencv.git - dest: "{{workspace_path}}/src/perception/vision_opencv" - version: feature/opencv_vendor - accept_hostkey: yes - tags: [perception] +# This package is too heavy for building, so it will be add cahce layer in the near future. +# - name: clone vision_opencv +# git: +# repo: https://github.com/OUXT-Polaris/vision_opencv.git +# dest: "{{workspace_path}}/src/perception/vision_opencv" +# version: feature/opencv_vendor +# accept_hostkey: yes +# tags: [base] - name: clone point_painting git: repo: https://github.com/OUXT-Polaris/point_painting.git @@ -90,13 +91,6 @@ version: master accept_hostkey: yes tags: [perception] -- name: clone pcl_type_adapter - git: - repo: https://github.com/OUXT-Polaris/pcl_type_adapter.git - dest: "{{workspace_path}}/src/perception/pcl_type_adapter" - version: master - accept_hostkey: yes - tags: [perception] - name: clone grid_map_type_adapter git: repo: https://github.com/OUXT-Polaris/grid_map_type_adapter.git @@ -129,6 +123,13 @@ tags: [planning] # Utility Packages +- name: clone pcl_type_adapter + git: + repo: https://github.com/OUXT-Polaris/pcl_type_adapter.git + dest: "{{workspace_path}}/src/utils/pcl_type_adapter" + version: master + accept_hostkey: yes + tags: [utility] - name: clone data_buffer git: repo: https://github.com/OUXT-Polaris/data_buffer.git @@ -171,6 +172,13 @@ version: main accept_hostkey: yes tags: [utility] +- name: clone tcp_sender + git: + repo: https://github.com/OUXT-Polaris/tcp_sender.git + dest: "{{workspace_path}}/src/drivers/tcp_sender" + version: master + accept_hostkey: yes + tags: [utility] # Description Packages - name: clone wamv_description @@ -225,13 +233,6 @@ dest: "{{workspace_path}}/src/drivers/wamv_control" version: master accept_hostkey: yes -- name: clone tcp_sender - git: - repo: https://github.com/OUXT-Polaris/tcp_sender.git - dest: "{{workspace_path}}/src/drivers/tcp_sender" - version: master - accept_hostkey: yes - tags: [driver] - name: clone playstation_controller_drivers git: repo: https://github.com/OUXT-Polaris/playstation_controller_drivers diff --git a/ansible/roles/export_repos/tasks/main.yml b/ansible/roles/export_repos/tasks/main.yml index 5d527b4ae..d3e35e9e9 100644 --- a/ansible/roles/export_repos/tasks/main.yml +++ b/ansible/roles/export_repos/tasks/main.yml @@ -31,4 +31,4 @@ shell: vcs export {{workspace_path}}/src > packages_exact.repos --exact - name: export repos file - shell: vcs export {{workspace_path}}/src > packages_exact.repos \ No newline at end of file + shell: vcs export {{workspace_path}}/src > packages.repos diff --git a/workflow_templates/Release.yaml b/workflow_templates/Release.yaml index fb0623280..40aa7ff13 100644 --- a/workflow_templates/Release.yaml +++ b/workflow_templates/Release.yaml @@ -12,7 +12,7 @@ jobs: if: startsWith(github.event.issue.title, 'Release ') steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: create release id: create_release uses: at-wat/catkin-release-action@v1