Skip to content

Commit ae12c7d

Browse files
committed
Backported CI fixes
1 parent 6c411aa commit ae12c7d

File tree

1 file changed

+61
-46
lines changed

1 file changed

+61
-46
lines changed

.github/workflows/test_and_deploy.yml

+61-46
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Building Image, Running Benchmarks and Deploying to Dockerhub
22
on:
3+
# Launch on manual trigger
4+
workflow_dispatch:
35
# Launch on any push
46
push:
57
pull_request:
@@ -11,21 +13,28 @@ on:
1113
types: [opened, synchronize, reopened]
1214

1315
env:
16+
BASE_DEPLOY_URL: https://repo.hops.works/master
17+
ARM_IMAGE_NAME: rondb-standalone-arm64
18+
X86_IMAGE_NAME: rondb-standalone-amd64
19+
1420
RONDB_VERSION_LTS: 21.04.16
21+
LTS_X86_TARBALL_NAME: rondb-21.04.16-linux-glibc2.17-x86_64.tar.gz
22+
LTS_ARM_TARBALL_NAME: rondb-21.04.16-linux-glibc2.35-arm64_v8.tar.gz
23+
1524
RONDB_VERSION_STABLE: 22.10.1
16-
ARM_IMAGE_NAME: rondb-standalone-arm64
17-
AMD_IMAGE_NAME: rondb-standalone-amd64
25+
STABLE_X86_TARBALL_NAME: rondb-22.10.1-linux-glibc2.28-x86_64.tar.gz
26+
STABLE_ARM_TARBALL_NAME: rondb-22.10.1-linux-glibc2.35-arm64_v8.tar.gz
1827

1928
jobs:
2029
integration-test-and-package:
2130
runs-on: ubuntu-latest
2231
steps:
23-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
2433

2534
- name: Build and run Docker Compose cluster with benchmarking for RONDB_VERSION_LTS
2635
run: |
2736
./run.sh -lv \
28-
--rondb-tarball-url https://repo.hops.works/master/rondb-$RONDB_VERSION_LTS-linux-glibc2.28-x86_64.tar.gz \
37+
--rondb-tarball-url $BASE_DEPLOY_URL/$LTS_X86_TARBALL_NAME \
2938
--rondb-version $RONDB_VERSION_LTS \
3039
--size mini \
3140
--run-benchmark sysbench_single \
@@ -84,42 +93,46 @@ jobs:
8493
username: hopsworks
8594
password: ${{ secrets.DOCKERHUB_TOKEN }}
8695

87-
- name: Build AMD64 image for RONDB_VERSION_STABLE
96+
- name: Build X86 image for RONDB_VERSION_STABLE
8897
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
8998
run: |
9099
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
91100
docker buildx build . \
92101
--tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION \
93102
--build-arg RONDB_VERSION=$RONDB_VERSION_STABLE \
94103
--build-arg RONDB_TARBALL_LOCAL_REMOTE=remote \
95-
--build-arg RONDB_TARBALL_URI=https://repo.hops.works/master/rondb-$RONDB_VERSION_STABLE-linux-glibc2.28-x86_64.tar.gz
104+
--build-arg RONDB_TARBALL_URI=$BASE_DEPLOY_URL/$STABLE_X86_TARBALL_NAME
96105
97106
# In the main branch, we work with "<version>-SNAPSHOT", which might as well be called "latest"
98-
- name: Push AMD64 *latest* images to Dockerhub
107+
- name: Push X86 *latest* images to Dockerhub
99108
if: github.repository == 'logicalclocks/rondb-docker' && github.ref_name == 'main'
100109
run: |
101110
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
102-
docker tag rondb-standalone:$RONDB_VERSION_LTS-$VERSION hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_LTS-latest
103-
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_STABLE-latest
104-
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$AMD_IMAGE_NAME:latest
105-
docker push hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_LTS-latest
106-
docker push hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_STABLE-latest
107-
docker push hopsworks/$AMD_IMAGE_NAME:latest
108-
109-
- name: Push AMD64 *release* images to Dockerhub
111+
docker tag rondb-standalone:$RONDB_VERSION_LTS-$VERSION hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
112+
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
113+
docker tag rondb-standalone:$RONDB_VERSION_LTS-$VERSION hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-latest
114+
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-latest
115+
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$X86_IMAGE_NAME:latest
116+
docker push hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
117+
docker push hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
118+
docker push hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-latest
119+
docker push hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-latest
120+
docker push hopsworks/$X86_IMAGE_NAME:latest
121+
122+
- name: Push X86 *release* images to Dockerhub
110123
if: github.repository == 'logicalclocks/rondb-docker' && startsWith(github.ref_name, 'release-')
111124
run: |
112125
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
113-
docker tag rondb-standalone:$RONDB_VERSION_LTS-$VERSION hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
114-
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
115-
docker push hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
116-
docker push hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
126+
docker tag rondb-standalone:$RONDB_VERSION_LTS-$VERSION hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
127+
docker tag rondb-standalone:$RONDB_VERSION_STABLE-$VERSION hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
128+
docker push hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
129+
docker push hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
117130
118131
build-and-push-ARM64:
119132
runs-on: ubuntu-latest
120133
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
121134
steps:
122-
- uses: actions/checkout@v3
135+
- uses: actions/checkout@v4
123136

124137
- name: Set up QEMU
125138
uses: docker/setup-qemu-action@v2
@@ -138,29 +151,27 @@ jobs:
138151
# all types of benchmarking to the tests.
139152
- name: Build and push ARM64 image for RONDB_VERSION_LTS
140153
run: |
141-
if [[ "${{ startsWith(github.ref_name, 'release-') }}" == "true" ]]; then
142-
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
143-
TAG="hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION"
144-
else
145-
TAG="hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-latest"
154+
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
155+
TAGS="hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION"
156+
if [[ "${{ github.ref_name == 'main' }}" == "true" ]]; then
157+
TAGS+=" --tag hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-latest"
146158
fi
147159
docker buildx build . \
148-
--tag $TAG \
160+
--tag $TAGS \
149161
--platform=linux/arm64 \
150162
--output type=registry \
151163
--build-arg RONDB_VERSION=$RONDB_VERSION_LTS \
152164
--build-arg RONDB_TARBALL_LOCAL_REMOTE=remote \
153-
--build-arg RONDB_TARBALL_URI=https://repo.hops.works/master/rondb-$RONDB_VERSION_LTS-linux-glibc2.35-arm64_v8.tar.gz \
165+
--build-arg RONDB_TARBALL_URI=$BASE_DEPLOY_URL/$LTS_ARM_TARBALL_NAME \
154166
--cache-to type=registry,ref=hopsworks/rondb-standalone-cache,mode=max \
155167
--cache-from type=registry,ref=hopsworks/rondb-standalone-cache,mode=max
156168
157169
- name: Build and push ARM64 image for RONDB_VERSION_STABLE
158170
run: |
159-
if [[ "${{ startsWith(github.ref_name, 'release-') }}" == "true" ]]; then
160-
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
161-
TAGS="--tag hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION"
162-
else
163-
TAGS="--tag hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-latest"
171+
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
172+
TAGS="--tag hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION"
173+
if [[ "${{ github.ref_name == 'main' }}" == "true" ]]; then
174+
TAGS+=" --tag hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-latest"
164175
TAGS+=" --tag hopsworks/$ARM_IMAGE_NAME:latest"
165176
fi
166177
docker buildx build . \
@@ -169,7 +180,7 @@ jobs:
169180
--output type=registry \
170181
--build-arg RONDB_VERSION=$RONDB_VERSION_STABLE \
171182
--build-arg RONDB_TARBALL_LOCAL_REMOTE=remote \
172-
--build-arg RONDB_TARBALL_URI=https://repo.hops.works/master/rondb-$RONDB_VERSION_STABLE-linux-glibc2.35-arm64_v8.tar.gz \
183+
--build-arg RONDB_TARBALL_URI=$BASE_DEPLOY_URL/$STABLE_ARM_TARBALL_NAME \
173184
--cache-to type=registry,ref=hopsworks/rondb-standalone-cache,mode=max \
174185
--cache-from type=registry,ref=hopsworks/rondb-standalone-cache,mode=max
175186
@@ -178,7 +189,7 @@ jobs:
178189
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
179190
needs: [integration-test-and-package, build-and-push-ARM64]
180191
steps:
181-
- uses: actions/checkout@v3
192+
- uses: actions/checkout@v4
182193

183194
- name: Set up Docker Buildx
184195
uses: docker/setup-buildx-action@v2
@@ -191,22 +202,26 @@ jobs:
191202

192203
- name: Create and push multi-platform image
193204
run: |
194-
if [[ "${{ startsWith(github.ref_name, 'release-') }}" == "true" ]]; then
195-
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
196-
docker buildx imagetools create -t hopsworks/rondb-standalone:$RONDB_VERSION_LTS-$VERSION \
197-
hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION \
198-
hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
199-
docker buildx imagetools create -t hopsworks/rondb-standalone:$RONDB_VERSION_STABLE-$VERSION \
200-
hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION \
201-
hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
202-
else
205+
VERSION="$(< "./VERSION" sed -e 's/^[[:space:]]*//')"
206+
207+
# Using $VERSION will create weird `-SNAPSHOT` tags, when in main, but we need
208+
# those Dockerhub images in order to run the main branch.
209+
210+
docker buildx imagetools create -t hopsworks/rondb-standalone:$RONDB_VERSION_LTS-$VERSION \
211+
hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION \
212+
hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-$VERSION
213+
docker buildx imagetools create -t hopsworks/rondb-standalone:$RONDB_VERSION_STABLE-$VERSION \
214+
hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION \
215+
hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-$VERSION
216+
217+
if [[ "${{ github.ref_name == 'main' }}" == "true" ]]; then
203218
docker buildx imagetools create -t hopsworks/rondb-standalone:$RONDB_VERSION_LTS-latest \
204-
hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_LTS-latest \
219+
hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_LTS-latest \
205220
hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_LTS-latest
206221
docker buildx imagetools create -t hopsworks/rondb-standalone:$RONDB_VERSION_STABLE-latest \
207-
hopsworks/$AMD_IMAGE_NAME:$RONDB_VERSION_STABLE-latest \
222+
hopsworks/$X86_IMAGE_NAME:$RONDB_VERSION_STABLE-latest \
208223
hopsworks/$ARM_IMAGE_NAME:$RONDB_VERSION_STABLE-latest
209224
docker buildx imagetools create -t hopsworks/rondb-standalone:latest \
210-
hopsworks/$AMD_IMAGE_NAME:latest \
225+
hopsworks/$X86_IMAGE_NAME:latest \
211226
hopsworks/$ARM_IMAGE_NAME:latest
212227
fi

0 commit comments

Comments
 (0)