diff --git a/.github/workflows/build-and-push-ui-images.yml b/.github/workflows/build-and-push-ui-images.yml index 0b98c127f..12769daef 100644 --- a/.github/workflows/build-and-push-ui-images.yml +++ b/.github/workflows/build-and-push-ui-images.yml @@ -17,6 +17,10 @@ jobs: build-image: runs-on: ubuntu-latest steps: + # Assign context variable for various action contexts (tag, main, CI) + - name: Assigning tag context + if: github.head_ref == '' && startsWith(github.ref, 'refs/tags/v') + run: echo "BUILD_CONTEXT=tag" >> $GITHUB_ENV # Assign context variable for various action contexts (main, CI) - name: Assigning main context if: github.head_ref == '' && github.ref == 'refs/heads/main' @@ -30,6 +34,10 @@ jobs: commit_sha=${{ github.event.after }} tag=main-${commit_sha:0:7} echo "VERSION=${tag}" >> $GITHUB_ENV + - name: Set tag environment + if: env.BUILD_CONTEXT == 'tag' + run: | + echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV - name: Build and Push UI Image shell: bash env: diff --git a/clients/ui/Makefile b/clients/ui/Makefile index de125cc7d..566560aba 100644 --- a/clients/ui/Makefile +++ b/clients/ui/Makefile @@ -76,6 +76,10 @@ docker-push-standalone: kind-deployment: ./scripts/deploy_kind_cluster.sh +.PHONY: kubeflow-deployment +kubeflow-deployment: + ./scripts/deploy_kubeflow_cluster.sh + ############ Build ############ .PHONY: frontend-build frontend-build: diff --git a/clients/ui/scripts/deploy_kubeflow_cluster.sh b/clients/ui/scripts/deploy_kubeflow_cluster.sh new file mode 100755 index 000000000..b7605ba6d --- /dev/null +++ b/clients/ui/scripts/deploy_kubeflow_cluster.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Check for required tools +command -v docker >/dev/null 2>&1 || { echo >&2 "Docker is required but it's not installed. Aborting."; exit 1; } +command -v kubectl >/dev/null 2>&1 || { echo >&2 "kubectl is required but it's not installed. Aborting."; exit 1; } +command -v kind >/dev/null 2>&1 || { echo >&2 "kind is required but it's not installed. Aborting."; exit 1; } + +echo -e "\033[33mWARNING: You must have access to a cluster with kubeflow installed.\033[0m" + +# Step 1: Deploy Model Registry UI to cluster +pushd ../../manifests/kustomize/options/ui/overlays/istio +echo -e "\033[32mDeploying Model Registry UI...\033[0m" +kubectl apply -n kubeflow -k . + +# Step 2: Edit the centraldashboard-config ConfigMap +echo -e "\033[32mEditing centraldashboard-config ConfigMap...\033[0m" +kubectl get configmap centraldashboard-config -n kubeflow -o json | jq '.data.links |= (fromjson | .menuLinks += [{"icon": "assignment", "link": "/model-registry/", "text": "Model Registry", "type": "item"}] | tojson)' | kubectl apply -f - + +# Wait for deployment to be available +echo -e "\033[32mWaiting Model Registry UI to be available...\033[0m" +kubectl wait --for=condition=available -n kubeflow deployment/model-registry-ui --timeout=1m + +# Step 5: Port-forward the service +echo "\033[32mPort-forwarding Kubeflow Central Dashboard...\033[0m" +echo -e "\033[32mDashboard available in http://localhost:8080\033[0m" +kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80 diff --git a/manifests/kustomize/README.md b/manifests/kustomize/README.md index a931e5686..09e6f8512 100644 --- a/manifests/kustomize/README.md +++ b/manifests/kustomize/README.md @@ -44,22 +44,45 @@ curl -sX 'GET' \ There are two main ways to deploy the Model Registry UI: -1. Standalone mode - Use this if you are using Model Registry without the Kubeflow Platform +1. Standalone mode - Use this if you are using Model Registry without the Kubeflow Platform (**Note: You will need a custom standalone image**) 2. Integrated mode - Use this if you are deploying Model Registry in Kubeflow -For a standalone install run the following command: +For a standalone install, we recommend following the [Model Registry UI standalone deployment documentation](../../clients/ui/docs/local-deployment-guide-ui.md). + +For an integrated install use the kubeflow UI overlay: ```bash -kubectl apply -k options/ui/overlays/standalone -n kubeflow +kubectl apply -k options/ui/overlays/istio -n kubeflow ``` -For an integrated install use the istio UI overlay: +To make Model Registry UI accessible from the Kubeflow UI, you need to add the following to your Kubeflow UI configmap: ```bash -kubectl apply -k options/ui/overlays/istio -n kubeflow +kubectl edit configmap -n kubeflow centraldashboard-config +``` + +```yaml +apiVersion: v1 +data: + links: |- + { + "menuLinks": [ + { + "icon": "assignment", + "link": "/model-registry/", + "text": "Model Registry", + "type": "item" + }, + ... ``` +Or you can add it in one line with: + +```bash +kubectl get configmap centraldashboard-config -n kubeflow -o json | jq '.data.links |= (fromjson | .menuLinks += [{"icon": "assignment", "link": "/model-registry/", "text": "Model Registry", "type": "item"}] | tojson)' | kubectl apply -f - -n kubeflow +```` + ## Usage For a basic usage of the Kubeflow Model Registry, follow the [Kubeflow Model Registry getting started documentation](https://www.kubeflow.org/docs/components/model-registry/getting-started/) @@ -74,4 +97,4 @@ kubectl delete -k options/istio # Delete model registry db and deployment kubectl delete -k overlays/db -``` \ No newline at end of file +``` diff --git a/manifests/kustomize/options/ui/overlays/istio/kustomization.yaml b/manifests/kustomize/options/ui/overlays/istio/kustomization.yaml index c54986243..c0f6f8fed 100644 --- a/manifests/kustomize/options/ui/overlays/istio/kustomization.yaml +++ b/manifests/kustomize/options/ui/overlays/istio/kustomization.yaml @@ -13,3 +13,5 @@ patches: version: v1 kind: Service name: model-registry-ui-service + +namespace: kubeflow \ No newline at end of file