Skip to content

Commit 20bd3ac

Browse files
authored
ci: split out docker ci to be manually run (#7740)
Just moving / spliting out github actions
1 parent 9171a7a commit 20bd3ac

File tree

2 files changed

+157
-127
lines changed

2 files changed

+157
-127
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: Publish Docker images
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
marimo_version:
7+
description: 'marimo version to publish'
8+
required: true
9+
type: string
10+
workflow_dispatch:
11+
inputs:
12+
marimo_version:
13+
description: 'marimo version to publish'
14+
required: true
15+
type: string
16+
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
env:
22+
REGISTRY: ghcr.io
23+
IMAGE_NAME: marimo-team/marimo
24+
25+
jobs:
26+
publish_docker:
27+
name: 🐋 Publish Docker images
28+
runs-on: ubuntu-latest
29+
# Don't error while this is in BETA
30+
continue-on-error: true
31+
32+
steps:
33+
- name: ⬇️ Checkout repo
34+
uses: actions/checkout@v4
35+
36+
- name: ⏳ Wait for PyPI package availability
37+
run: |
38+
VERSION="${{ inputs.marimo_version }}"
39+
echo "Waiting for marimo version $VERSION to be available on PyPI..."
40+
41+
MAX_ATTEMPTS=30
42+
ATTEMPT=0
43+
SLEEP_TIME=10
44+
45+
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
46+
ATTEMPT=$((ATTEMPT + 1))
47+
echo "Attempt $ATTEMPT/$MAX_ATTEMPTS: Checking PyPI for version $VERSION..."
48+
49+
# Check if the version exists on PyPI
50+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/marimo/$VERSION/json")
51+
52+
if [ "$HTTP_CODE" = "200" ]; then
53+
echo "✅ Version $VERSION is available on PyPI!"
54+
exit 0
55+
else
56+
echo "Version $VERSION not yet available (HTTP $HTTP_CODE). Waiting ${SLEEP_TIME}s..."
57+
sleep $SLEEP_TIME
58+
fi
59+
done
60+
61+
echo "❌ Timed out waiting for version $VERSION on PyPI after $((MAX_ATTEMPTS * SLEEP_TIME)) seconds"
62+
exit 1
63+
64+
- name: 🐋 Log in to the Container registry
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ${{ env.REGISTRY }}
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: 🐋 Extract metadata (tags, labels) for Docker
72+
id: meta
73+
uses: docker/metadata-action@v5
74+
with:
75+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
76+
77+
- name: 🐋 Set up Docker Buildx
78+
uses: docker/setup-buildx-action@v3
79+
80+
- name: 🧪 Build docker image for testing
81+
uses: docker/build-push-action@v6
82+
with:
83+
context: .
84+
file: ./docker/Dockerfile
85+
# Don't push test image
86+
push: false
87+
load: true
88+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
89+
target: slim
90+
build-args: |
91+
marimo_version=${{ inputs.marimo_version }}
92+
labels: ${{ steps.meta.outputs.labels }}
93+
cache-from: type=gha
94+
cache-to: type=gha,mode=max
95+
96+
- name: 🧪 Test docker build
97+
run: |
98+
docker run -d -e PORT=9090 -p 9090:9090 --name test_container ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
99+
sleep 2
100+
curl -f http://localhost:9090/health || (docker logs test_container && exit 1)
101+
docker stop test_container
102+
docker rm test_container
103+
104+
- name: 📦 Build and push Docker images (slim)
105+
uses: docker/build-push-action@v6
106+
with:
107+
context: .
108+
file: ./docker/Dockerfile
109+
push: true
110+
tags: |
111+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.marimo_version }}
112+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
113+
target: slim
114+
platforms: linux/amd64,linux/arm64
115+
build-args: |
116+
marimo_version=${{ inputs.marimo_version }}
117+
labels: ${{ steps.meta.outputs.labels }}
118+
cache-from: type=gha
119+
cache-to: type=gha,mode=max
120+
121+
- name: 📦 Build and push Docker images (data)
122+
uses: docker/build-push-action@v6
123+
with:
124+
context: .
125+
file: ./docker/Dockerfile
126+
push: true
127+
tags: |
128+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.marimo_version }}-data
129+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-data
130+
target: data
131+
platforms: linux/amd64,linux/arm64
132+
build-args: |
133+
marimo_version=${{ inputs.marimo_version }}
134+
labels: ${{ steps.meta.outputs.labels }}
135+
cache-from: type=gha
136+
cache-to: type=gha,mode=max
137+
138+
- name: 📦 Build and push Docker images (sql)
139+
uses: docker/build-push-action@v6
140+
with:
141+
context: .
142+
file: ./docker/Dockerfile
143+
push: true
144+
tags: |
145+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.marimo_version }}-sql
146+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-sql
147+
target: sql
148+
platforms: linux/amd64,linux/arm64
149+
build-args: |
150+
marimo_version=${{ inputs.marimo_version }}
151+
labels: ${{ steps.meta.outputs.labels }}
152+
cache-from: type=gha
153+
cache-to: type=gha,mode=max

.github/workflows/release-prod.yml

Lines changed: 4 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -108,133 +108,10 @@ jobs:
108108

109109
publish_docker:
110110
name: 🐋 Publish Docker images
111-
runs-on: ubuntu-latest
112-
needs: [publish_release]
113-
# Don't error while this is in BETA
114-
continue-on-error: true
111+
needs: publish_release
112+
uses: ./.github/workflows/publish-docker.yml
113+
with:
114+
marimo_version: ${{ needs.publish_release.outputs.marimo_version }}
115115
permissions:
116116
contents: read
117117
packages: write
118-
119-
steps:
120-
- name: ⬇️ Checkout repo
121-
uses: actions/checkout@v4
122-
123-
- name: ⏳ Wait for PyPI package availability
124-
run: |
125-
VERSION="${{ needs.publish_release.outputs.marimo_version }}"
126-
echo "Waiting for marimo version $VERSION to be available on PyPI..."
127-
128-
MAX_ATTEMPTS=30
129-
ATTEMPT=0
130-
SLEEP_TIME=10
131-
132-
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
133-
ATTEMPT=$((ATTEMPT + 1))
134-
echo "Attempt $ATTEMPT/$MAX_ATTEMPTS: Checking PyPI for version $VERSION..."
135-
136-
# Check if the version exists on PyPI
137-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/marimo/$VERSION/json")
138-
139-
if [ "$HTTP_CODE" = "200" ]; then
140-
echo "✅ Version $VERSION is available on PyPI!"
141-
exit 0
142-
else
143-
echo "Version $VERSION not yet available (HTTP $HTTP_CODE). Waiting ${SLEEP_TIME}s..."
144-
sleep $SLEEP_TIME
145-
fi
146-
done
147-
148-
echo "❌ Timed out waiting for version $VERSION on PyPI after $((MAX_ATTEMPTS * SLEEP_TIME)) seconds"
149-
exit 1
150-
151-
- name: 🐋 Log in to the Container registry
152-
uses: docker/login-action@v3
153-
with:
154-
registry: ${{ env.REGISTRY }}
155-
username: ${{ github.actor }}
156-
password: ${{ secrets.GITHUB_TOKEN }}
157-
158-
- name: 🐋 Extract metadata (tags, labels) for Docker
159-
id: meta
160-
uses: docker/metadata-action@v5
161-
with:
162-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
163-
164-
- name: 🐋 Set up Docker Buildx
165-
uses: docker/setup-buildx-action@v3
166-
167-
- name: 🧪 Build docker image for testing
168-
uses: docker/build-push-action@v6
169-
with:
170-
context: .
171-
file: ./docker/Dockerfile
172-
# Don't push test image
173-
push: false
174-
load: true
175-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
176-
target: slim
177-
build-args: |
178-
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
179-
labels: ${{ steps.meta.outputs.labels }}
180-
cache-from: type=gha
181-
cache-to: type=gha,mode=max
182-
183-
- name: 🧪 Test docker build
184-
run: |
185-
docker run -d -e PORT=9090 -p 9090:9090 --name test_container ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
186-
sleep 2
187-
curl -f http://localhost:9090/health || (docker logs test_container && exit 1)
188-
docker stop test_container
189-
docker rm test_container
190-
191-
- name: 📦 Build and push Docker images (slim)
192-
uses: docker/build-push-action@v6
193-
with:
194-
context: .
195-
file: ./docker/Dockerfile
196-
push: true
197-
tags: |
198-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}
199-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
200-
target: slim
201-
platforms: linux/amd64,linux/arm64
202-
build-args: |
203-
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
204-
labels: ${{ steps.meta.outputs.labels }}
205-
cache-from: type=gha
206-
cache-to: type=gha,mode=max
207-
208-
- name: 📦 Build and push Docker images (data)
209-
uses: docker/build-push-action@v6
210-
with:
211-
context: .
212-
file: ./docker/Dockerfile
213-
push: true
214-
tags: |
215-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}-data
216-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-data
217-
target: data
218-
platforms: linux/amd64,linux/arm64
219-
build-args: |
220-
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
221-
labels: ${{ steps.meta.outputs.labels }}
222-
cache-from: type=gha
223-
cache-to: type=gha,mode=max
224-
225-
- name: 📦 Build and push Docker images (sql)
226-
uses: docker/build-push-action@v6
227-
with:
228-
context: .
229-
file: ./docker/Dockerfile
230-
push: true
231-
tags: |
232-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}-sql
233-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-sql
234-
target: sql
235-
platforms: linux/amd64,linux/arm64
236-
build-args: |
237-
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
238-
labels: ${{ steps.meta.outputs.labels }}
239-
cache-from: type=gha
240-
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)