-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 1.79 KB
/
Copy pathdocker.yaml
File metadata and controls
64 lines (57 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build and Push Docker Image
on:
push:
branches: [main, feat/build_system]
paths:
- Dockerfile
- optimization_core/**
- scripts/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- cuda_image: nvidia/cuda:13.1.1-devel-ubuntu24.04
torch_cuda: cu126
tag: cuda13.1.1
latest: true
- cuda_image: nvidia/cuda:12.2.2-devel-ubuntu22.04
torch_cuda: cu121
tag: cuda12.2.2
latest: false
steps:
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghcrunner
sudo rm -rf /opt/hostedtoolcache
docker system prune -af
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Compute image tags
id: tags
run: |
SHORT_SHA="${GITHUB_SHA::7}"
TAGS="kumarrobotics/lamp:${{ matrix.tag }}"
TAGS="$TAGS,kumarrobotics/lamp:${{ matrix.tag }}-$SHORT_SHA"
if [ "${{ matrix.latest }}" = "true" ]; then
TAGS="$TAGS,kumarrobotics/lamp:latest"
fi
echo "tags=$TAGS" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v6
with:
context: .
push: true
build-args: |
CUDA_IMAGE=${{ matrix.cuda_image }}
TORCH_CUDA=${{ matrix.torch_cuda }}
tags: ${{ steps.tags.outputs.tags }}
cache-from: type=gha,scope=${{ matrix.tag }}
cache-to: type=gha,mode=max,scope=${{ matrix.tag }}