-
Notifications
You must be signed in to change notification settings - Fork 13
192 lines (184 loc) · 5.89 KB
/
retile.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Retile demo site
on:
workflow_dispatch: {}
permissions:
contents: read
env:
LD_LIBRARY_PATH: "${{ github.workspace }}/install/lib64"
PYTHONPATH: "${{ github.workspace }}/install/python"
PYTHONUNBUFFERED: 1
RUNTIME_DEPS: "python3 python3-boto3 python3-pillow python3-requests \
zlib libpng libjpeg-turbo libtiff openjpeg2 gdk-pixbuf2 \
gdk-pixbuf2-modules libxml2 sqlite cairo glib2"
jobs:
build:
name: Build releases
runs-on: ubuntu-latest
container: registry.fedoraproject.org/fedora:latest
steps:
- name: Install dependencies
run: |
dnf install -y \
jq xz \
python3 python3-devel python3-pip python3-pillow python3-wheel \
gcc meson pkg-config \
zlib-devel \
libpng-devel \
libjpeg-turbo-devel \
libtiff-devel \
openjpeg2-devel \
gdk-pixbuf2-devel \
gdk-pixbuf2-modules \
libxml2-devel \
sqlite-devel \
cairo-devel \
glib2-devel
- name: Download releases
run: |
set -euxo pipefail
get_release() {
# Query GitHub for latest release
curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/openslide/$1/releases/latest" \
> "$1-release.json"
local env_var=$(echo "$1" | tr a-z- A-Z_)_VERSION
local version=$(jq -r .tag_name < "$1-release.json" | sed s/^v//)
echo "${env_var}=${version}" >> ${GITHUB_ENV}
# Download release
local url=$(jq -r '.assets | map(select(.content_type == "application/x-xz")) | .[0].browser_download_url' < "$1-release.json")
curl -LO "${url}"
# Unpack
tar xf "$1-${version}.tar.xz"
}
get_release openslide
get_release openslide-python
- name: Build OpenSlide
working-directory: openslide-${{ env.OPENSLIDE_VERSION }}
run: |
meson setup builddir --prefix=${GITHUB_WORKSPACE}/install
meson compile -C builddir
trap "cat builddir/meson-logs/testlog.txt" ERR
meson test -C builddir
trap - ERR
meson install -C builddir
- name: Build OpenSlide Python
working-directory: openslide-python-${{ env.OPENSLIDE_PYTHON_VERSION }}
run: |
pip install -t ${GITHUB_WORKSPACE}/install/python .
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: build
path: install
setup:
name: Set up tiling
environment: demo-site
needs: build
runs-on: ubuntu-latest
container: registry.fedoraproject.org/fedora:latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
path: website
- name: Install dependencies
run: dnf install -y ${RUNTIME_DEPS}
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
path: install
- name: Set up tiling
id: start-tiling
working-directory: website/demo
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEMO_TILER_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEMO_TILER_AWS_SECRET_KEY }}
run: |
./_synctiles.py start \
${GITHUB_WORKSPACE}/context \
matrix
echo "slide-matrix=$(cat matrix)" >> $GITHUB_OUTPUT
- name: Upload context
uses: actions/upload-artifact@v3
with:
name: context
path: context
outputs:
slide-matrix: ${{ steps.start-tiling.outputs.slide-matrix }}
tile:
name: Tile
environment: demo-site
needs: setup
runs-on: ubuntu-latest
container: registry.fedoraproject.org/fedora:latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.slide-matrix) }}
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
path: website
- name: Install dependencies
run: dnf install -y ${RUNTIME_DEPS}
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
path: install
- name: Download context
uses: actions/download-artifact@v3
with:
name: context
- name: Tile slide
working-directory: website/demo
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEMO_TILER_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEMO_TILER_AWS_SECRET_KEY }}
run: |
./_synctiles.py tile \
${GITHUB_WORKSPACE}/context \
"${{ matrix.slide }}" \
${GITHUB_WORKSPACE}/summary
- name: Upload summary
uses: actions/upload-artifact@v3
with:
name: summary
path: summary
finish:
name: Finish tiling
environment: demo-site
needs: tile
runs-on: ubuntu-latest
container: registry.fedoraproject.org/fedora:latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
path: website
- name: Install dependencies
run: dnf install -y ${RUNTIME_DEPS}
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
path: install
- name: Download context
uses: actions/download-artifact@v3
with:
name: context
- name: Download summaries
uses: actions/download-artifact@v3
with:
name: summary
path: summary
- name: Finish tiling
working-directory: website/demo
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEMO_TILER_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEMO_TILER_AWS_SECRET_KEY }}
run: |
./_synctiles.py finish \
${GITHUB_WORKSPACE}/context \
${GITHUB_WORKSPACE}/summary