Skip to content

Commit 6e113a1

Browse files
lucferbuxtarilabs
andauthored
Enable standalone image build (#955)
* feat(ci): add GitHub Actions workflow for building and pushing UI standalone image Signed-off-by: lucferbux <lferrnan@redhat.com> * Edit kind script to avoid building standalone image Signed-off-by: lucferbux <lferrnan@redhat.com> * Update .github/workflows/build-and-push-ui-images-standalone.yml Co-authored-by: Matteo Mortari <matteo.mortari@gmail.com> Signed-off-by: Lucas Fernandez <lucasfernandezaragon@gmail.com> * Update .github/workflows/build-and-push-ui-images-standalone.yml Co-authored-by: Matteo Mortari <matteo.mortari@gmail.com> Signed-off-by: Lucas Fernandez <lucasfernandezaragon@gmail.com> --------- Signed-off-by: lucferbux <lferrnan@redhat.com> Signed-off-by: Lucas Fernandez <lucasfernandezaragon@gmail.com> Co-authored-by: Matteo Mortari <matteo.mortari@gmail.com>
1 parent b50e46f commit 6e113a1

4 files changed

Lines changed: 87 additions & 12 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Push UI Standalone Image
2+
# this workflow builds an image to support local testing
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
paths:
10+
- 'clients/ui/**'
11+
- '!LICENSE*'
12+
- '!DOCKERFILE*'
13+
- '!**.gitignore'
14+
- '!**.md'
15+
- '!**.txt'
16+
env:
17+
IMG_REGISTRY: ghcr.io
18+
IMG_ORG: kubeflow
19+
IMG_UI_REPO: model-registry/ui-standalone # this image is intended for local development, not production
20+
DOCKER_USER: ${{ github.actor }}
21+
DOCKER_PWD: ${{ secrets.GITHUB_TOKEN }}
22+
jobs:
23+
build-and-push:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Log in to the Container registry
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ${{ env.IMG_REGISTRY }}
39+
username: ${{ env.DOCKER_USER }}
40+
password: ${{ env.DOCKER_PWD }}
41+
42+
- name: Set main-branch environment
43+
if: github.ref == 'refs/heads/main'
44+
run: |
45+
commit_sha=${{ github.sha }}
46+
tag=main-${commit_sha:0:7}
47+
echo "VERSION=${tag}" >> $GITHUB_ENV
48+
49+
- name: Set tag environment
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
run: |
52+
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
53+
54+
- name: Extract metadata (tags, labels) for Docker
55+
id: meta
56+
uses: docker/metadata-action@v4
57+
with:
58+
images: "${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_UI_REPO }}"
59+
tags: |
60+
type=ref,event=branch
61+
type=ref,event=pr
62+
type=semver,pattern={{version}}
63+
type=semver,pattern={{major}}.{{minor}}
64+
type=sha
65+
type=raw,value=${{ env.VERSION }},enable=${{ env.VERSION != '' }}
66+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
67+
68+
- name: Build and push Docker image
69+
uses: docker/build-push-action@v6
70+
with:
71+
context: ./clients/ui
72+
push: true
73+
tags: ${{ steps.meta.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}
75+
build-args: |
76+
MOCK_AUTH=true
77+
DEPLOYMENT_MODE=standalone
78+
cache-from: type=gha
79+
cache-to: type=gha,mode=max

clients/ui/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
############### Default settings ###############
33
CONTAINER_TOOL=docker
4-
IMG_UI=kubeflow/model-registry-ui:latest
5-
IMG_UI_STANDALONE=kubeflow/model-registry-ui-standalone:latest
4+
IMG_UI=ghcr.io/kubeflow/model-registry/ui:latest
5+
IMG_UI_STANDALONE=ghcr.io/kubeflow/model-registry/ui-standalone:latest
66
PLATFORM=linux/amd64

clients/ui/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ The following environment variables are used to configure the deployment and dev
4040
### `IMG_UI`
4141

4242
* **Description**: Specifies the image name and tag for the UI (with BFF).
43-
* **Default Value**: `model-registry-ui:latest`
44-
* **Example**: `IMG_UI=model-registry-bff:latest`
43+
* **Default Value**: `ghcr.io/kubeflow/model-registry/ui:latest`
44+
* **Example**: `IMG_UI=ghcr.io/kubeflow/model-registry/ui:latest`
4545

4646
### `IMG_UI_STANDALONE`
4747

4848
* **Description**: Specifies the image name and tag for the UI (with BFF) in **standalone mode**, used for local kind deployment.
49-
* **Default Value**: `model-registry-ui-standalone:latest`
50-
* **Example**: `IMG_UI_STANDALONE=model-registry-bff:latest`
49+
* **Default Value**: `ghcr.io/kubeflow/model-registry/ui-standalone:latest`
50+
* **Example**: `IMG_UI_STANDALONE=ghcr.io/kubeflow/model-registry/ui-standalone:latest`
5151

5252
### `PLATFORM`
5353

clients/ui/scripts/deploy_kind_cluster.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@ else
3737
kubectl get pods -n kubeflow
3838
fi
3939

40-
# Step 4: Build Model Registry and push in standalone mode
41-
echo "Building Model Registry UI..."
42-
make docker-build-standalone
43-
make docker-push-standalone
44-
40+
# Step 4: Deploy model registry UI
4541
echo "Editing kustomize image..."
4642
pushd ../../manifests/kustomize/options/ui/base
4743
kustomize edit set image model-registry-ui=${IMG_UI_STANDALONE}
4844

4945
pushd ../overlays/standalone
50-
# Step 4: Deploy model registry UI
46+
5147
echo "Deploying Model Registry UI..."
5248
kustomize edit set namespace kubeflow
5349
kubectl apply -n kubeflow -k .

0 commit comments

Comments
 (0)