forked from kubeflow/model-registry
-
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.
Signed-off-by: Isabella do Amaral <idoamara@redhat.com>
- Loading branch information
Showing
7 changed files
with
127 additions
and
68 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
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
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
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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
MR_NAMESPACE="${MR_NAMESPACE:-kubeflow}" | ||
TEST_DB_NAME="${TEST_DB_NAME:-metadb}" | ||
|
||
SQL_CMD=$( | ||
cat <<EOF | ||
DELETE FROM Artifact; | ||
DELETE FROM ArtifactProperty; | ||
DELETE FROM Association; | ||
DELETE FROM Attribution; | ||
DELETE FROM Context; | ||
DELETE FROM ContextProperty; | ||
DELETE FROM Event; | ||
DELETE FROM EventPath; | ||
DELETE FROM Execution; | ||
DELETE FROM ExecutionProperty; | ||
DELETE FROM ParentContext; | ||
COMMIT; | ||
EOF | ||
) | ||
|
||
if [[ -n "$LOCAL" ]]; then | ||
echo 'Cleaning up local sqlite DB' | ||
|
||
sqlite3 test/config/ml-metadata/metadata.sqlite.db <<<"BEGIN TRANSACTION; $SQL_CMD" | ||
else | ||
echo 'Cleaning up kubernetes MySQL DB' | ||
|
||
kubectl exec -n "$MR_NAMESPACE" -it "$(kubectl get pods -l component=db -o jsonpath="{.items[0].metadata.name}" -n "$MR_NAMESPACE")" \ | ||
-- mysql -u root -ptest -D "$TEST_DB_NAME" -e "START TRANSACTION; $SQL_CMD" | ||
fi |
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,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
MR_NAMESPACE="${MR_NAMESPACE:-kubeflow}" | ||
|
||
if [[ -n "$LOCAL" ]]; then | ||
CLUSTER_NAME="${CLUSTER_NAME:-kind}" | ||
IMG="${IMG:-kubeflow/model-registry:latest}" | ||
|
||
echo 'Creating local Kind cluster and loading image' | ||
kind create cluster -n "$CLUSTER_NAME" | ||
kind load docker-image -n "$CLUSTER_NAME" "$IMG" | ||
echo 'Image loaded into kind cluster - use this command to port forward the mr service:' | ||
echo "kubectl port-forward -n $MR_NAMESPACE service/model-registry-service 8080:8080 &" | ||
fi | ||
|
||
echo 'Deploying model registry to Kind cluster' | ||
|
||
kubectl create namespace "$MR_NAMESPACE" | ||
cd manifests/kustomize/overlays/db | ||
kustomize edit set image kubeflow/model-registry:latest "$IMG" | ||
kustomize build | kubectl apply -f - | ||
kubectl wait --for=condition=available -n "$MR_NAMESPACE" deployment/model-registry-db --timeout=5m | ||
kubectl wait --for=condition=available -n "$MR_NAMESPACE" deployment/model-registry-deployment --timeout=5m |