Skip to content

Commit

Permalink
wip: add k8s deps to python sdk setup
Browse files Browse the repository at this point in the history
  • Loading branch information
a9p committed Jun 5, 2023
1 parent 065aee5 commit decd414
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/python/v1beta1/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist/

# Katib gRPC APIs
kubeflow/katib/katib_api_pb2.py
kubeflow/katib/k8s
6 changes: 6 additions & 0 deletions sdk/python/v1beta1/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@
]

katib_grpc_api_file = "../../../pkg/apis/manager/v1beta1/python/api_pb2.py"
katib_grpc_api_k8s_dep = "../../../pkg/apis/manager/v1beta1/python/k8s"

# Copy Katib gRPC Python APIs to use it in the Katib SDK Client.
# We need to always copy this file only on the SDK building stage, not on SDK installation stage.
if os.path.exists(katib_grpc_api_file):
shutil.copy(
katib_grpc_api_file, "kubeflow/katib/katib_api_pb2.py",
)
# The k8s path should exist if the api file exists (in a <py3.8 compliant way)
shutil.rmtree("kubeflow/katib/k8s", ignore_errors=True)
shutil.copytree(
katib_grpc_api_k8s_dep, "kubeflow/katib/k8s",
)

setuptools.setup(
name="kubeflow-katib",
Expand Down

0 comments on commit decd414

Please sign in to comment.