Skip to content

Commit

Permalink
scripts: add clarifications
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Mortari <matteo.mortari@gmail.com>
Co-authored-by: Matteo Mortari <matteo.mortari@gmail.com>
Signed-off-by: Isabella do Amaral <idoamara@redhat.com>
  • Loading branch information
isinyaaa and tarilabs committed Oct 4, 2024
1 parent 9e8d0d4 commit 4fa3cce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -e
MR_NAMESPACE="${MR_NAMESPACE:-kubeflow}"
TEST_DB_NAME="${TEST_DB_NAME:-metadb}"

SQL_CMD=$(
# transaction start commands are different between sqlite and mysql
PARTIAL_SQL_CMD=$(
cat <<EOF
DELETE FROM Artifact;
DELETE FROM ArtifactProperty;
Expand All @@ -25,10 +26,10 @@ EOF
if [[ -n "$LOCAL" ]]; then
echo 'Cleaning up local sqlite DB'

sqlite3 test/config/ml-metadata/metadata.sqlite.db <<<"BEGIN TRANSACTION; $SQL_CMD"
sqlite3 test/config/ml-metadata/metadata.sqlite.db <<<"BEGIN TRANSACTION; $PARTIAL_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"
-- mysql -u root -ptest -D "$TEST_DB_NAME" -e "START TRANSACTION; $PARTIAL_SQL_CMD"
fi
1 change: 1 addition & 0 deletions scripts/deploy_on_kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

MR_NAMESPACE="${MR_NAMESPACE:-kubeflow}"

# modularity to allow re-use this script against a remote k8s cluster
if [[ -n "$LOCAL" ]]; then
CLUSTER_NAME="${CLUSTER_NAME:-kind}"
IMG="${IMG:-docker.io/kubeflow/model-registry:main}"
Expand Down

0 comments on commit 4fa3cce

Please sign in to comment.