Skip to content

Commit 732ec1e

Browse files
authored
ci: publish v2 docker images (#10350)
* ci: publish v2 docker images since or transition to v2 in 1.6.x we have not been publishing any of our docker images. * chore: try fixing lfx cleanup error lfx cleanup error * chore: address rabbitcode comments * chore: address rabit uv comment * chore: remove build-args to see if it passes * chore: skip ci * chore: add back in LANGFLOW_IMAGE * chore: debug inputs.ref and matrix.langflow_image * chore: add {} to fix InvalidDefaultArgInForm * chore: try adding quotes * chore: try ENV LANGFLOW_IMAGE=${LANGFLOW_IMAGE} * chore: add build args to GitHub Container Registry * chore: clean up * chore: seperate out frontend and backend images * chore: update create-manifest * chore: remove ci step * chore: update release * chore: clean up * chore: clean up langflow-image * chore: revert ci removal * fix: add back in main logic update back/frontend add main back in update back/frontend to match orginal man logic more * chore: more clean up to match main * chore: remove arch from lagnflowimage for backend * chore: add misisng - for ghcr.io * chore: skip ci * chore: build_main and build_and_push_backend fixes * chore: seperate ghcr and docker publishing with if * chore: add back CI step --------- Co-authored-by: Adam Aghili <Adam.Aghili@ibm.com>
1 parent 9613d4e commit 732ec1e

5 files changed

Lines changed: 268 additions & 19 deletions

File tree

.github/workflows/docker-build-v2.yml

Lines changed: 239 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
release_type:
88
required: true
99
type: string
10-
description: "Release type. One of 'main', 'main-ep', 'base', 'main-all'."
10+
description: "Release type. One of 'main', 'main-backend', 'main-frontend', 'main-ep', 'base', 'main-all'."
1111
pre_release:
1212
required: false
1313
type: boolean
@@ -25,11 +25,13 @@ on:
2525
workflow_dispatch:
2626
inputs:
2727
release_type:
28-
description: "Type of release. One of 'main', 'main-ep', 'base', 'main-all'."
28+
description: "Type of release. One of 'main', 'main-backend', 'main-frontend', 'main-ep', 'base', 'main-all'."
2929
required: true
3030
type: choice
3131
options:
3232
- main
33+
- main-backend
34+
- main-frotnend
3335
- main-ep
3436
- base
3537
- main-all
@@ -64,7 +66,6 @@ jobs:
6466
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
6567
runs-on: ${{ matrix.runner }}
6668
steps:
67-
6869
- name: Check out the code
6970
uses: actions/checkout@v5
7071
with:
@@ -150,7 +151,6 @@ jobs:
150151
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
151152
runs-on: ${{ matrix.runner }}
152153
steps:
153-
154154
- name: Check out the code
155155
uses: actions/checkout@v5
156156
with:
@@ -224,6 +224,212 @@ jobs:
224224
cache-from: type=gha
225225
cache-to: type=gha,mode=max
226226

227+
build-main-backend:
228+
name: Build Main Backend Package
229+
if: ${{ inputs.release_type == 'main-backend' }}
230+
strategy:
231+
matrix:
232+
component: [docker-backend, ghcr-backend]
233+
include:
234+
- component: docker-backend
235+
arch: amd64
236+
runner: Langflow-runner
237+
238+
- component: docker-backend
239+
arch: arm64
240+
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
241+
242+
- component: ghcr-backend
243+
arch: amd64
244+
runner: Langflow-runner
245+
246+
- component: ghcr-backend
247+
arch: arm64
248+
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
249+
runs-on: ${{ matrix.runner }}
250+
steps:
251+
- name: Check out the code
252+
uses: actions/checkout@v5
253+
with:
254+
ref: ${{ inputs.ref }}
255+
256+
- name: Setup Environment
257+
uses: astral-sh/setup-uv@v6
258+
with:
259+
enable-cache: true
260+
cache-dependency-glob: "uv.lock"
261+
python-version: "3.13"
262+
prune-cache: false
263+
264+
- name: Get version
265+
id: version
266+
run: |
267+
echo "Extracting main version from pyproject.toml"
268+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
269+
echo "Using version: $version"
270+
echo version=$version >> $GITHUB_OUTPUT
271+
272+
- name: Set tags
273+
id: tags
274+
run: |
275+
version="${{ steps.version.outputs.version }}"
276+
echo "docker_tags=langflowai/langflow-backend:${version}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
277+
echo "ghcr_tags=ghcr.io/langflow-ai/langflow-backend:${version}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
278+
279+
- name: Docker cleanup
280+
run: |
281+
docker system prune -af --volumes || true
282+
docker buildx prune -af || true
283+
284+
- name: Set up Docker Buildx
285+
uses: docker/setup-buildx-action@v3
286+
287+
- name: Login to Docker Hub
288+
if: ${{ matrix.component == 'docker-backend' }}
289+
uses: docker/login-action@v3
290+
with:
291+
username: ${{ secrets.DOCKERHUB_USERNAME }}
292+
password: ${{ secrets.DOCKERHUB_TOKEN }}
293+
294+
- name: Build and push to Docker Hub
295+
if: ${{ matrix.component == 'docker-backend' }}
296+
uses: docker/build-push-action@v6
297+
with:
298+
context: .
299+
push: ${{ inputs.push_to_registry }}
300+
build-args: |
301+
LANGFLOW_IMAGE=langflowai/langflow:${{ steps.version.outputs.version }}-${{ matrix.arch }}
302+
file: ./docker/build_and_push_backend.Dockerfile
303+
tags: ${{ steps.tags.outputs.docker_tags }}
304+
platforms: linux/${{ matrix.arch }}
305+
provenance: false
306+
cache-from: type=gha
307+
cache-to: type=gha,mode=max
308+
309+
- name: Login to GitHub Container Registry
310+
if: ${{ matrix.component == 'ghcr-backend' }}
311+
uses: docker/login-action@v3
312+
with:
313+
registry: ghcr.io
314+
username: ${{ github.actor }}
315+
password: ${{ secrets.TEMP_GHCR_TOKEN}}
316+
317+
- name: Build and push to GitHub Container Registry
318+
if: ${{ matrix.component == 'ghcr-backend' }}
319+
uses: docker/build-push-action@v6
320+
with:
321+
context: .
322+
push: ${{ inputs.push_to_registry }}
323+
build-args: |
324+
LANGFLOW_IMAGE=ghcr.io/langflow-ai/langflow:${{ steps.version.outputs.version }}-${{ matrix.arch }}
325+
file: ./docker/build_and_push_backend.Dockerfile
326+
tags: ${{ steps.tags.outputs.ghcr_tags }}
327+
platforms: linux/${{ matrix.arch }}
328+
provenance: false
329+
cache-from: type=gha
330+
cache-to: type=gha,mode=max
331+
332+
build-main-frontend:
333+
name: Build Main Frontend Package
334+
if: ${{ inputs.release_type == 'main-frontend' }}
335+
strategy:
336+
matrix:
337+
component: [docker-frontend, ghcr-frontend]
338+
include:
339+
- component: docker-frontend
340+
arch: amd64
341+
runner: Langflow-runner
342+
343+
- component: docker-frontend
344+
arch: arm64
345+
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
346+
347+
- component: ghcr-frontend
348+
arch: amd64
349+
runner: Langflow-runner
350+
351+
- component: ghcr-frontend
352+
arch: arm64
353+
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
354+
runs-on: ${{ matrix.runner }}
355+
steps:
356+
- name: Check out the code
357+
uses: actions/checkout@v5
358+
with:
359+
ref: ${{ inputs.ref }}
360+
361+
- name: Setup Environment
362+
uses: astral-sh/setup-uv@v6
363+
with:
364+
enable-cache: true
365+
cache-dependency-glob: "uv.lock"
366+
python-version: "3.13"
367+
prune-cache: false
368+
369+
- name: Get version
370+
id: version
371+
run: |
372+
echo "Extracting main version from pyproject.toml"
373+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
374+
echo "Using version: $version"
375+
echo version=$version >> $GITHUB_OUTPUT
376+
377+
- name: Set tags
378+
id: tags
379+
run: |
380+
version="${{ steps.version.outputs.version }}"
381+
echo "docker_tags=langflowai/langflow-frontend:${version}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
382+
echo "ghcr_tags=ghcr.io/langflow-ai/langflow-frontend:${version}-${{ matrix.arch }}" >> $GITHUB_OUTPUT
383+
384+
- name: Docker cleanup
385+
run: |
386+
docker system prune -af --volumes || true
387+
docker buildx prune -af || true
388+
389+
- name: Set up Docker Buildx
390+
uses: docker/setup-buildx-action@v3
391+
392+
- name: Login to Docker Hub
393+
if: ${{ matrix.component == 'docker-frontend' }}
394+
uses: docker/login-action@v3
395+
with:
396+
username: ${{ secrets.DOCKERHUB_USERNAME }}
397+
password: ${{ secrets.DOCKERHUB_TOKEN }}
398+
399+
- name: Build and push to Docker Hub
400+
if: ${{ matrix.component == 'docker-frontend' }}
401+
uses: docker/build-push-action@v6
402+
with:
403+
context: .
404+
push: ${{ inputs.push_to_registry }}
405+
file: ./docker/frontend/build_and_push_frontend.Dockerfile
406+
tags: ${{ steps.tags.outputs.docker_tags }}
407+
platforms: linux/${{ matrix.arch }}
408+
provenance: false
409+
cache-from: type=gha
410+
cache-to: type=gha,mode=max
411+
412+
- name: Login to GitHub Container Registry
413+
if: ${{ matrix.component == 'ghcr-frontend' }}
414+
uses: docker/login-action@v3
415+
with:
416+
registry: ghcr.io
417+
username: ${{ github.actor }}
418+
password: ${{ secrets.TEMP_GHCR_TOKEN}}
419+
420+
- name: Build and push to GitHub Container Registry
421+
if: ${{ matrix.component == 'ghcr-frontend' }}
422+
uses: docker/build-push-action@v6
423+
with:
424+
context: .
425+
push: ${{ inputs.push_to_registry }}
426+
file: ./docker/frontend/build_and_push_frontend.Dockerfile
427+
tags: ${{ steps.tags.outputs.ghcr_tags }}
428+
platforms: linux/${{ matrix.arch }}
429+
provenance: false
430+
cache-from: type=gha
431+
cache-to: type=gha,mode=max
432+
227433
build-main-ep:
228434
name: Build Main EP Package
229435
if: ${{ inputs.release_type == 'main-ep' }}
@@ -236,7 +442,6 @@ jobs:
236442
runner: [self-hosted, linux, ARM64, langflow-ai-arm64-40gb]
237443
runs-on: ${{ matrix.runner }}
238444
steps:
239-
240445
- name: Check out the code
241446
uses: actions/checkout@v5
242447
with:
@@ -397,9 +602,17 @@ jobs:
397602

398603
create-manifest:
399604
name: Create Multi-Arch Manifest
400-
needs: [build-base, build-main, build-main-ep, build-main-all]
605+
needs:
606+
[
607+
build-base,
608+
build-main,
609+
build-main-backend,
610+
build-main-frontend,
611+
build-main-ep,
612+
build-main-all,
613+
]
401614
runs-on: ubuntu-latest
402-
if: ${{ always() && inputs.push_to_registry && (needs.build-base.result == 'success' || needs.build-main.result == 'success' || needs.build-main-ep.result == 'success' || needs.build-main-all.result == 'success') }}
615+
if: ${{ always() && inputs.push_to_registry && (needs.build-base.result == 'success' || needs.build-main.result == 'success' || needs.build-main-backend.result == 'success' || needs.build-main-frontend.result == 'success' || needs.build-main-ep.result == 'success' || needs.build-main-all.result == 'success') }}
403616
steps:
404617
- name: Setup Environment
405618
uses: astral-sh/setup-uv@v6
@@ -448,6 +661,24 @@ jobs:
448661
echo "arch_base=langflowai/langflow:${version}" >> $GITHUB_OUTPUT
449662
echo "ghcr_arch_base=ghcr.io/langflow-ai/langflow:${version}" >> $GITHUB_OUTPUT
450663
;;
664+
"main-backend")
665+
if [[ "${{ inputs.pre_release }}" == "true" ]]; then
666+
echo "final_tags=langflowai/langflow-backend:${version},ghcr.io/langflow-ai/langflow-backend:${version}" >> $GITHUB_OUTPUT
667+
else
668+
echo "final_tags=langflowai/langflow-backend:${version},langflowai/langflow-backend:latest,ghcr.io/langflow-ai/langflow-backend:${version},ghcr.io/langflow-ai/langflow-backend:latest" >> $GITHUB_OUTPUT
669+
fi
670+
echo "arch_base=langflowai/langflow-backend:${version}" >> $GITHUB_OUTPUT
671+
echo "ghcr_arch_base=ghcr.io/langflow-ai/langflow-backend:${version}" >> $GITHUB_OUTPUT
672+
;;
673+
"main-frontend")
674+
if [[ "${{ inputs.pre_release }}" == "true" ]]; then
675+
echo "final_tags=langflowai/langflow-frontend:${version},ghcr.io/langflow-ai/langflow-frontend:${version}" >> $GITHUB_OUTPUT
676+
else
677+
echo "final_tags=langflowai/langflow-frontend:${version},langflowai/langflow-frontend:latest,ghcr.io/langflow-ai/langflow-frontend:${version},ghcr.io/langflow-ai/langflow-frontend:latest" >> $GITHUB_OUTPUT
678+
fi
679+
echo "arch_base=langflowai/langflow-frontend:${version}" >> $GITHUB_OUTPUT
680+
echo "ghcr_arch_base=ghcr.io/langflow-ai/langflow-frontend:${version}" >> $GITHUB_OUTPUT
681+
;;
451682
"main-ep")
452683
echo "final_tags=langflowai/langflow-ep:${version},langflowai/langflow-ep:latest,ghcr.io/langflow-ai/langflow-ep:${version},ghcr.io/langflow-ai/langflow-ep:latest" >> $GITHUB_OUTPUT
453684
echo "arch_base=langflowai/langflow-ep:${version}" >> $GITHUB_OUTPUT
@@ -497,4 +728,4 @@ jobs:
497728
--tag "$tag" \
498729
"$amd64_tag" \
499730
"$arm64_tag"
500-
done
731+
done

.github/workflows/python_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
python-version: ${{ matrix.python-version }}
165165
prune-cache: false
166166
- name: Run lfx tests
167-
run: make lfx_tests
167+
run: uv run make lfx_tests
168168
env:
169169
DO_NOT_TRACK: true # disable telemetry reporting
170170

.github/workflows/release.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ on:
4949
type: boolean
5050
default: true
5151

52-
53-
5452
jobs:
5553
echo-inputs:
5654
name: Echo Workflow Inputs
@@ -75,7 +73,7 @@ jobs:
7573
- name: Checkout code
7674
uses: actions/checkout@v5
7775
with:
78-
fetch-depth: 0 # Fetch all history - required for tags (?)
76+
fetch-depth: 0 # Fetch all history - required for tags (?)
7977
- name: Validate that input is a tag, not a branch
8078
run: |
8179
# Check if the input exists as a tag
@@ -129,7 +127,6 @@ jobs:
129127
runs-on: ubuntu-latest
130128
secrets: inherit
131129

132-
133130
build-base:
134131
name: Build Langflow Base
135132
needs: [ci]
@@ -294,7 +291,6 @@ jobs:
294291
main-artifact-name: "dist-main"
295292
lfx-artifact-name: "${{ inputs.release_lfx && 'dist-lfx' || '' }}"
296293

297-
298294
publish-base:
299295
name: Publish Langflow Base to PyPI
300296
if: ${{ inputs.release_package_base }}
@@ -462,6 +458,30 @@ jobs:
462458
push_to_registry: ${{ !inputs.dry_run }}
463459
secrets: inherit
464460

461+
call_docker_build_main_backend:
462+
name: Call Docker Build Workflow for Langflow Backend
463+
if: ${{ inputs.build_docker_main }}
464+
needs: [ci]
465+
uses: ./.github/workflows/docker-build-v2.yml
466+
with:
467+
ref: ${{ inputs.release_tag }}
468+
release_type: main-backend
469+
pre_release: ${{ inputs.pre_release }}
470+
push_to_registry: ${{ !inputs.dry_run }}
471+
secrets: inherit
472+
473+
call_docker_build_main_frontend:
474+
name: Call Docker Build Workflow for Langflow Frontend
475+
if: ${{ inputs.build_docker_main }}
476+
needs: [ci]
477+
uses: ./.github/workflows/docker-build-v2.yml
478+
with:
479+
ref: ${{ inputs.release_tag }}
480+
release_type: main-frontend
481+
pre_release: ${{ inputs.pre_release }}
482+
push_to_registry: ${{ !inputs.dry_run }}
483+
secrets: inherit
484+
465485
call_docker_build_main_ep:
466486
name: Call Docker Build Workflow for Langflow with Entrypoint
467487
if: ${{ inputs.build_docker_main }}
@@ -486,8 +506,6 @@ jobs:
486506
push_to_registry: ${{ !inputs.dry_run }}
487507
secrets: inherit
488508

489-
490-
491509
create_release:
492510
name: Create Release
493511
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)