Skip to content

Commit

Permalink
first test at building base images
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwardius committed Dec 22, 2023
1 parent 6c8d606 commit f18fc21
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 23 deletions.
113 changes: 106 additions & 7 deletions .github/include/base_image_config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,114 @@
[
{
"tag": "humble-ubuntu22.04",
"external_image": "ros:humble-ros-base",
"injections": {}
"external_image": "ros:humble-ros-runtime"
},





{
"tag": "cuda11.2-tensorrt8.6.0-humble-ubuntu22.04",
"external_image": "ros:humble-ros-base",
"tag": "cuda11.0-foxy-ubuntu20.04",
"external_image": "nvcr.io/nvidia/cuda:11.0.3-runtime-ubuntu20.04",
"injections": {
"ros2": "humble",
"tensorrt": "nv-tensorrt-local-repo-ubuntu2204-8.6.0-cuda-12.0_1.0-1_amd64"
"ros2": "foxy"
}
},
{
"tag": "cuda11.2-foxy-ubuntu20.04",
"external_image": "nvcr.io/nvidia/cuda:11.2.2-runtime-ubuntu20.04",
"injections": {
"ros2": "foxy"
}
},
{
"tag": "cuda11.4-foxy-ubuntu20.04",
"external_image": "nvcr.io/nvidia/cuda:11.4.3-runtime-ubuntu20.04",
"injections": {
"ros2": "foxy"
}
},
{
"tag": "cuda11.7-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:11.7.1-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},
{
"tag": "cuda11.8-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:11.8.0-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},
{
"tag": "cuda12.0-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:12.0.0-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},
{
"tag": "cuda12.2-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:12.2.2-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},





{
"tag": "cuda11.0-cudnn8-foxy-ubuntu20.04",
"external_image": "nvcr.io/nvidia/cuda:11.0.3-cudnn8-runtime-ubuntu20.04",
"injections": {
"ros2": "foxy"
}
},
{
"tag": "cuda11.2-cudnn8-foxy-ubuntu20.04",
"external_image": "nvcr.io/nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04",
"injections": {
"ros2": "foxy"
}
},
{
"tag": "cuda11.4-cudnn8-foxy-ubuntu20.04",
"external_image": "nvcr.io/nvidia/cuda:11.4.3-cudnn8-runtime-ubuntu20.04",
"injections": {
"ros2": "foxy"
}
},
{
"tag": "cuda11.7-cudnn8-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},
{
"tag": "cuda11.8-cudnn8-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},
{
"tag": "cuda12.0-cudnn8-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
},
{
"tag": "cuda12.2-cudnn8-humble-ubuntu22.04",
"external_image": "nvcr.io/nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04",
"injections": {
"ros2": "humble"
}
}
]
]
38 changes: 22 additions & 16 deletions .github/workflows/build_base_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ jobs:
id: docker-environment
uses: "./.github/templates/docker_context"

matrix-prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out code
uses: actions/checkout@v4
- id: set-matrix
run: |
platform=$(echo '${{ inputs.platform }}')
matrix=$(jq --arg platform "$platform" 'map(
. | select((.run_if==$platform) or (.run_if=="always"))
)' .github/include/base_image_config.json)
echo "matrix={\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
build:
name: Build Image and Run Initial Unit Testing Suite
runs-on: ubuntu-latest
Expand All @@ -43,16 +58,7 @@ jobs:

strategy:
fail-fast: false
matrix:
include:
- tag: humble-ubuntu22.04
external_image: ros:humble-ros-base
- tag: cuda12.0.1-humble-ubuntu22.04
dockerfile: cuda_ros.Dockerfile
params:
UBUNTU_DISTRO: ubuntu22.04
CUDA_VERSION: 12.0.1
ROS_DISTRO: humble
matrix: ${{ fromJSON(needs.matrix-prep.outputs.matrix) }}

steps:
# Initial workflow setup
Expand All @@ -76,11 +82,12 @@ jobs:
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_PWD }}

- name: Build Generic Image
- name: Inject ROS2 into Image
if: $( -z "${{ matrix.injections.ros2 }}" )
uses: docker/build-push-action@v5
with:
context: .
file: docker/base/${{ matrix.dockerfile }}
file: docker/base/inject_ros2.Dockerfile
push: true
tags: |
${{ steps.construct-registry-url.outputs.url }}_generic
Expand All @@ -89,10 +96,9 @@ jobs:
cache-to: type=inline
builder: ${{ steps.buildx.outputs.name }}
target: devel
build-args: |
UBUNTU_DISTRO=${{ matrix.params.UBUNTU_DISTRO }}
CUDA_VERSION=${{ matrix.params.CUDA_VERSION }}
ROS_DISTRO=${{ matrix.params.ROS_DISTRO }}
build-args: |
GENERIC_BASE=${{ matrix.external_image }}
ROS_DISTRO=${{ matrix.injections.ros2 }}
- name: Prepare Generic Image as Monorepo Base Image
uses: docker/build-push-action@v5
Expand Down

0 comments on commit f18fc21

Please sign in to comment.