Skip to content

Commit

Permalink
feat: add config for ARGO_KEY_FORMAT envvar
Browse files Browse the repository at this point in the history
  • Loading branch information
NohaIhab committed Nov 27, 2024
1 parent a6398f3 commit ae20774
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions charms/kfp-ui/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ options:
type: boolean
default: true
description: Enable Argo log archive
argo-key-format:
type: string
# Must have the same value as the default of `keyformat` config in `argo-controller` charm.
default: "artifacts/{{workflow.name}}/{{workflow.creationTimestamp.Y}}/{{workflow.creationTimestamp.m}}/{{workflow.creationTimestamp.d}}/{{pod.name}}"
description: The keyFormat for pod logs artifacts stored
disable-gke-metadata:
type: boolean
default: true
Expand Down
1 change: 1 addition & 0 deletions charms/kfp-ui/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def __init__(self, *args):
inputs_getter=lambda: MlPipelineUiInputs(
ALLOW_CUSTOM_VISUALIZATIONS=self.model.config["allow-custom-visualizations"],
ARGO_ARCHIVE_LOGS=self.model.config["argo-archive-logs"],
ARGO_KEY_FORMAT=self.model.config["argo-key-format"],
DISABLE_GKE_METADATA=self.model.config["disable-gke-metadata"],
FRONTEND_SERVER_NAMESPACE=self.model.name,
HIDE_SIDENAV=self.model.config["hide-sidenav"],
Expand Down
6 changes: 2 additions & 4 deletions charms/kfp-ui/src/components/pebble_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class MlPipelineUiInputs:

ALLOW_CUSTOM_VISUALIZATIONS: bool
ARGO_ARCHIVE_LOGS: bool
ARGO_KEY_FORMAT: str
DISABLE_GKE_METADATA: bool
FRONTEND_SERVER_NAMESPACE: str
HIDE_SIDENAV: bool
Expand Down Expand Up @@ -54,10 +55,7 @@ def get_layer(self) -> Layer:
"ARGO_ARCHIVE_BUCKETNAME": "mlpipeline",
"ARGO_ARCHIVE_LOGS": inputs.ARGO_ARCHIVE_LOGS,
"ARGO_ARCHIVE_PREFIX": "logs",
# Must have the same value as the `keyFormat` specified in the
# `argo-workflow-controller-configmap` ConfigMap owned by
# the `argo-controller` charm.
"ARGO_KEYFORMAT": "artifacts/{{workflow.name}}/{{workflow.creationTimestamp.Y}}/{{workflow.creationTimestamp.m}}/{{workflow.creationTimestamp.d}}/{{pod.name}}", # noqa E501
"ARGO_KEYFORMAT": inputs.ARGO_KEY_FORMAT,
# TODO: This should come from relation to kfp-profile-controller.
# It is the name/port of the user-specific artifact accessor
"ARTIFACTS_SERVICE_PROXY_NAME": "ml-pipeline-ui-artifact",
Expand Down

0 comments on commit ae20774

Please sign in to comment.