Skip to content

Commit 941c609

Browse files
automatic docker build for codabench evaluation environment
1 parent 76ca43d commit 941c609

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/eval-docker.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build & Push Eval Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
paths:
8+
- "src/evaluation/**"
9+
- "pyproject.toml"
10+
- ".github/workflows/eval-docker.yml"
11+
12+
jobs:
13+
build-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Log in to GHCR
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ghcr.io/bic-mac-challenge/eval
35+
tags: |
36+
type=semver,pattern={{version}}
37+
type=semver,pattern={{major}}.{{minor}}
38+
type=sha,prefix=sha-,format=short
39+
type=raw,value=latest,enable={{is_default_branch}}
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Build and push
45+
uses: docker/build-push-action@v6
46+
with:
47+
context: .
48+
file: src/evaluation/Dockerfile
49+
push: true
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}
52+
cache-from: type=registry,ref=ghcr.io/bic-mac-challenge/eval:cache
53+
cache-to: type=registry,ref=ghcr.io/bic-mac-challenge/eval:cache,mode=max

src/evaluation/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.12-slim
2+
3+
RUN pip install --no-cache-dir nibabel numpy scipy
4+
5+
COPY pyproject.toml .
6+
COPY src/ src/
7+
RUN pip install --no-cache-dir --no-deps .
8+
9+
WORKDIR /app

0 commit comments

Comments
 (0)