From b6df5f8e31d2fb318df76bbae05083d0837944e9 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Tue, 9 Jul 2024 11:21:47 +0300 Subject: [PATCH] chore: integrate 2.2.0 rocks (#520) Closes canonical/pipelines-rocks#94 Closes canonical/pipelines-rocks#95 Closes canonical/pipelines-rocks#96 Closes canonical/pipelines-rocks#97 Closes canonical/pipelines-rocks#98 Closes canonical/pipelines-rocks#99 --- charms/kfp-api/metadata.yaml | 2 +- charms/kfp-api/src/charm.py | 1 + charms/kfp-api/tests/unit/test_operator.py | 1 + charms/kfp-metadata-writer/metadata.yaml | 2 +- charms/kfp-persistence/metadata.yaml | 2 +- charms/kfp-persistence/src/charm.py | 1 + .../src/components/pebble_components.py | 12 +++++++----- charms/kfp-schedwf/metadata.yaml | 2 +- charms/kfp-schedwf/src/charm.py | 2 +- .../kfp-schedwf/src/components/pebble_component.py | 6 ++++-- charms/kfp-viewer/metadata.yaml | 2 +- charms/kfp-viz/metadata.yaml | 2 +- 12 files changed, 21 insertions(+), 14 deletions(-) diff --git a/charms/kfp-api/metadata.yaml b/charms/kfp-api/metadata.yaml index 110e0ec6..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: gcr.io/ml-pipeline/api-server:2.2.0 + upstream-source: charmedkubeflow/api-server:2.2.0-4d2f32c requires: mysql: interface: mysql 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" 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}'" 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..19f87e2c 100644 --- a/charms/kfp-persistence/src/components/pebble_components.py +++ b/charms/kfp-persistence/src/components/pebble_components.py @@ -49,11 +49,13 @@ def get_layer(self) -> Layer: # setup command with parameters provided in configuration command = ( "persistence_agent", - "--logtostderr=true", - "--namespace=", - "--ttlSecondsAfterWorkflowFinish=86400", - "--numWorker=2", - f"--mlPipelineAPIServerName={service_config.KFP_API_SERVICE_NAME}", + " --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/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/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], ) diff --git a/charms/kfp-schedwf/src/components/pebble_component.py b/charms/kfp-schedwf/src/components/pebble_component.py index b59d7c77..d10bbe6b 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,9 @@ 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" + f" --namespace={self.namespace}" + f" --logLevel={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