-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
34 lines (24 loc) · 1 KB
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""Tasks of the project."""
# %% IMPORTS
from invoke import task
from invoke.context import Context
# %% CONFIGS
KFP_VERSION = "2.0.0b13"
KFP_PLATFORM = "platform-agnostic-emissary"
# %% TASKS
@task
def install(c: Context) -> None:
"""Install the project."""
c.run("poetry install")
@task
def apply(c: Context, platform: str = KFP_PLATFORM, version: str = KFP_VERSION) -> None:
"""Apply Kubeflow manifests."""
c.run(f'kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref={version}"')
c.run('kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io')
c.run(f'kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/env/{platform}?ref={version}"')
print('Press CTRL+C to stop watching the pods.')
c.run('kubectl get pods -n kubeflow --watch')
@task
def serve(c, port: int = 8443) -> None:
"""Serve Kubeflow Pipelines UI."""
c.run(f'kubectl port-forward -n kubeflow svc/ml-pipeline-ui {port}:80')