Skip to content

Commit

Permalink
new ci (#13)
Browse files Browse the repository at this point in the history
* new ci

* fix url
  • Loading branch information
koide3 authored Jul 10, 2024
1 parent efa9f9c commit d0714eb
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 108 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/*
docs/*
docker/*
35 changes: 30 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -16,7 +18,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
DISTRO: [focal, focal_llvm, jammy, jammy_llvm]
DISTRO: [
{ "ubuntu": "noble", "suffix": "gcc" },
{ "ubuntu": "noble", "suffix": "llvm" },
{ "ubuntu": "jammy", "suffix": "gcc" },
{ "ubuntu": "jammy", "suffix": "llvm" },
{ "ubuntu": "jammy_cuda12.2", "suffix": "gcc.cuda" },
{ "ubuntu": "jammy_cuda12.2", "suffix": "llvm.cuda" }
]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,14 +35,30 @@ jobs:

- 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
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
file: ${{github.workspace}}/docker/${{ matrix.DISTRO }}/Dockerfile
tags: koide3/glim:${{ matrix.DISTRO.ubuntu }}
file: ${{github.workspace}}/docker/ubuntu/Dockerfile.${{ matrix.DISTRO.suffix }}
build-args: |
BASE_IMAGE=koide3/gtsam_points:${{ matrix.DISTRO.ubuntu }}
context: .
push: false

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:
token: ${{ secrets.GH_PAT }}
repository: ${{ matrix.repo }}
event-type: trigger-event
38 changes: 38 additions & 0 deletions .github/workflows/gendoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: gendoc

on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
gendoc:
name: Generate documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name : Install dependencies
run: sudo apt-get install -y git cmake build-essential doxygen graphviz python3-dev

- name: Install python dependencies
run: python -m pip install mkdocs mkdocs-material

- name: Generate documentation
run: cd docs && make all

- uses: actions/upload-artifact@v4
with:
name: site
path: ./site/*

- name: Deploy documentation
run: cd docs && make deploy
37 changes: 0 additions & 37 deletions docker/jammy/Dockerfile

This file was deleted.

42 changes: 0 additions & 42 deletions docker/jammy_llvm/Dockerfile

This file was deleted.

14 changes: 3 additions & 11 deletions docker/focal/Dockerfile → docker/ubuntu/Dockerfile.gcc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM koide3/gtsam_docker:focal_cuda11.2
ARG BASE_IMAGE=koide3/gtsam_points:jammy
FROM $BASE_IMAGE

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
Expand All @@ -14,7 +15,7 @@ RUN cmake .. \
-DBUILD_WITH_VIEWER=OFF \
-DBUILD_WITH_MARCH_NATIVE=OFF \
-DCMAKE_BUILD_TYPE=Release
RUN make -j$(nproc)
RUN make -j$(nproc)

# with viewer
WORKDIR /root/glim/build
Expand All @@ -25,13 +26,4 @@ RUN cmake .. \
-DCMAKE_BUILD_TYPE=Release
RUN make -j$(nproc)

# with CUDA
WORKDIR /root/glim/build
RUN cmake .. \
-DBUILD_WITH_CUDA=ON \
-DBUILD_WITH_VIEWER=ON \
-DBUILD_WITH_MARCH_NATIVE=OFF \
-DCMAKE_BUILD_TYPE=Release
RUN make -j$(nproc)

CMD ["bash"]
20 changes: 20 additions & 0 deletions docker/ubuntu/Dockerfile.gcc.cuda
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG BASE_IMAGE=koide3/gtsam_points:jammy_cuda12.2
FROM $BASE_IMAGE

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
libfmt-dev libspdlog-dev libopencv-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# with CUDA
COPY . /root/glim
WORKDIR /root/glim/build
RUN cmake .. \
-DBUILD_WITH_CUDA=ON \
-DBUILD_WITH_VIEWER=ON \
-DBUILD_WITH_MARCH_NATIVE=OFF \
-DCMAKE_BUILD_TYPE=Release
RUN make -j$(nproc)

CMD ["bash"]
12 changes: 2 additions & 10 deletions docker/focal_llvm/Dockerfile → docker/ubuntu/Dockerfile.llvm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM koide3/gtsam_docker:focal_cuda11.2
ARG BASE_IMAGE=koide3/gtsam_points:jammy
FROM $BASE_IMAGE

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
Expand Down Expand Up @@ -27,13 +28,4 @@ RUN CC=clang CXX=clang++ cmake .. \
-DCMAKE_BUILD_TYPE=Release
RUN make -j$(nproc)

# 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"]
22 changes: 22 additions & 0 deletions docker/ubuntu/Dockerfile.llvm.cuda
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG BASE_IMAGE=koide3/gtsam_points:jammy
FROM $BASE_IMAGE

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
libfmt-dev libspdlog-dev libopencv-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 50

# with CUDA
COPY . /root/glim
WORKDIR /root/glim/build
RUN cmake .. \
-DBUILD_WITH_CUDA=ON \
-DBUILD_WITH_VIEWER=ON \
-DBUILD_WITH_MARCH_NATIVE=OFF \
-DCMAKE_BUILD_TYPE=Release
RUN make -j$(nproc)

CMD ["bash"]
22 changes: 22 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.PHONY: help
help:
@echo "make cpp|all"

.PHONY: cpp
cpp:
@echo "Building C++ documentation..."
doxygen Doxyfile doc_cpp

.PHONY: mkdocs
mkdocs:
@echo "Building MkDocs documentation..."
cd .. && mkdocs build

.PHONY: all
all: cpp mkdocs
@echo "All documentation built."

.PHONY: deploy
deploy:
@echo "Deploying documentation..."
cd .. && mkdocs gh-deploy --force
5 changes: 2 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

## Doxygen generated API list

* [gtsam_points](https://staff.aist.go.jp/k.koide/projects/doxygen/gtsam_points/): GTSAM factors for range-based SLAM
* [glim](https://staff.aist.go.jp/k.koide/projects/doxygen/glim/): Main LiDAR-IMU SLAM package
* [glim_ext](https://staff.aist.go.jp/k.koide/projects/doxygen/glim_ext/): Example implementations of extension modules
* [gtsam_points](https://koide3.github.io/gtsam_points/doc_cpp/index.html): GTSAM factors for range-based SLAM
* [glim](https://koide3.github.io/glim/doc_cpp/index.html): LiDAR-IMU localization and mapping

## Related Repositories
* [gtsam_points (https://github.com/koide3/gtsam_points)](https://github.com/koide3/gtsam_points)
Expand Down

0 comments on commit d0714eb

Please sign in to comment.