diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4bfe992..9e3a7b54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,8 @@ on: pull_request: branches: [ master ] paths-ignore: '**.md' + repository_dispatch: + types: [trigger-event] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -17,45 +19,42 @@ jobs: strategy: matrix: DISTRO: [ - { "base_image": "jammy", "suffix": "gcc" }, - { "base_image": "jammy_cuda12.2", "suffix": "gcc.cuda" } + { "ubuntu": "jammy", "suffix": "gcc" } + # { "ubuntu": "jammy_cuda12.2", "suffix": "gcc.cuda" } ] steps: - uses: actions/checkout@v2 with: - repository: 'https://github.com/koide3/gtsam_points' - path: 'gtsam_points' - token: ${{ secrets.GH_PAT }} - submodules: recursive - - - uses: actions/checkout@v2 - with: - path: 'glim' token: ${{ secrets.GH_PAT }} submodules: recursive - name: Docker login continue-on-error: true - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - - name: Docker build (gtsam_points) + - name: Docker build uses: docker/build-push-action@v6 with: - file: ${{github.workspace}}/docker/ubuntu/Dockerfile.${ matrix.DISTRO.suffix } + tags: koide3/glim:${{ matrix.DISTRO.ubuntu }} + file: ${{github.workspace}}/docker/ubuntu/Dockerfile.${{ matrix.DISTRO.suffix }} build-args: | - BASE_IMAGE=koide3/gtsam_docker:${{ matrix.DISTRO.ubuntu }} - context: gtsam_points - tags: gtsam_points + BASE_IMAGE=koide3/gtsam_points:${{ matrix.DISTRO.ubuntu }} + context: . - - name: Docker build (glim) - uses: docker/build-push-action@v6 + dispatch: + needs: build + strategy: + matrix: + repo: ['koide3/glim_ros1', 'koide3/glim_ros2'] + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v3 with: - file: ${{github.workspace}}/docker/ubuntu/Dockerfile.${ matrix.DISTRO.suffix } - build-args: | - BASE_IMAGE=gtsam_points - context: glim - tags: glim + token: ${{ secrets.GH_PAT }} + repository: ${{ matrix.repo }} + event-type: trigger-event \ No newline at end of file diff --git a/docker/ubuntu/Dockerfile.gcc b/docker/ubuntu/Dockerfile.gcc index e88443a3..c43ceffb 100644 --- a/docker/ubuntu/Dockerfile.gcc +++ b/docker/ubuntu/Dockerfile.gcc @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=gtsam_points +ARG BASE_IMAGE=koide3/gtsam_points:jammy FROM $BASE_IMAGE RUN apt-get update \ @@ -14,8 +14,9 @@ RUN cmake .. \ -DBUILD_WITH_CUDA=OFF \ -DBUILD_WITH_VIEWER=OFF \ -DBUILD_WITH_MARCH_NATIVE=OFF \ - -DCMAKE_BUILD_TYPE=Release -RUN make -j$(nproc) + -DCMAKE_BUILD_TYPE=Release && \ + make -j$(nproc) && \ + rm -rf /root/glim/build # with viewer WORKDIR /root/glim/build diff --git a/docker/ubuntu/Dockerfile.gcc.cuda b/docker/ubuntu/Dockerfile.gcc.cuda index fd11eac1..73c716e2 100644 --- a/docker/ubuntu/Dockerfile.gcc.cuda +++ b/docker/ubuntu/Dockerfile.gcc.cuda @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=gtsam_points +ARG BASE_IMAGE=koide3/gtsam_points:jammy_cuda12.2 FROM $BASE_IMAGE RUN apt-get update \ diff --git a/docker/ubuntu/Dockerfile.llvm b/docker/ubuntu/Dockerfile.llvm index 283269a7..7c198c4e 100644 --- a/docker/ubuntu/Dockerfile.llvm +++ b/docker/ubuntu/Dockerfile.llvm @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=koide3/gtsam_docker:jammy_cuda12.2 +ARG BASE_IMAGE=koide3/gtsam_points:jammy FROM $BASE_IMAGE RUN apt-get update \ @@ -28,16 +28,4 @@ RUN CC=clang CXX=clang++ cmake .. \ -DCMAKE_BUILD_TYPE=Release RUN make -j$(nproc) -# resolve omp_is_initial_device-related errors -RUN sed -i '496{s/^/\/\//}' /usr/lib/llvm-14/lib/clang/14.0.0/include/omp.h - -# with CUDA -WORKDIR /root/glim/build -RUN CC=clang CXX=clang++ cmake .. \ - -DBUILD_WITH_CUDA=ON \ - -DBUILD_WITH_VIEWER=ON \ - -DBUILD_WITH_MARCH_NATIVE=OFF \ - -DCMAKE_BUILD_TYPE=Release -RUN make -j$(nproc) - CMD ["bash"]