Skip to content

Commit 1f6a556

Browse files
committed
Build and push the worker image from CI
Merging a job-executor bump now builds the image and pushes it; the tag already encodes the executor version (1.3-je1.4.1), so no separate release is needed to get a distinct tag. Renovate watches three pins: the executor version in worker-image/Makefile, and the engine and worker image defaults in the integration compose file. The two image pins use the docker datasource, so a compose bump cannot be proposed before the image it names actually exists in the registry. HF_JOB_EXECUTOR_VERSION becomes ?= so the version can be overridden from the environment for a one-off build. Drop --no-cache: the executor version is passed as a build argument, which already invalidates the layer, so it only forced `make push` to rebuild what `make image` had just built.
1 parent 032b058 commit 1f6a556

3 files changed

Lines changed: 111 additions & 2 deletions

File tree

.github/workflows/worker-image.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Builds the 1000genome worker image, and publishes it when the change lands on
2+
# main. The image tag encodes the job-executor version (1.3-je1.4.1), so merging
3+
# a Renovate bump of worker-image/Makefile is what produces a new tag.
4+
5+
name: worker-image
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
paths:
11+
- 'worker-image/**'
12+
- 'worker-base-image/**'
13+
- '.github/workflows/worker-image.yml'
14+
pull_request:
15+
branches: [ main ]
16+
paths:
17+
- 'worker-image/**'
18+
- 'worker-base-image/**'
19+
- '.github/workflows/worker-image.yml'
20+
workflow_dispatch:
21+
inputs:
22+
push:
23+
description: 'Push the built image to Docker Hub'
24+
type: boolean
25+
default: false
26+
27+
jobs:
28+
worker-image:
29+
runs-on: ubuntu-22.04
30+
env:
31+
# Publish on a main-branch push, or when a manual run asks for it.
32+
DO_PUSH: ${{ github.event_name == 'push' || inputs.push }}
33+
# A missing secret would otherwise fail the login step on forks.
34+
HAVE_DOCKERHUB: ${{ secrets.DOCKERHUB_USERNAME != '' }}
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
# Log in before building: pulling the base image counts against the
39+
# anonymous Docker Hub rate limit, which shared runners routinely exhaust.
40+
- name: Login to Docker Hub
41+
if: env.HAVE_DOCKERHUB == 'true'
42+
uses: docker/login-action@v3
43+
with:
44+
username: ${{ secrets.DOCKERHUB_USERNAME }}
45+
password: ${{ secrets.DOCKERHUB_TOKEN }}
46+
47+
- name: Build worker image
48+
run: make -C worker-image image
49+
50+
- name: Show built tags
51+
run: docker images 'hyperflowwms/1000genome-worker'
52+
53+
- name: Push
54+
if: env.DO_PUSH == 'true' && env.HAVE_DOCKERHUB == 'true'
55+
run: make -C worker-image push

renovate.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
":dependencyDashboard",
6+
":semanticCommitsDisabled"
7+
],
8+
"enabledManagers": [
9+
"custom.regex"
10+
],
11+
"labels": [
12+
"dependencies",
13+
"release-chain"
14+
],
15+
"customManagers": [
16+
{
17+
"customType": "regex",
18+
"description": "job-executor version pinned in the worker Makefile",
19+
"fileMatch": [
20+
"worker-image/Makefile"
21+
],
22+
"matchStrings": [
23+
"HF_JOB_EXECUTOR_VERSION\\s*\\??=\\s*['\"]?(?<currentValue>\\d+\\.\\d+\\.\\d+)['\"]?"
24+
],
25+
"depNameTemplate": "@hyperflow/job-executor",
26+
"datasourceTemplate": "npm"
27+
},
28+
{
29+
"customType": "regex",
30+
"description": "engine image default used by the integration test",
31+
"fileMatch": [
32+
"tests/integration/docker-compose.yml"
33+
],
34+
"matchStrings": [
35+
"HF_ENGINE_IMAGE:-(?<depName>hyperflowwms/hyperflow):(?<currentValue>v\\d+\\.\\d+\\.\\d+)"
36+
],
37+
"datasourceTemplate": "docker",
38+
"versioningTemplate": "regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$"
39+
},
40+
{
41+
"customType": "regex",
42+
"description": "worker image default used by the integration test; the docker datasource means this cannot be bumped before the image exists",
43+
"fileMatch": [
44+
"tests/integration/docker-compose.yml"
45+
],
46+
"matchStrings": [
47+
"HF_VAR_WORKER_CONTAINER:-(?<depName>hyperflowwms/1000genome-worker):(?<currentValue>\\d+\\.\\d+-je\\d+\\.\\d+\\.\\d+)"
48+
],
49+
"datasourceTemplate": "docker",
50+
"versioningTemplate": "regex:^(?<compatibility>\\d+\\.\\d+)-je(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$"
51+
}
52+
]
53+
}

worker-image/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
REPO_NAME = 1000genome-worker
22
PREFIX = hyperflowwms
33
VERSION = 1.3
4-
HF_JOB_EXECUTOR_VERSION = 1.4.1
4+
# ?= so CI and Renovate can override the version from the environment
5+
HF_JOB_EXECUTOR_VERSION ?= 1.4.1
56
TAG = $(VERSION)-je$(HF_JOB_EXECUTOR_VERSION)
67

78
# Local job-executor checkout used by the 'image-dev' target
@@ -11,7 +12,7 @@ DEV_TAG = $(PREFIX)/$(REPO_NAME):dev
1112
all: push
1213

1314
image:
14-
docker build --no-cache --build-arg hf_job_executor_version=$(HF_JOB_EXECUTOR_VERSION) -t $(PREFIX)/$(REPO_NAME):$(TAG) .
15+
docker build --build-arg hf_job_executor_version=$(HF_JOB_EXECUTOR_VERSION) -t $(PREFIX)/$(REPO_NAME):$(TAG) .
1516
docker tag $(PREFIX)/$(REPO_NAME):$(TAG) $(PREFIX)/$(REPO_NAME):$(VERSION)-latest
1617

1718
# Dev image: installs the job executor from a local checkout (npm pack)

0 commit comments

Comments
 (0)