From 2037292cf42a306960efbd58bcbda483119d334c Mon Sep 17 00:00:00 2001 From: Masaya Kataoka Date: Sun, 18 Aug 2024 02:02:38 +0900 Subject: [PATCH] Feature/x86 image (#349) * remove unused images Signed-off-by: Masaya Kataoka * add linux/amd64 to the platform Signed-off-by: Masaya Kataoka * update base image Signed-off-by: Masaya Kataoka --------- Signed-off-by: Masaya Kataoka --- .../workflows/docker/dev_container/Dockerfile | 18 --- .../workflows/docker/dev_container/README.md | 21 ---- .../docker/dev_container/action.yaml | 79 ------------- .../docker/dev_container/entrypoint.sh | 4 - .../docker/dev_container/entrypoint_vnc.sh | 4 - .../docker/dev_container/tmp/.gitignore | 1 - .../workflows/docker/l4t_opencv/Dockerfile | 110 ------------------ .../workflows/docker/l4t_opencv/action.yaml | 62 ---------- .github/workflows/docker/wamv/Dockerfile | 4 +- .github/workflows/docker/wamv/action.yaml | 14 ++- .github/workflows/docker_push.yaml | 51 ++------ 11 files changed, 22 insertions(+), 346 deletions(-) delete mode 100644 .github/workflows/docker/dev_container/Dockerfile delete mode 100644 .github/workflows/docker/dev_container/README.md delete mode 100644 .github/workflows/docker/dev_container/action.yaml delete mode 100644 .github/workflows/docker/dev_container/entrypoint.sh delete mode 100644 .github/workflows/docker/dev_container/entrypoint_vnc.sh delete mode 100644 .github/workflows/docker/dev_container/tmp/.gitignore delete mode 100644 .github/workflows/docker/l4t_opencv/Dockerfile delete mode 100644 .github/workflows/docker/l4t_opencv/action.yaml diff --git a/.github/workflows/docker/dev_container/Dockerfile b/.github/workflows/docker/dev_container/Dockerfile deleted file mode 100644 index 921452820..000000000 --- a/.github/workflows/docker/dev_container/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -ARG BASE_IMAGE -FROM $BASE_IMAGE - -RUN apt-get update && \ - apt-get install -y git python3 python3-pip && \ - apt-get -y clean && \ - rm -rf /var/lib/apt/lists/* -RUN pip3 install ansible\==2.9.8 -WORKDIR /home -COPY tmp/ouxt_automation /home/ouxt_automation -WORKDIR /home/ouxt_automation -RUN ansible-playbook -i ansible/hosts/localhost.ini ansible/setup_dev_environment.yml --connection local --ask-become-pass -e ansible_user=root - -WORKDIR / -ARG ENTRYPOINT_SH -COPY ${ENTRYPOINT_SH} /entrypoint.sh -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/workflows/docker/dev_container/README.md b/.github/workflows/docker/dev_container/README.md deleted file mode 100644 index b6b548c64..000000000 --- a/.github/workflows/docker/dev_container/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# dev_container - -## How to use - -### nogui -```bash -docker run -it --rm wamvtan/dev_container /bin/bash -``` - -### with vnc - -```bash -docker run -p 6080:80 --shm-size=512m wamvtan/dev_container_vnc -``` - -open [http://127.0.0.1:6080/](http://127.0.0.1:6080/) on the browser. - -## Recomended usage - -Install vscode and devcontainers plugin. -Official documetnation of this plugin is [here.](https://code.visualstudio.com/docs/remote/containers) diff --git a/.github/workflows/docker/dev_container/action.yaml b/.github/workflows/docker/dev_container/action.yaml deleted file mode 100644 index a6749b3c8..000000000 --- a/.github/workflows/docker/dev_container/action.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: "Build dev-container image action" -description: "Build dev-container docker images" - -inputs: - docker_username: - description: "Username for Dockerhub" - required: true - docker_password: - description: "Password for Dockerhub" - required: true - base_image: - description: "Base image" - required: true - image_name: - description: "Docker image name" - required: true - entrypoint: - description: "Name of the entrypoint.sh" - required: true - -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - with: - path: ./.github/workflows/docker/dev_container/tmp/ouxt_automation - clean: false - - 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/dev_container - file: ./.github/workflows/docker/dev_container/Dockerfile - tags: ${{ inputs.image_name }}:latest - build-args: | - BASE_IMAGE=${{ inputs.base_image }} - ENTRYPOINT_SH=${{ inputs.entrypoint }} - no-cache: true - # cache-from: type=registry,ref=wamvtan/dev_container:buildcache - # cache-to: type=registry,ref=wamvtan/dev_container:buildcache,mode=max - push: true - - 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/dev_container - file: ./.github/workflows/docker/dev_container/Dockerfile - tags: ${{ inputs.image_name }}:latest - build-args: | - BASE_IMAGE=${{ inputs.base_image }} - ENTRYPOINT_SH=${{ inputs.entrypoint }} - no-cache: true - # cache-from: type=registry,ref=wamvtan/dev_container:buildcache - push: false - # - uses: peter-evans/dockerhub-description@v3 - # if: ${{ github.event_name != 'pull_request'}} - # with: - # username: ${{ inputs.docker_username }} - # password: ${{ inputs.docker_password }} - # repository: ${{ inputs.image_name }}:latest - # short-description: "Docker Image for Robot Development" - # readme-filepath: ./.github/workflows/docker/dev_container/README.md - # enable-url-completion: true diff --git a/.github/workflows/docker/dev_container/entrypoint.sh b/.github/workflows/docker/dev_container/entrypoint.sh deleted file mode 100644 index 4cd9818c5..000000000 --- a/.github/workflows/docker/dev_container/entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -source /opt/ros/humble/setup.bash -source /home/ouxt_automation/robotx_ws/install/local_setup.bash -exec "$@" diff --git a/.github/workflows/docker/dev_container/entrypoint_vnc.sh b/.github/workflows/docker/dev_container/entrypoint_vnc.sh deleted file mode 100644 index 6e8e3378e..000000000 --- a/.github/workflows/docker/dev_container/entrypoint_vnc.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -source /opt/ros/humble/setup.bash -source /home/ouxt_automation/robotx_ws/install/local_setup.bash -sh /startup.sh diff --git a/.github/workflows/docker/dev_container/tmp/.gitignore b/.github/workflows/docker/dev_container/tmp/.gitignore deleted file mode 100644 index 8e60fd69b..000000000 --- a/.github/workflows/docker/dev_container/tmp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ouxt_automation \ No newline at end of file diff --git a/.github/workflows/docker/l4t_opencv/Dockerfile b/.github/workflows/docker/l4t_opencv/Dockerfile deleted file mode 100644 index 4c4d1a58b..000000000 --- a/.github/workflows/docker/l4t_opencv/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM nvcr.io/nvidia/l4t-base:r32.5.0 - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - build-essential \ - cmake \ - file \ - gfortran \ - git \ - libatlas-base-dev \ - libavcodec-dev \ - libavcodec-dev \ - libavformat-dev \ - libavformat-dev \ - libavresample-dev \ - libavutil-dev \ - libcanberra-gtk3-module \ - libdc1394-22-dev \ - libeigen3-dev \ - libglew-dev \ - libgstreamer-plugins-base1.0-dev \ - libgstreamer-plugins-good1.0-dev \ - libgstreamer1.0-dev \ - libgtk-3-dev \ - libgtkglext1 \ - libgtkglext1-dev \ - libjpeg-dev \ - libjpeg-turbo8-dev \ - libjpeg8-dev \ - liblapack-dev \ - liblapacke-dev \ - libopenblas-dev \ - libpng-dev \ - libpostproc-dev \ - libswscale-dev \ - libswscale-dev \ - libtbb-dev \ - libtbb2 \ - libtesseract-dev \ - libtiff-dev \ - libv4l-dev \ - libx264-dev \ - libxine2-dev \ - libxvidcore-dev \ - pkg-config \ - qv4l2 \ - tar \ - v4l-utils \ - v4l2ucp \ - zlib1g-dev \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get clean - -ARG OPENCV_VERSION="4.5.0" - -RUN git config --global http.sslVerify false && \ - git clone --depth 1 --branch $OPENCV_VERSION https://github.com/opencv/opencv.git && \ - git clone --depth 1 --branch $OPENCV_VERSION https://github.com/opencv/opencv_contrib.git - -WORKDIR /opencv -RUN mkdir /opencv/build -WORKDIR /opencv/build - -RUN cmake \ - -D BUILD_BUILD_JASPER=OFF \ - -D BUILD_DOCS=OFF \ - -D BUILD_EXAMPLES=OFF \ - -D BUILD_JPEG=ON \ - -D BUILD_opencv_apps=OFF \ - -D BUILD_opencv_cudev=OFF \ - -D BUILD_opencv_world=OFF \ - -D BUILD_opencv_python2=OFF \ - -D BUILD_opencv_python3=OFF \ - -D BUILD_PERF_TESTS=OFF \ - -D BUILD_PNG=ON \ - -D BUILD_TESTS=OFF \ - -D BUILD_TIFF=ON \ - -D BUILD_ZLIB=ON \ - -D CMAKE_BUILD_TYPE=RELEASE \ - -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \ - -D FORCE_VTK=OFF \ - -D opencv_cudev=OFF \ - -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ - -D WITH_CAROTENE=OFF \ - -D WITH_CUDA=OFF \ - -D WITH_FFMPEG=OFF \ - -D WITH_GDAL=OFF \ - -D WITH_IPP=OFF \ - -D WITH_ITT=OFF \ - -D WITH_JASPER=OFF \ - -D WITH_LAPACK=OFF \ - -D WITH_OPENCL=OFF \ - -D WITH_OPENCLAMDBLAS=OFF \ - -D WITH_OPENCLAMDFFT=OFF \ - -D WITH_OPENEXR=OFF \ - -D WITH_OPENGL=OFF \ - -D WITH_PNG=ON \ - -D WITH_QT=OFF \ - -D WITH_TBB=OFF \ - -D WITH_TIFF=ON \ - -D WITH_VA_INTEL=OFF \ - -D WITH_WEBP=OFF \ - -D WITH_XINE=OFF \ - -D OPENCV_ENABLE_NONFREE=ON \ -../ && \ - make -j$(nproc) && \ - make install - -WORKDIR / -RUN rm -rf opencv opencv_contrib \ No newline at end of file diff --git a/.github/workflows/docker/l4t_opencv/action.yaml b/.github/workflows/docker/l4t_opencv/action.yaml deleted file mode 100644 index b573a00a5..000000000 --- a/.github/workflows/docker/l4t_opencv/action.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: "Build L4T OpenCV image action" -description: "Build L4T OpenCV docker images" - -inputs: - docker_username: - description: "Username for Dockerhub" - required: true - docker_password: - description: "Password for Dockerhub" - required: true - opencv_version: - description: "Version of opencv you want to use" - required: true - -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Setup QEMU user-mode emulation - uses: docker/setup-qemu-action@v1 - - 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/l4t_opencv - file: ./.github/workflows/docker/l4t_opencv/Dockerfile - tags: wamvtan/l4t_opencv:${{ inputs.opencv_version }} - build-args: | - OPENCV_VERSION=${{ inputs.opencv_version }} - platforms: linux/arm64/v8 - no-cache: false - cache-from: type=registry,ref=wamvtan/l4t_opencv:${{ inputs.opencv_version }}-buildcache - cache-to: type=registry,ref=wamvtan/l4t_opencv:${{ inputs.opencv_version }}-buildcache,mode=max - push: true - - 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/l4t_opencv - file: ./.github/workflows/docker/l4t_opencv/Dockerfile - tags: wamvtan/l4t_opencv:${{ inputs.opencv_version }} - build-args: | - OPENCV_VERSION=${{ inputs.opencv_version }} - platforms: linux/arm64/v8 - no-cache: false - cache-from: type=registry,ref=wamvtan/l4t_opencv:${{ inputs.opencv_version }}-buildcache - push: false diff --git a/.github/workflows/docker/wamv/Dockerfile b/.github/workflows/docker/wamv/Dockerfile index 7f10977b7..b9eba245e 100644 --- a/.github/workflows/docker/wamv/Dockerfile +++ b/.github/workflows/docker/wamv/Dockerfile @@ -1,4 +1,6 @@ -FROM docker.io/hakuturu583/cuda_ros:lt4-humble-cuda-12.2.2-devel +ARG BASE_IMAGE=docker.io/hakuturu583/cuda_ros:lt4-humble-cuda-12.2.2-devel + +FROM $BASE_IMAGE SHELL ["/bin/bash", "-c"] RUN apt-get update && \ diff --git a/.github/workflows/docker/wamv/action.yaml b/.github/workflows/docker/wamv/action.yaml index 9aecbc3d5..059b45ceb 100644 --- a/.github/workflows/docker/wamv/action.yaml +++ b/.github/workflows/docker/wamv/action.yaml @@ -11,6 +11,12 @@ inputs: module: description: "Software module" required: true + base_image: + description: "Name of base image" + required: true + platform: + description: "Platform of the image" + required: true runs: using: "composite" @@ -37,7 +43,9 @@ runs: 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 + platforms: ${{ inputs.platform }} + build-args: | + BASE_IMAGE=${{ inputs.base_image }} - name: Build Docker Image if: ${{ github.event_name == 'pull_request'}} uses: docker/build-push-action@v2 @@ -52,4 +60,6 @@ runs: no-cache: false cache-from: type=registry,ref=wamvtan/wamv_${{ inputs.module }}:buildcache push: false - platforms: linux/arm64/v8 + platforms: ${{ inputs.platform }} + build-args: | + BASE_IMAGE=${{ inputs.base_image }} diff --git a/.github/workflows/docker_push.yaml b/.github/workflows/docker_push.yaml index 7c08f7da0..6cdaef8c9 100644 --- a/.github/workflows/docker_push.yaml +++ b/.github/workflows/docker_push.yaml @@ -11,50 +11,6 @@ on: release: types: [published] jobs: - l4t_opencv: - name: build and push wamvtan/l4t_opencv - runs-on: ubuntu-22.04 - timeout-minutes: 360 - strategy: - matrix: - opencv_version: ["4.4.0", "4.5.0"] - steps: - - uses: actions/checkout@v4 - - uses: ./.github/workflows/actions/cleanup_runner - - uses: ./.github/workflows/docker/l4t_opencv - with: - docker_username: ${{ secrets.DOCKER_USERNAME }} - docker_password: ${{ secrets.DOCKER_PASSWORD }} - opencv_version: ${{ matrix.opencv_version }} - # dev_container: - # name: build and push wamvtan/dev_container and wamvtan/dev_container_vnc - # runs-on: ubuntu-22.04 - # timeout-minutes: 120 - # strategy: - # fail-fast: false - # max-parallel: 8 - # matrix: - # # gui: [novnc, vnc] - # gui: [novnc] - # include: - # - docker_image: wamvtan/dev_container - # base_image: ubuntu:22.04 - # gui: novnc - # entrypoint: entrypoint.sh - # - docker_image: wamvtan/dev_container_vnc - # base_image: tiryoh/ros2-desktop-vnc:humble-amd64-20230115T1406 - # gui: vnc - # entrypoint: entrypoint_vnc.sh - # steps: - # - uses: actions/checkout@v4 - # - uses: ./.github/workflows/actions/cleanup_runner - # - uses: ./.github/workflows/docker/dev_container - # with: - # docker_username: ${{ secrets.DOCKER_USERNAME }} - # docker_password: ${{ secrets.DOCKER_PASSWORD }} - # image_name: ${{ matrix.docker_image }} - # base_image: ${{ matrix.base_image }} - # entrypoint: ${{ matrix.entrypoint }} yolox: name: build and push wamvtan/yolox runs-on: ubuntu-22.04 @@ -134,6 +90,11 @@ jobs: strategy: matrix: module: ["perception", "control", "drivers", "localization", "planning"] + include: + - platform: "linux/arm64/v8" + base_image: docker.io/hakuturu583/cuda_ros:lt4-humble-cuda-12.2.2-devel + - platform: "linux/amd64" + base_image: docker.io/hakuturu583/cuda_ros:humble-cuda-12.2.0-devel steps: - uses: actions/checkout@v4 - uses: ./.github/workflows/actions/cleanup_runner @@ -148,3 +109,5 @@ jobs: docker_username: ${{ secrets.DOCKER_USERNAME }} docker_password: ${{ secrets.DOCKER_PASSWORD }} module: ${{ matrix.module }} + platform: ${{ matrix.platform }} + base_image: ${{ matrix.base_image }}