This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (73 loc) · 2.43 KB
/
linux_cuda.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: linux (cuda)
on:
workflow_call:
inputs:
python:
description: "Python version"
required: true
type: string
cuda:
description: "CUDA version"
required: true
type: string
version:
description: "latest/stable/semver/branch"
required: true
type: string
dependencies:
description: "optional dependencies"
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -e {0} # -e to fail on error
steps:
- 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: Set build inputs
id: build
run: |
INPUT_VERSION=${{ inputs.version }}
VERSION=${INPUT_VERSION:-"latest"}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
VERSIONTAG=${VERSION}
if [[ $VERSIONTAG == "cuda" ]]; then
VERSIONTAG=""
else
VERSIONTAG="-${VERSIONTAG}"
fi
echo "versiontag=${VERSIONTAG}" >> $GITHUB_OUTPUT
RELEASE_BRANCH_REGEX="([0-9]+\.){2}(x)"
if [[ $VERSION == "latest" ]]; then
TARGET="latest"
elif [[ $VERSION == "stable" ]]; then
TARGET="stable"
elif [[ $VERSION =~ $RELEASE_BRANCH_REGEX ]]; then
TARGET="branch"
elif [[ $VERSION == "cuda" ]]; then
TARGET="base"
else
TARGET="semver"
fi
echo "target=${TARGET}" >> $GITHUB_OUTPUT
INPUT_DEPENDENCIES=${{ inputs.dependencies }}
DEPENDENCIES=${INPUT_DEPENDENCIES:-"runtime"}
echo "dependencies=${DEPENDENCIES}" >> $GITHUB_OUTPUT
- uses: docker/build-push-action@v5
with:
context: ./docker/cuda${{ inputs.cuda }}
push: true
target: ${{ steps.build.outputs.target }}
tags: scverse/scvi-tools:py${{ inputs.python }}-cu${{ inputs.cuda }}-${{ steps.build.outputs.dependencies }}${{ steps.build.outputs.versiontag }}
build-args: |
PYTHON_VERSION=${{ inputs.python }}
CUDA_VERSION=${{ inputs.cuda }}
SCVI_TOOLS_VERSION=${{ steps.build.outputs.version }}
DEPENDENCIES=${{ inputs.dependencies }}