-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,002 additions
and
672 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
# Ignore Docker files | ||
docker | ||
!docker/etc | ||
!docker/scripts | ||
|
||
# Ignore a part of files under src | ||
src/**/.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
name: docker-build-and-push-cuda | ||
description: Composite action to build and push CUDA images to registry. | ||
|
||
inputs: | ||
platform: | ||
description: Target platform. | ||
required: true | ||
target-image: | ||
description: Target docker image name in the registry. | ||
required: true | ||
build-args: | ||
description: Additional build args. | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install jq and vcstool | ||
run: | | ||
sudo apt-get -y update | ||
sudo apt-get -y install jq python3-pip | ||
pip install --no-cache-dir vcstool | ||
shell: bash | ||
|
||
- name: Run vcs import | ||
run: | | ||
mkdir src | ||
vcs import src < autoware.repos | ||
shell: bash | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Restore ccache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
root-ccache | ||
key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }} | ||
restore-keys: | | ||
ccache-${{ inputs.platform }}- | ||
- name: Restore apt-get | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
var-cache-apt | ||
key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }} | ||
restore-keys: | | ||
apt-get-${{ inputs.platform }}- | ||
- name: Inject cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-map: | | ||
{ | ||
"root-ccache": "/root/.ccache", | ||
"var-cache-apt": "/var/cache/apt" | ||
} | ||
skip-extraction: true | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Docker meta for autoware:base-cuda | ||
id: meta-base-cuda | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} | ||
tags: | | ||
type=raw,value=base-cuda-${{ inputs.platform }} | ||
type=raw,value=base-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} | ||
bake-target: docker-metadata-action-base-cuda | ||
flavor: | | ||
latest=false | ||
- name: Docker meta for autoware:universe-sensing-perception-devel-cuda | ||
id: meta-universe-sensing-perception-devel-cuda | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} | ||
tags: | | ||
type=raw,value=universe-sensing-perception-devel-cuda-${{ inputs.platform }} | ||
type=raw,value=universe-sensing-perception-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} | ||
bake-target: docker-metadata-action-universe-sensing-perception-devel-cuda | ||
flavor: | | ||
latest=false | ||
- name: Docker meta for autoware:universe-sensing-perception-cuda | ||
id: meta-universe-sensing-perception-cuda | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} | ||
tags: | | ||
type=raw,value=universe-sensing-perception-cuda-${{ inputs.platform }} | ||
type=raw,value=universe-sensing-perception-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} | ||
bake-target: docker-metadata-action-universe-sensing-perception-cuda | ||
flavor: | | ||
latest=false | ||
- name: Docker meta for autoware:universe-devel-cuda | ||
id: meta-universe-devel-cuda | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} | ||
tags: | | ||
type=raw,value=universe-devel-cuda-${{ inputs.platform }} | ||
type=raw,value=universe-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} | ||
bake-target: docker-metadata-action-universe-devel-cuda | ||
flavor: | | ||
latest=false | ||
- name: Docker meta for autoware:universe-cuda | ||
id: meta-universe-cuda | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} | ||
tags: | | ||
type=raw,value=universe-cuda-${{ inputs.platform }} | ||
type=raw,value=universe-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} | ||
bake-target: docker-metadata-action-universe-cuda | ||
flavor: | | ||
latest=auto | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ github.token }} | ||
|
||
- name: Build and Push to GitHub Container Registry | ||
uses: docker/bake-action@v5 | ||
with: | ||
push: true | ||
files: | | ||
docker/docker-bake-cuda.hcl | ||
${{ steps.meta-base-cuda.outputs.bake-file }} | ||
${{ steps.meta-universe-sensing-perception-devel-cuda.outputs.bake-file }} | ||
${{ steps.meta-universe-sensing-perception-cuda.outputs.bake-file }} | ||
${{ steps.meta-universe-devel-cuda.outputs.bake-file }} | ||
${{ steps.meta-universe-cuda.outputs.bake-file }} | ||
provenance: false | ||
set: | | ||
${{ inputs.build-args }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.