-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* py: add listener mechanism Signed-off-by: tarilabs <[email protected]> * add e2e test scenarios Signed-off-by: tarilabs <[email protected]> * wire GHA jobs Signed-off-by: tarilabs <[email protected]> * linting and minor changes Signed-off-by: tarilabs <[email protected]> --------- Signed-off-by: tarilabs <[email protected]>
- Loading branch information
Showing
16 changed files
with
395 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR="$(dirname "$(realpath "$BASH_SOURCE")")" | ||
set -e | ||
|
||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# Mac OSX | ||
echo "Error: As Kubeflow Model Registry wraps Google's MLMD and no source image for Mchips, this deployment is not supported. Using a temp docker-compose." | ||
rm "$SCRIPT_DIR/model-registry/config/ml-metadata/metadata.sqlite.db" || true | ||
docker compose -f "$SCRIPT_DIR/model-registry/docker-compose.yaml" up | ||
exit 0 | ||
fi | ||
|
||
kubectl create namespace kubeflow | ||
kubectl apply -k "https://github.com/kubeflow/model-registry/manifests/kustomize/overlays/db?ref=v0.2.4-alpha" | ||
|
||
sleep 1 | ||
kubectl get -n kubeflow deployments | ||
|
||
echo "Waiting for Deployment..." | ||
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=1m | ||
kubectl logs -n kubeflow deployment/model-registry-deployment | ||
echo "Deployment looks ready." | ||
|
||
echo "Starting port-forward..." | ||
kubectl port-forward svc/model-registry-service -n kubeflow 8081:8080 & | ||
PID=$! | ||
sleep 2 | ||
echo "I have launched port-forward in background with: $PID." |
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 @@ | ||
This is only for convenience of local development on Mac |
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,6 @@ | ||
connection_config { | ||
sqlite { | ||
filename_uri: '/tmp/shared/metadata.sqlite.db' | ||
connection_mode: READWRITE_OPENCREATE | ||
} | ||
} |
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,19 @@ | ||
version: '3' | ||
services: | ||
omlmd-integration-mlmd-server: | ||
image: gcr.io/tfx-oss-public/ml_metadata_store_server:1.14.0 | ||
container_name: omlmd-integration-mlmd-server | ||
ports: | ||
- "9090:8080" | ||
environment: | ||
- METADATA_STORE_SERVER_CONFIG_FILE=/tmp/shared/conn_config.pb | ||
volumes: | ||
- ./config/ml-metadata:/tmp/shared | ||
omlmd-integration-model-registry: | ||
image: docker.io/kubeflow/model-registry:latest | ||
command: ["proxy", "--hostname", "0.0.0.0", "--mlmd-hostname", "omlmd-integration-mlmd-server", "--mlmd-port", "8080"] | ||
container_name: omlmd-integration-model-registry | ||
ports: | ||
- "8081:8080" | ||
depends_on: | ||
- omlmd-integration-mlmd-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
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,27 @@ | ||
from __future__ import annotations | ||
from abc import ABC, abstractmethod | ||
from typing import Any | ||
from omlmd.model_metadata import ModelMetadata | ||
|
||
class Listener(ABC): | ||
""" | ||
TODO: not yet settled for multi-method or current single update method. | ||
""" | ||
@abstractmethod | ||
def update(self, source: Any, event: Event) -> None: | ||
""" | ||
Receive update event. | ||
""" | ||
pass | ||
|
||
|
||
class Event: | ||
pass | ||
|
||
|
||
class PushEvent(Event): | ||
def __init__(self, target: str, metadata: ModelMetadata): | ||
# TODO: cannot just receive yet the push sha, waiting for: https://github.com/oras-project/oras-py/pull/146 in a release. | ||
self.target = target | ||
self.metadata = metadata | ||
|
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
Oops, something went wrong.