From 91f74a3661a7d6ce7ef7dc7ca4f22f726f18b21a Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Thu, 20 Jun 2024 12:28:31 +0300 Subject: [PATCH 1/7] chore: integrate 2.2.0 rocks --- charms/kfp-api/metadata.yaml | 2 +- charms/kfp-metadata-writer/metadata.yaml | 2 +- charms/kfp-persistence/metadata.yaml | 2 +- charms/kfp-persistence/src/charm.py | 1 + charms/kfp-persistence/src/components/pebble_components.py | 6 ++++-- charms/kfp-schedwf/metadata.yaml | 2 +- charms/kfp-schedwf/src/components/pebble_component.py | 4 ++-- charms/kfp-viewer/metadata.yaml | 2 +- charms/kfp-viz/metadata.yaml | 2 +- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/charms/kfp-api/metadata.yaml b/charms/kfp-api/metadata.yaml index 110e0ec6..392d5329 100755 --- a/charms/kfp-api/metadata.yaml +++ b/charms/kfp-api/metadata.yaml @@ -15,7 +15,7 @@ resources: oci-image: type: oci-image description: Backing OCI image - upstream-source: gcr.io/ml-pipeline/api-server:2.2.0 + upstream-source: charmedkubeflow/api-server:2.2.0-test requires: mysql: interface: mysql diff --git a/charms/kfp-metadata-writer/metadata.yaml b/charms/kfp-metadata-writer/metadata.yaml index 516b6ae4..fbc16018 100755 --- a/charms/kfp-metadata-writer/metadata.yaml +++ b/charms/kfp-metadata-writer/metadata.yaml @@ -13,7 +13,7 @@ resources: oci-image: type: oci-image description: OCI image for KFP Metadata Writer - upstream-source: gcr.io/ml-pipeline/metadata-writer:2.2.0 + upstream-source: charmedkubeflow/metadata-writer:2.2.0-cff3205 requires: grpc: interface: k8s-service diff --git a/charms/kfp-persistence/metadata.yaml b/charms/kfp-persistence/metadata.yaml index 155ac9c4..eea518da 100755 --- a/charms/kfp-persistence/metadata.yaml +++ b/charms/kfp-persistence/metadata.yaml @@ -11,7 +11,7 @@ resources: oci-image: type: oci-image description: Backing OCI image - upstream-source: gcr.io/ml-pipeline/persistenceagent:2.2.0 + upstream-source: charmedkubeflow/persistenceagent:2.2.0-8af6d3c requires: kfp-api: interface: k8s-service diff --git a/charms/kfp-persistence/src/charm.py b/charms/kfp-persistence/src/charm.py index a6961ba9..f03ce6e1 100755 --- a/charms/kfp-persistence/src/charm.py +++ b/charms/kfp-persistence/src/charm.py @@ -115,6 +115,7 @@ def __init__(self, *args, **kwargs): "NAMESPACE": "", "TTL_SECONDS_AFTER_WORKFLOW_FINISH": "86400", "NUM_WORKERS": "2", + "EXECUTIONTYPE": "Workflow", }, # provide function to pebble with which it can get service configuration from # relation diff --git a/charms/kfp-persistence/src/components/pebble_components.py b/charms/kfp-persistence/src/components/pebble_components.py index b295b07c..a21fc0e7 100644 --- a/charms/kfp-persistence/src/components/pebble_components.py +++ b/charms/kfp-persistence/src/components/pebble_components.py @@ -51,9 +51,11 @@ def get_layer(self) -> Layer: "persistence_agent", "--logtostderr=true", "--namespace=", - "--ttlSecondsAfterWorkflowFinish=86400", - "--numWorker=2", + f"--ttlSecondsAfterWorkflowFinish={self._environment["TTL_SECONDS_AFTER_WORKFLOW_FINISH"]}", + f"--numWorker={self._environment["NUM_WORKERS"]}", f"--mlPipelineAPIServerName={service_config.KFP_API_SERVICE_NAME}", + f"--executionType {self._environment["EXECUTIONTYPE"]}", + f"--logLevel={self._environment["LOG_LEVEL"]}" ) # generate and return layer diff --git a/charms/kfp-schedwf/metadata.yaml b/charms/kfp-schedwf/metadata.yaml index eb55bb93..336abf26 100755 --- a/charms/kfp-schedwf/metadata.yaml +++ b/charms/kfp-schedwf/metadata.yaml @@ -11,7 +11,7 @@ resources: oci-image: type: oci-image description: Backing OCI image - upstream-source: gcr.io/ml-pipeline/scheduledworkflow:2.2.0 + upstream-source: charmedkubeflow/scheduledworkflow:2.2.0-517f00c requires: logging: interface: loki_push_api diff --git a/charms/kfp-schedwf/src/components/pebble_component.py b/charms/kfp-schedwf/src/components/pebble_component.py index b59d7c77..9a9b65bc 100644 --- a/charms/kfp-schedwf/src/components/pebble_component.py +++ b/charms/kfp-schedwf/src/components/pebble_component.py @@ -24,6 +24,7 @@ def __init__( "LOG_LEVEL": log_level, } self.namespace = namespace + self.log_level = log_level def get_layer(self) -> Layer: """Defines and returns Pebble layer configuration @@ -45,8 +46,7 @@ def get_layer(self) -> Layer: "override": "replace", "summary": "scheduled workflow controller service", "startup": "enabled", - "command": "/bin/controller --logtostderr=true" - " --namespace={self.namespace}", + "command": f"/bin/controller --logtostderr=true --namespace={self.namespace} --loglever={self.log_level}", "environment": self.environment, } }, diff --git a/charms/kfp-viewer/metadata.yaml b/charms/kfp-viewer/metadata.yaml index 80f38b80..f2174a15 100755 --- a/charms/kfp-viewer/metadata.yaml +++ b/charms/kfp-viewer/metadata.yaml @@ -12,7 +12,7 @@ resources: kfp-viewer-image: type: oci-image description: OCI image for KFP Viewer - upstream-source: gcr.io/ml-pipeline/viewer-crd-controller:2.2.0 + upstream-source: charmedkubeflow/viewer-crd-controller:2.2.0-aaa1d41 requires: logging: interface: loki_push_api diff --git a/charms/kfp-viz/metadata.yaml b/charms/kfp-viz/metadata.yaml index b516521e..c2208ee8 100755 --- a/charms/kfp-viz/metadata.yaml +++ b/charms/kfp-viz/metadata.yaml @@ -11,7 +11,7 @@ resources: oci-image: type: oci-image description: OCI image for ml-pipeline-visualizationserver - upstream-source: gcr.io/ml-pipeline/visualization-server:2.2.0 + upstream-source: charmedkubeflow/visualization-server:2.2.0-d65cd0c provides: kfp-viz: interface: k8s-service From 0b92c41f833adc5ffb8e10b6c1ede67c0aaf76c7 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Thu, 20 Jun 2024 12:47:20 +0300 Subject: [PATCH 2/7] fix --- .../src/components/pebble_components.py | 14 +++++++------- .../kfp-schedwf/src/components/pebble_component.py | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/charms/kfp-persistence/src/components/pebble_components.py b/charms/kfp-persistence/src/components/pebble_components.py index a21fc0e7..19f87e2c 100644 --- a/charms/kfp-persistence/src/components/pebble_components.py +++ b/charms/kfp-persistence/src/components/pebble_components.py @@ -49,13 +49,13 @@ def get_layer(self) -> Layer: # setup command with parameters provided in configuration command = ( "persistence_agent", - "--logtostderr=true", - "--namespace=", - f"--ttlSecondsAfterWorkflowFinish={self._environment["TTL_SECONDS_AFTER_WORKFLOW_FINISH"]}", - f"--numWorker={self._environment["NUM_WORKERS"]}", - f"--mlPipelineAPIServerName={service_config.KFP_API_SERVICE_NAME}", - f"--executionType {self._environment["EXECUTIONTYPE"]}", - f"--logLevel={self._environment["LOG_LEVEL"]}" + " --logtostderr=true", + " --namespace=", + f" --ttlSecondsAfterWorkflowFinish={self._environment['TTL_SECONDS_AFTER_WORKFLOW_FINISH']}", # noqa: 501 + f" --numWorker={self._environment['NUM_WORKERS']}", + f" --mlPipelineAPIServerName={service_config.KFP_API_SERVICE_NAME}", + f" --executionType {self._environment['EXECUTIONTYPE']}", + f" --logLevel={self._environment['LOG_LEVEL']}", ) # generate and return layer diff --git a/charms/kfp-schedwf/src/components/pebble_component.py b/charms/kfp-schedwf/src/components/pebble_component.py index 9a9b65bc..46c32dc2 100644 --- a/charms/kfp-schedwf/src/components/pebble_component.py +++ b/charms/kfp-schedwf/src/components/pebble_component.py @@ -46,7 +46,9 @@ def get_layer(self) -> Layer: "override": "replace", "summary": "scheduled workflow controller service", "startup": "enabled", - "command": f"/bin/controller --logtostderr=true --namespace={self.namespace} --loglever={self.log_level}", + "command": f"/bin/controller --logtostderr=true" + f" --namespace={self.namespace}" + f" --loglever={self.log_level}", "environment": self.environment, } }, From 294dbe74815528a193b307b6a339c8921d5b7989 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Thu, 20 Jun 2024 13:30:15 +0300 Subject: [PATCH 3/7] fix --- charms/kfp-schedwf/src/components/pebble_component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charms/kfp-schedwf/src/components/pebble_component.py b/charms/kfp-schedwf/src/components/pebble_component.py index 46c32dc2..d10bbe6b 100644 --- a/charms/kfp-schedwf/src/components/pebble_component.py +++ b/charms/kfp-schedwf/src/components/pebble_component.py @@ -48,7 +48,7 @@ def get_layer(self) -> Layer: "startup": "enabled", "command": f"/bin/controller --logtostderr=true" f" --namespace={self.namespace}" - f" --loglever={self.log_level}", + f" --logLevel={self.log_level}", "environment": self.environment, } }, From 28ad37af971d62d7c68dd1ac1dcfc70717cbb668 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Fri, 21 Jun 2024 11:44:36 +0300 Subject: [PATCH 4/7] update --- charms/kfp-api/src/charm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/charms/kfp-api/src/charm.py b/charms/kfp-api/src/charm.py index 13532970..0d5bd2fc 100755 --- a/charms/kfp-api/src/charm.py +++ b/charms/kfp-api/src/charm.py @@ -74,6 +74,7 @@ def __init__(self, *args): f"--config={CONFIG_DIR} " f"--sampleconfig={SAMPLE_CONFIG} " "-logtostderr=true " + f"--logLevel={self.model.config['log-level']}" ) self._container_name = "apiserver" self._database_name = "mlpipeline" From 733152eb884142cf7050cfbf46ce7024c49394de Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Tue, 25 Jun 2024 16:47:24 +0300 Subject: [PATCH 5/7] api-server: update image --- charms/kfp-api/metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charms/kfp-api/metadata.yaml b/charms/kfp-api/metadata.yaml index 392d5329..bd394b0c 100755 --- a/charms/kfp-api/metadata.yaml +++ b/charms/kfp-api/metadata.yaml @@ -15,7 +15,7 @@ resources: oci-image: type: oci-image description: Backing OCI image - upstream-source: charmedkubeflow/api-server:2.2.0-test + upstream-source: charmedkubeflow/api-server:2.2.0-4d2f32c requires: mysql: interface: mysql From c99d9c69ba9d943d0dc77ce31695d4ae84b449d6 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Tue, 25 Jun 2024 16:51:35 +0300 Subject: [PATCH 6/7] fix --- charms/kfp-api/tests/unit/test_operator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/charms/kfp-api/tests/unit/test_operator.py b/charms/kfp-api/tests/unit/test_operator.py index 6015e2fb..a43d3aca 100644 --- a/charms/kfp-api/tests/unit/test_operator.py +++ b/charms/kfp-api/tests/unit/test_operator.py @@ -407,6 +407,7 @@ def test_install_with_all_inputs_and_pebble( "--config=/config " "--sampleconfig=/config/sample_config.json " "-logtostderr=true " + f"--logLevel={harness.charm.config['log-level']}" ) assert pebble_exec_command == f"bash -c '{exec_command}'" From 820db29883d5063a21d7da83b9207e07272195b0 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Mon, 8 Jul 2024 12:36:49 +0300 Subject: [PATCH 7/7] review: Fix schedwf namespace --- charms/kfp-schedwf/src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charms/kfp-schedwf/src/charm.py b/charms/kfp-schedwf/src/charm.py index 94c0f163..188577f2 100755 --- a/charms/kfp-schedwf/src/charm.py +++ b/charms/kfp-schedwf/src/charm.py @@ -75,7 +75,7 @@ def __init__(self, *args): service_name="controller", timezone=self.model.config["timezone"], log_level=self.model.config["log-level"], - namespace=self.model.name, + namespace="", ), depends_on=[self.kubernetes_resources], )