From cecec4c31f9ab9cdd416da63e1a7662e992e9561 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 19 Nov 2024 15:49:56 +0200 Subject: [PATCH 1/8] feat: add envs to ensure kfp-ui can show logs --- charms/kfp-ui/config.yaml | 8 ++++++++ charms/kfp-ui/src/charm.py | 2 ++ charms/kfp-ui/src/components/pebble_components.py | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/charms/kfp-ui/config.yaml b/charms/kfp-ui/config.yaml index 95551fe6..e439f866 100644 --- a/charms/kfp-ui/config.yaml +++ b/charms/kfp-ui/config.yaml @@ -7,6 +7,14 @@ options: type: boolean default: true description: Allow custom visualizations + argo-archive-logs: + type: boolean + default: true + description: Enable Argo log archive + disable-gke-metadata: + type: boolean + default: true + description: Disable GKE metadata endpoint hide-sidenav: type: boolean default: true diff --git a/charms/kfp-ui/src/charm.py b/charms/kfp-ui/src/charm.py index 85462dab..82f2db34 100755 --- a/charms/kfp-ui/src/charm.py +++ b/charms/kfp-ui/src/charm.py @@ -219,6 +219,8 @@ 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"], + DISABLE_GKE_METADATA=self.model.config["disable-gke-metadata"], HIDE_SIDENAV=self.model.config["hide-sidenav"], MINIO_ACCESS_KEY=self.object_storage_relation.component.get_data()[ "access-key" diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index 34faa377..c0ae0279 100644 --- a/charms/kfp-ui/src/components/pebble_components.py +++ b/charms/kfp-ui/src/components/pebble_components.py @@ -12,6 +12,8 @@ class MlPipelineUiInputs: """Defines the required inputs for MlPipelineUiPebbleService.""" ALLOW_CUSTOM_VISUALIZATIONS: bool + ARGO_ARCHIVE_LOGS: bool + DISABLE_GKE_METADATA: bool HIDE_SIDENAV: bool MINIO_ACCESS_KEY: str MINIO_SECRET_KEY: str @@ -49,7 +51,7 @@ def get_layer(self) -> Layer: ).lower(), "ARGO_ARCHIVE_ARTIFACTORY": "minio", "ARGO_ARCHIVE_BUCKETNAME": "mlpipeline", - "ARGO_ARCHIVE_LOGS": "false", + "ARGO_ARCHIVE_LOGS": inputs.ARGO_ARCHIVE_LOGS, "ARGO_ARCHIVE_PREFIX": "logs", # TODO: This should come from relation to kfp-profile-controller. # It is the name/port of the user-specific artifact accessor @@ -58,7 +60,7 @@ def get_layer(self) -> Layer: "ARTIFACTS_SERVICE_PROXY_ENABLED": "true", "AWS_ACCESS_KEY_ID": "", "AWS_SECRET_ACCESS_KEY": "", - "DISABLE_GKE_METADATA": "false", + "DISABLE_GKE_METADATA": inputs.DISABLE_GKE_METADATA, "ENABLE_AUTHZ": "true", "DEPLOYMENT": "KUBEFLOW", "HIDE_SIDENAV": str(inputs.HIDE_SIDENAV).lower(), From e8912b5815877fedbde16228fcbb10c34088e080 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Mon, 25 Nov 2024 13:57:20 +0200 Subject: [PATCH 2/8] fix: set ARGO_KEYFORMAT env --- charms/kfp-ui/src/components/pebble_components.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index eb47ae9e..fab64d28 100644 --- a/charms/kfp-ui/src/components/pebble_components.py +++ b/charms/kfp-ui/src/components/pebble_components.py @@ -54,6 +54,10 @@ 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 # 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", From ae207749de1ec486cd94b90ad3a4bbd9557222a9 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Wed, 27 Nov 2024 10:44:25 +0200 Subject: [PATCH 3/8] feat: add config for ARGO_KEY_FORMAT envvar --- charms/kfp-ui/config.yaml | 5 +++++ charms/kfp-ui/src/charm.py | 1 + charms/kfp-ui/src/components/pebble_components.py | 6 ++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/charms/kfp-ui/config.yaml b/charms/kfp-ui/config.yaml index e439f866..e5658a35 100644 --- a/charms/kfp-ui/config.yaml +++ b/charms/kfp-ui/config.yaml @@ -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 diff --git a/charms/kfp-ui/src/charm.py b/charms/kfp-ui/src/charm.py index 577f551b..876b63f4 100755 --- a/charms/kfp-ui/src/charm.py +++ b/charms/kfp-ui/src/charm.py @@ -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"], diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index fab64d28..8d3c1a1c 100644 --- a/charms/kfp-ui/src/components/pebble_components.py +++ b/charms/kfp-ui/src/components/pebble_components.py @@ -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 @@ -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", From bfdb3e3b4b301725f9744854884e70e41014c2e7 Mon Sep 17 00:00:00 2001 From: Noha Ihab <49988746+NohaIhab@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:48:24 +0200 Subject: [PATCH 4/8] skip: comment --- charms/kfp-ui/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charms/kfp-ui/config.yaml b/charms/kfp-ui/config.yaml index e5658a35..65af360c 100644 --- a/charms/kfp-ui/config.yaml +++ b/charms/kfp-ui/config.yaml @@ -13,7 +13,7 @@ options: 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. + # Must have the same value as the default of `key-format` 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: From 8f353e571f42e5a9514e73e67ce6a39326215f7f Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Thu, 28 Nov 2024 16:52:08 +0200 Subject: [PATCH 5/8] Revert "skip: comment" This reverts commit bfdb3e3b4b301725f9744854884e70e41014c2e7. --- charms/kfp-ui/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charms/kfp-ui/config.yaml b/charms/kfp-ui/config.yaml index 65af360c..e5658a35 100644 --- a/charms/kfp-ui/config.yaml +++ b/charms/kfp-ui/config.yaml @@ -13,7 +13,7 @@ options: description: Enable Argo log archive argo-key-format: type: string - # Must have the same value as the default of `key-format` config in `argo-controller` charm. + # 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: From b375e71048f6baa14baa191ca60dcb1c770d23a0 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Thu, 28 Nov 2024 16:52:29 +0200 Subject: [PATCH 6/8] Revert "feat: add config for ARGO_KEY_FORMAT envvar" This reverts commit ae207749de1ec486cd94b90ad3a4bbd9557222a9. --- charms/kfp-ui/config.yaml | 5 ----- charms/kfp-ui/src/charm.py | 1 - charms/kfp-ui/src/components/pebble_components.py | 6 ++++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/charms/kfp-ui/config.yaml b/charms/kfp-ui/config.yaml index e5658a35..e439f866 100644 --- a/charms/kfp-ui/config.yaml +++ b/charms/kfp-ui/config.yaml @@ -11,11 +11,6 @@ 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 diff --git a/charms/kfp-ui/src/charm.py b/charms/kfp-ui/src/charm.py index 876b63f4..577f551b 100755 --- a/charms/kfp-ui/src/charm.py +++ b/charms/kfp-ui/src/charm.py @@ -220,7 +220,6 @@ 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"], diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index 8d3c1a1c..fab64d28 100644 --- a/charms/kfp-ui/src/components/pebble_components.py +++ b/charms/kfp-ui/src/components/pebble_components.py @@ -13,7 +13,6 @@ 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 @@ -55,7 +54,10 @@ def get_layer(self) -> Layer: "ARGO_ARCHIVE_BUCKETNAME": "mlpipeline", "ARGO_ARCHIVE_LOGS": inputs.ARGO_ARCHIVE_LOGS, "ARGO_ARCHIVE_PREFIX": "logs", - "ARGO_KEYFORMAT": inputs.ARGO_KEY_FORMAT, + # 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 # 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", From e5b3df89e00dc88d6286ecb3290f52c87ea011b5 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Thu, 28 Nov 2024 16:59:32 +0200 Subject: [PATCH 7/8] fix: remove ARGO_ARCHIVE_PREFIX env --- charms/kfp-ui/src/components/pebble_components.py | 1 - 1 file changed, 1 deletion(-) diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index fab64d28..d5063244 100644 --- a/charms/kfp-ui/src/components/pebble_components.py +++ b/charms/kfp-ui/src/components/pebble_components.py @@ -53,7 +53,6 @@ def get_layer(self) -> Layer: "ARGO_ARCHIVE_ARTIFACTORY": "minio", "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. From 38eb1cf74861894469c43d7ee7bd5d6ba6cf25a6 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Fri, 29 Nov 2024 13:22:02 +0200 Subject: [PATCH 8/8] skip: multi-line string to avoid noqa --- charms/kfp-ui/src/components/pebble_components.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index d5063244..5a22fed1 100644 --- a/charms/kfp-ui/src/components/pebble_components.py +++ b/charms/kfp-ui/src/components/pebble_components.py @@ -56,7 +56,13 @@ def get_layer(self) -> Layer: # 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": ( + "artifacts/{{workflow.name}}/" + "{{workflow.creationTimestamp.Y}}/" + "{{workflow.creationTimestamp.m}}/" + "{{workflow.creationTimestamp.d}}/" + "{{pod.name}}" + ), # 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",