-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-genecluster-superpowers.yml
More file actions
135 lines (124 loc) · 4.96 KB
/
Copy pathbuild-genecluster-superpowers.yml
File metadata and controls
135 lines (124 loc) · 4.96 KB
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
name: Build GeneCluster Superpowers image
on:
push:
branches: [main]
paths:
- 'images/genecluster-superpowers/**'
- '.github/workflows/build-genecluster-superpowers.yml'
workflow_dispatch:
inputs:
tag:
description: 'Image tag (e.g. v0.1)'
required: false
default: 'v0.1'
runpod_tag:
description: 'RunPod-compatible amd64 tag without BuildKit attestations'
required: false
default: 'runpod-amd64-noattest'
clean_repo_ref:
description: 'CLEAN repo ref (override Dockerfile default v1.0.1)'
required: false
default: ''
plantismash_repo_ref:
description: 'plantiSMASH repo ref (override Dockerfile default plantismash-2.0.4)'
required: false
default: ''
hit_ec_repo_ref:
description: 'HIT-EC repo ref (override Dockerfile default v2.0.0)'
required: false
default: ''
base_runner_image:
description: 'Base runner image (defaults to ghcr.io/<owner>/genecluster-runner:v0.1)'
required: false
default: ''
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/genecluster-superpowers
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 120
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Free disk space
# Image is ~5-7 GB; need extra room on the GHA runner.
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL || true
sudo docker image prune --all --force || true
df -h
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compose build args
id: args
env:
CLEAN_REF: ${{ inputs.clean_repo_ref }}
PLANT_REF: ${{ inputs.plantismash_repo_ref }}
HIT_EC_REF: ${{ inputs.hit_ec_repo_ref }}
BASE_IMAGE_INPUT: ${{ inputs.base_runner_image }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
run: |
DEFAULT_BASE_IMAGE="${REGISTRY}/${GITHUB_REPOSITORY_OWNER}/genecluster-runner:v0.1"
{
echo "args<<EOF"
echo "BASE_IMAGE=${BASE_IMAGE_INPUT:-$DEFAULT_BASE_IMAGE}"
[ -n "$CLEAN_REF" ] && echo "CLEAN_REPO_REF=$CLEAN_REF"
[ -n "$PLANT_REF" ] && echo "PLANTISMASH_REPO_REF=$PLANT_REF"
[ -n "$HIT_EC_REF" ] && echo "HIT_EC_REPO_REF=$HIT_EC_REF"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and push
id: build
uses: docker/build-push-action@v7
with:
context: ./images/genecluster-superpowers
file: ./images/genecluster-superpowers/Dockerfile
platforms: linux/amd64
push: true
# RunPod has shown stalls before container telemetry appears. Keep a
# plain amd64 image index without BuildKit attestation descriptors so
# provider-side platform resolution has only the runnable manifest.
provenance: false
sbom: false
build-args: ${{ steps.args.outputs.args }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag || 'v0.1' }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.runpod_tag || 'runpod-amd64-noattest' }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:runpod-${{ github.sha }}
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.description=BioSymphony GeneCluster Superpowers (extends genecluster-runner with cblaster, clinker, JCVI MCScan, foldseek, ProstT5, HIT-EC, CLEAN, plantiSMASH 2.0, P450Rdb)
org.opencontainers.image.licenses=MIT
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Summary
env:
TAG: ${{ inputs.tag || 'v0.1' }}
RUNPOD_TAG: ${{ inputs.runpod_tag || 'runpod-amd64-noattest' }}
DIGEST: ${{ steps.build.outputs.digest }}
SHA: ${{ github.sha }}
run: |
{
echo "## GeneCluster Superpowers image"
echo
echo "- Digest: \`${DIGEST}\`"
echo "- Pin: \`${REGISTRY}/${IMAGE_NAME}@${DIGEST}\`"
echo "- Tags pushed:"
echo " - \`${REGISTRY}/${IMAGE_NAME}:${TAG}\`"
echo " - \`${REGISTRY}/${IMAGE_NAME}:${RUNPOD_TAG}\`"
echo " - \`${REGISTRY}/${IMAGE_NAME}:sha-${SHA}\`"
echo " - \`${REGISTRY}/${IMAGE_NAME}:runpod-${SHA}\`"
} >> "$GITHUB_STEP_SUMMARY"