Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: test python client connection #91

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions .github/workflows/build-image-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Test container image build and deployment
on:
pull_request:
paths-ignore:
- 'LICENSE*'
- '**.gitignore'
- '**.md'
- '**.txt'
- '.github/ISSUE_TEMPLATE/**'
- '.github/dependabot.yml'
- 'docs/**'
- 'clients/python/**'
- "LICENSE*"
- "**.gitignore"
- "**.md"
- "**.txt"
- ".github/ISSUE_TEMPLATE/**"
- ".github/dependabot.yml"
- "docs/**"
- "clients/python/docs/**"
env:
IMG_ORG: kubeflow
IMG_REPO: model-registry
Expand Down Expand Up @@ -61,3 +61,25 @@ jobs:
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-db --timeout=5m
kubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=5m
kubectl logs -n kubeflow deployment/model-registry-deployment
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
poetry --version
- name: Build package
working-directory: clients/python
run: |
poetry build --ansi
pip install dist/*.whl
- name: Connect with Python client
run: |
kubectl port-forward -n kubeflow service/model-registry-service 9090:9090 &
sleep 5
python test/python/test_mr_conn.py localhost 9090
176 changes: 0 additions & 176 deletions test/python/test_mlmetadata.py

This file was deleted.

29 changes: 29 additions & 0 deletions test/python/test_mr_conn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from model_registry import ModelRegistry


def main(server: str, port: int):
mr = ModelRegistry(server, port, author="test", is_secure=False)

model = mr.register_model(
"my-model",
"https://mybucket.uri/",
version="2.0.0",
model_format_name="onnx",
model_format_version="1",
storage_key="my-data-connection",
storage_path="path/to/model",
metadata={
"day": 1,
"split": "train",
},
)

m = mr.get_registered_model("my-model")
assert m
assert model.id == m.id, f"{model} != {m}"


if __name__ == "__main__":
import sys

main(sys.argv[1], int(sys.argv[2]))
Loading