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 00a95053..577f551b 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"], FRONTEND_SERVER_NAMESPACE=self.model.name, HIDE_SIDENAV=self.model.config["hide-sidenav"], MINIO_ACCESS_KEY=self.object_storage_relation.component.get_data()[ diff --git a/charms/kfp-ui/src/components/pebble_components.py b/charms/kfp-ui/src/components/pebble_components.py index 99c982fc..5a22fed1 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 FRONTEND_SERVER_NAMESPACE: str HIDE_SIDENAV: bool MINIO_ACCESS_KEY: str @@ -50,8 +52,17 @@ def get_layer(self) -> Layer: ).lower(), "ARGO_ARCHIVE_ARTIFACTORY": "minio", "ARGO_ARCHIVE_BUCKETNAME": "mlpipeline", - "ARGO_ARCHIVE_LOGS": "false", - "ARGO_ARCHIVE_PREFIX": "logs", + "ARGO_ARCHIVE_LOGS": inputs.ARGO_ARCHIVE_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}}" + ), # 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", @@ -59,7 +70,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", "FRONTEND_SERVER_NAMESPACE": inputs.FRONTEND_SERVER_NAMESPACE,