Skip to content

Commit

Permalink
Revert "integrate"
Browse files Browse the repository at this point in the history
This reverts commit 0c7459d.
  • Loading branch information
youtalk committed Oct 23, 2024
1 parent 059e869 commit b22a9c7
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 39 deletions.
123 changes: 123 additions & 0 deletions .github/actions/docker-build-and-push-cuda/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: docker-build-and-push
description: ""

inputs:
platform:
description: ""
required: true
bake-target:
description: ""
required: true
build-args:
description: ""
required: false
dockerhub-token:
description: ""
required: true

runs:
using: composite
steps:
- 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:universe-sensing-perception-devel-cuda
id: meta-universe-sensing-perception-devel-cuda
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
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: ${{ github.repository_owner }}/${{ inputs.bake-target }}
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: ${{ github.repository_owner }}/${{ inputs.bake-target }}
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: ${{ github.repository_owner }}/${{ inputs.bake-target }}
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 Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ inputs.dockerhub-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-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 }}
16 changes: 12 additions & 4 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ runs:
flavor: |
latest=false
<<<<<<< HEAD
- name: Docker meta for autoware:universe-sensing-perception-devel-cuda
id: meta-universe-sensing-perception-devel-cuda
uses: docker/metadata-action@v5
Expand All @@ -112,6 +113,8 @@ runs:
flavor: |
latest=false
=======
>>>>>>> 3f6461b (Revert "integrate")
- name: Docker meta for autoware:universe-sensing-perception
id: meta-universe-sensing-perception
uses: docker/metadata-action@v5
Expand All @@ -124,6 +127,7 @@ runs:
flavor: |
latest=false
<<<<<<< HEAD
- name: Docker meta for autoware:universe-sensing-perception-cuda
id: meta-universe-sensing-perception-cuda
uses: docker/metadata-action@v5
Expand All @@ -136,6 +140,8 @@ runs:
flavor: |
latest=false
=======
>>>>>>> 3f6461b (Revert "integrate")
- name: Docker meta for autoware:universe-localization-mapping-devel
id: meta-universe-localization-mapping-devel
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -220,6 +226,7 @@ runs:
flavor: |
latest=false
<<<<<<< HEAD
- name: Docker meta for autoware:universe-devel-cuda
id: meta-universe-devel-cuda
uses: docker/metadata-action@v5
Expand All @@ -232,6 +239,8 @@ runs:
flavor: |
latest=false
=======
>>>>>>> 3f6461b (Revert "integrate")
- name: Docker meta for autoware:universe
id: meta-universe
uses: docker/metadata-action@v5
Expand All @@ -244,6 +253,7 @@ runs:
flavor: |
latest=auto
<<<<<<< HEAD
- name: Docker meta for autoware:universe-cuda
id: meta-universe-cuda
uses: docker/metadata-action@v5
Expand All @@ -256,6 +266,8 @@ runs:
flavor: |
latest=auto
=======
>>>>>>> 3f6461b (Revert "integrate")
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -272,19 +284,15 @@ runs:
${{ steps.meta-base.outputs.bake-file }}
${{ steps.meta-core-devel.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception-devel.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception-devel-cuda.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception-cuda.outputs.bake-file }}
${{ steps.meta-universe-localization-mapping-devel.outputs.bake-file }}
${{ steps.meta-universe-localization-mapping.outputs.bake-file }}
${{ steps.meta-universe-planning-control-devel.outputs.bake-file }}
${{ steps.meta-universe-planning-control.outputs.bake-file }}
${{ steps.meta-universe-vehicle-system-devel.outputs.bake-file }}
${{ steps.meta-universe-vehicle-system.outputs.bake-file }}
${{ steps.meta-universe-devel.outputs.bake-file }}
${{ steps.meta-universe-devel-cuda.outputs.bake-file }}
${{ steps.meta-universe.outputs.bake-file }}
${{ steps.meta-universe-cuda.outputs.bake-file }}
provenance: false
set: |
${{ inputs.build-args }}
19 changes: 18 additions & 1 deletion .github/workflows/docker-build-and-push-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
ansible/**
docker/**
- name: Build 'Autoware'
- name: Build 'Autoware' without CUDA
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
Expand All @@ -61,6 +61,23 @@ jobs:
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max
- name: Build 'Autoware' with CUDA
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
uses: ./.github/actions/docker-build-and-push-cuda
with:
platform: arm64
bake-target: autoware
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=aarch64
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-cuda-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-cuda-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-cuda-${{ github.ref_name }},mode=max
- name: Show disk space
if: always()
run: |
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
ansible/**
docker/**
- name: Build 'Autoware'
- name: Build 'Autoware' without CUDA
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
Expand All @@ -56,6 +56,23 @@ jobs:
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max
- name: Build 'Autoware' with CUDA
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
uses: ./.github/actions/docker-build-and-push-cuda
with:
platform: amd64
bake-target: autoware
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=x86_64
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-cuda-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-cuda-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-cuda-${{ github.ref_name }},mode=max
- name: Show disk space
run: |
df -h
38 changes: 38 additions & 0 deletions docker/docker-bake-cuda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
group "default" {
targets = [
"universe-sensing-perception-devel-cuda",
"universe-sensing-perception-cuda",
"universe-devel-cuda",
"universe-cuda"
]
}

// For docker/metadata-action
target "docker-metadata-action-universe-sensing-perception-devel-cuda" {}
target "docker-metadata-action-universe-sensing-perception-cuda" {}
target "docker-metadata-action-universe-devel-cuda" {}
target "docker-metadata-action-universe-cuda" {}

target "universe-sensing-perception-devel-cuda" {
inherits = ["docker-metadata-action-universe-sensing-perception-devel-cuda"]
dockerfile = "docker/Dockerfile"
target = "universe-sensing-perception-devel-cuda"
}

target "universe-sensing-perception-cuda" {
inherits = ["docker-metadata-action-universe-sensing-perception-cuda"]
dockerfile = "docker/Dockerfile"
target = "universe-sensing-perception-cuda"
}

target "universe-devel-cuda" {
inherits = ["docker-metadata-action-universe-devel-cuda"]
dockerfile = "docker/Dockerfile"
target = "universe-devel-cuda"
}

target "universe-cuda" {
inherits = ["docker-metadata-action-universe-cuda"]
dockerfile = "docker/Dockerfile"
target = "universe-cuda"
}
Loading

0 comments on commit b22a9c7

Please sign in to comment.