-
-
Notifications
You must be signed in to change notification settings - Fork 149
132 lines (114 loc) · 4.25 KB
/
build.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Docker build
on:
push:
branches:
- main
tags:
- "*"
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
env:
release: "2024.7.1"
defaultpython: "3.10"
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
image:
- tag: "daskdev/dask"
context: "./base"
- tag: "ghcr.io/dask/dask"
context: "./base"
- tag: "daskdev/dask-notebook"
context: "./notebook"
- tag: "ghcr.io/dask/dask-notebook"
context: "./notebook"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver: docker
- name: Install Container Canary
run: |
LATEST_RELEASE=$(curl --retry 6 --retry-delay 10 -s https://api.github.com/repos/NVIDIA/container-canary/releases/latest | jq -r ".assets[] | select(.name | test(\"canary_linux_amd64$\")) | .browser_download_url")
curl --retry 6 --retry-delay 10 -sSL $LATEST_RELEASE > /usr/local/bin/canary
chmod +x /usr/local/bin/canary
canary version
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.repository == 'dask/dask-docker' && github.event_name == 'push'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: github.repository == 'dask/dask-docker' && github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate tags
id: tags
env:
image: ${{ matrix.image.tag }}
python: ${{ matrix.python }}
stable: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
if [ "$stable" == "true" ]; then
tag="${image}:${release}-py${python}"
tags=${image}:latest-py${python},$tag
if [ "$python" == "$defaultpython" ]; then
tags=${image}:latest,${image}:${release},$tags
fi
else
tag="${image}:dev-py${python}"
tags=$tag
if [ "$python" == "$defaultpython" ]; then
tags=${image}:dev,$tags
fi
fi
echo "::set-output name=tags::${tags}"
echo "::set-output name=tag::${tag}"
- name: Checkout upstream Jupyter Lab image repo
uses: actions/checkout@v2
if: contains(matrix.image.tag, 'dask-notebook')
with:
repository: jupyter/docker-stacks
ref: main
path: docker-stacks
- name: Build upstream Jupyter Lab image
uses: docker/build-push-action@v2
if: contains(matrix.image.tag, 'dask-notebook')
with:
context: ./docker-stacks/images/docker-stacks-foundation
push: false
load: true
platforms: linux/amd64
tags: daskdev/docker-stacks-foundation:lab
build-args: |
PYTHON_VERSION=${{ matrix.python }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ${{ matrix.image.context }}
push: ${{ github.repository == 'dask/dask-docker' && github.event_name == 'push' }}
platforms: linux/amd64
tags: ${{ steps.tags.outputs.tags }}
build-args: |
python=${{ matrix.python }}
release=${{ env.release }}
base=daskdev
- name: Validate Jupyter Lab image for Binder
if: contains(matrix.image.tag, 'dask-notebook')
run: canary validate --file https://github.com/NVIDIA/container-canary/raw/main/examples/binder.yaml ${{ steps.tags.outputs.tag }}
- name: Validate Jupyter Lab image for Kubeflow
if: contains(matrix.image.tag, 'dask-notebook')
run: canary validate --file https://github.com/NVIDIA/container-canary/raw/main/examples/kubeflow.yaml ${{ steps.tags.outputs.tag }}
- name: Report
run: echo Built ${{ steps.tags.outputs.tags }}