forked from kromanow94/kubeflow-manifests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update kubeflow/model-registry manifests from v0.2.0-alpha (kubeflow#…
…2697) * Update kubeflow/model-registry manifests from v0.2.0-alpha Signed-off-by: Ricardo M. Oliveira <[email protected]> * Setup KF Model Registry GH tests Signed-off-by: Andrea Lamparelli <[email protected]> Signed-off-by: Ricardo M. Oliveira <[email protected]> --------- Signed-off-by: Ricardo M. Oliveira <[email protected]> Signed-off-by: Andrea Lamparelli <[email protected]> Co-authored-by: Andrea Lamparelli <[email protected]>
- Loading branch information
1 parent
0cf6a01
commit 2278a92
Showing
28 changed files
with
625 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# If anyone changes or improve the following tests for Model Registry, please | ||
# consider reflecting the same changes on https://github.com/kubeflow/model-registry | ||
name: Deploy and test Kubeflow Model Registry | ||
on: | ||
pull_request: | ||
paths: | ||
- apps/model-registry/upstream/** | ||
- tests/gh-actions/kind-cluster.yaml | ||
- tests/gh-actions/install_istio.sh | ||
|
||
jobs: | ||
build-kfmr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install KinD | ||
run: ./tests/gh-actions/install_kind.sh | ||
|
||
- name: Create KinD Cluster | ||
run: kind create cluster --config tests/gh-actions/kind-cluster.yaml | ||
|
||
- name: Install kustomize | ||
run: ./tests/gh-actions/install_kustomize.sh | ||
|
||
- name: Install Istio | ||
run: ./tests/gh-actions/install_istio.sh | ||
|
||
- name: Create kubeflow namespace | ||
run: kustomize build common/kubeflow-namespace/base | kubectl apply -f - | ||
|
||
- name: Build & Apply KF Model Registry manifests | ||
run: | | ||
kustomize build apps/model-registry/upstream/overlays/db | kubectl apply -f - | ||
kustomize build apps/model-registry/upstream/options/istio | kubectl apply -f - | ||
- name: Test KF Model Registry deployment | ||
run: | | ||
echo "Waiting for all Model Registry Pods to become ready..." | ||
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-db --timeout=600s | ||
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=600s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
approvers: | ||
- tarilabs | ||
- rareddy | ||
- Tomcli | ||
reviewers: | ||
- tarilabs | ||
- rareddy | ||
- Tomcli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Install Kubeflow Model Registry | ||
|
||
This folder contains [Kubeflow Model Registry](https://www.kubeflow.org/docs/components/model-registry/installation/) Kustomize manifests | ||
|
||
## Installation | ||
|
||
To install Kubeflow Model Registry, follow [Kubeflow Model Registry deployment documentation](https://www.kubeflow.org/docs/components/model-registry/installation/) | ||
|
||
The following instructions will summarize how to deploy Model Registry as separate component in the context of a default Kubeflow >=1.8 installation. | ||
|
||
```bash | ||
kubectl apply -k overlays/db | ||
``` | ||
|
||
As the default Kubeflow installation provides an Istio mesh, apply the necessary manifests: | ||
|
||
```bash | ||
kubectl apply -k options/istio | ||
``` | ||
|
||
Check everything is up and running: | ||
|
||
```bash | ||
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=2m | ||
kubectl logs -n kubeflow deployment/model-registry-deployment | ||
``` | ||
|
||
Optionally, you can also port-forward the REST API container port of Model Registry to interact with it from your terminal: | ||
|
||
```bash | ||
kubectl port-forward svc/model-registry-service -n kubeflow 8081:8080 | ||
``` | ||
|
||
And then, from another terminal: | ||
|
||
```bash | ||
curl -sX 'GET' \ | ||
'http://localhost:8081/api/model_registry/v1alpha3/registered_models?pageSize=100&orderBy=ID&sortOrder=DESC' \ | ||
-H 'accept: application/json' | jq | ||
``` | ||
|
||
## 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/) | ||
|
||
## Uninstall | ||
|
||
To uninstall the Kubeflow Model Registry run: | ||
|
||
```bash | ||
# Delete istio options | ||
kubectl delete -k options/istio | ||
|
||
# Delete model registry db and deployment | ||
kubectl delete -k overlays/db | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- model-registry-configmap.yaml | ||
- model-registry-deployment.yaml | ||
- model-registry-service.yaml | ||
- model-registry-sa.yaml |
11 changes: 11 additions & 0 deletions
11
apps/model-registry/upstream/base/model-registry-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: model-registry-configmap | ||
labels: | ||
component: model-registry-server | ||
data: | ||
MODEL_REGISTRY_REST_SERVICE_HOST: "model-registry-service" | ||
MODEL_REGISTRY_REST_SERVICE_PORT: "8080" | ||
MODEL_REGISTRY_GRPC_SERVICE_HOST: "model-registry-service" | ||
MODEL_REGISTRY_GRPC_SERVICE_PORT: "9090" |
103 changes: 103 additions & 0 deletions
103
apps/model-registry/upstream/base/model-registry-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: model-registry-deployment | ||
labels: | ||
component: model-registry-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
component: model-registry-server | ||
template: | ||
metadata: | ||
labels: | ||
component: model-registry-server | ||
spec: | ||
containers: | ||
- name: rest-container | ||
args: | ||
- --hostname=0.0.0.0 | ||
- --port=8080 | ||
- --mlmd-hostname=localhost | ||
- --mlmd-port=9090 | ||
command: | ||
- /model-registry | ||
- proxy | ||
image: kubeflow/model-registry:latest | ||
# empty placeholder environment for patching | ||
env: [] | ||
ports: | ||
- name: http-api | ||
containerPort: 8080 | ||
livenessProbe: | ||
initialDelaySeconds: 30 | ||
periodSeconds: 5 | ||
tcpSocket: | ||
port: http-api | ||
timeoutSeconds: 2 | ||
readinessProbe: | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
tcpSocket: | ||
port: http-api | ||
timeoutSeconds: 2 | ||
- name: grpc-container | ||
# ! Sync to the same MLMD version: | ||
# * backend/metadata_writer/requirements.in and requirements.txt | ||
# * @kubeflow/frontend/src/mlmd/generated | ||
# * .cloudbuild.yaml and .release.cloudbuild.yaml | ||
# * manifests/kustomize/base/metadata/base/model-registry-deployment.yaml | ||
# * test/tag_for_hosted.sh | ||
image: gcr.io/tfx-oss-public/ml_metadata_store_server:1.14.0 | ||
env: | ||
- name: DBCONFIG_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: username | ||
- name: DBCONFIG_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-secret | ||
key: password | ||
- name: MYSQL_DATABASE | ||
valueFrom: | ||
configMapKeyRef: | ||
name: pipeline-install-config | ||
key: mlmdDb | ||
- name: MYSQL_HOST | ||
valueFrom: | ||
configMapKeyRef: | ||
name: pipeline-install-config | ||
key: dbHost | ||
- name: MYSQL_PORT | ||
valueFrom: | ||
configMapKeyRef: | ||
name: pipeline-install-config | ||
key: dbPort | ||
command: ["/bin/metadata_store_server"] | ||
args: ["--grpc_port=9090", | ||
"--mysql_config_database=$(MYSQL_DATABASE)", | ||
"--mysql_config_host=$(MYSQL_HOST)", | ||
"--mysql_config_port=$(MYSQL_PORT)", | ||
"--mysql_config_user=$(DBCONFIG_USER)", | ||
"--mysql_config_password=$(DBCONFIG_PASSWORD)", | ||
"--enable_database_upgrade=true" | ||
] | ||
ports: | ||
- name: grpc-api | ||
containerPort: 9090 | ||
livenessProbe: | ||
tcpSocket: | ||
port: grpc-api | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
timeoutSeconds: 2 | ||
readinessProbe: | ||
tcpSocket: | ||
port: grpc-api | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
timeoutSeconds: 2 | ||
serviceAccountName: model-registry-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: model-registry-server |
17 changes: 17 additions & 0 deletions
17
apps/model-registry/upstream/base/model-registry-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
labels: | ||
app: metadata | ||
name: model-registry-service | ||
spec: | ||
selector: | ||
component: model-registry-server | ||
type: ClusterIP | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
name: http-api | ||
- port: 9090 | ||
protocol: TCP | ||
name: grpc-api |
9 changes: 9 additions & 0 deletions
9
apps/model-registry/upstream/options/istio/destination-rule.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: DestinationRule | ||
metadata: | ||
name: model-registry-service | ||
spec: | ||
host: model-registry-service.kubeflow.svc.cluster.local | ||
trafficPolicy: | ||
tls: | ||
mode: ISTIO_MUTUAL |
11 changes: 11 additions & 0 deletions
11
apps/model-registry/upstream/options/istio/istio-authorization-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
name: model-registry-service | ||
spec: | ||
action: ALLOW | ||
selector: | ||
matchLabels: | ||
component: model-registry-server | ||
rules: | ||
- {} |
8 changes: 8 additions & 0 deletions
8
apps/model-registry/upstream/options/istio/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: kubeflow | ||
|
||
resources: | ||
- istio-authorization-policy.yaml | ||
- destination-rule.yaml | ||
- virtual-service.yaml |
24 changes: 24 additions & 0 deletions
24
apps/model-registry/upstream/options/istio/virtual-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: model-registry | ||
spec: | ||
gateways: | ||
- kubeflow-gateway | ||
hosts: | ||
- '*' | ||
tcp: | ||
- match: | ||
- port: 8080 | ||
route: | ||
- destination: | ||
host: model-registry-service.kubeflow.svc.cluster.local | ||
port: | ||
number: 8080 | ||
- match: | ||
- port: 9090 | ||
route: | ||
- destination: | ||
host: model-registry-service.kubeflow.svc.cluster.local | ||
port: | ||
number: 9090 |
38 changes: 38 additions & 0 deletions
38
apps/model-registry/upstream/overlays/db/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: kubeflow | ||
|
||
resources: | ||
- model-registry-db-pvc.yaml | ||
- model-registry-db-deployment.yaml | ||
- model-registry-db-service.yaml | ||
- ../../base | ||
|
||
patchesStrategicMerge: | ||
- patches/model-registry-deployment.yaml | ||
|
||
configMapGenerator: | ||
- envs: | ||
- params.env | ||
name: model-registry-db-parameters | ||
secretGenerator: | ||
- envs: | ||
- secrets.env | ||
name: model-registry-db-secrets | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
|
||
images: | ||
- name: mysql | ||
newName: mysql | ||
newTag: 8.0.3 | ||
|
||
vars: | ||
- fieldref: | ||
fieldPath: metadata.name | ||
name: MLMD_DB_HOST | ||
objref: | ||
apiVersion: v1 | ||
kind: Service | ||
name: model-registry-db |
Oops, something went wrong.