Skip to content

Commit

Permalink
update kfp-api's apiserver configuration
Browse files Browse the repository at this point in the history
This:
* removes deprecated `DBCONFIG_USER`, etc, environment variables (they have been replaced by variables of name `DBCONFIG_[driver]CONFIG_*`)
* adds `OBJECTSTORECONFIG_HOST`, `_PORT`, and `_REGION`, which previously were required.  Although currently they seem to be ignored due to kubeflow/pipelines#9689 - but in theory they'll matter again?  Not sure exactly the scope of that issue.
  • Loading branch information
ca-scribner committed Nov 2, 2023
1 parent 464d701 commit 79a5b16
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions charms/kfp-api/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def _generate_environment(self) -> dict:
raise error

env_vars = {
# Configurations that are also defined in the upstream manifests
"AUTO_UPDATE_PIPELINE_DEFAULT_VERSION": self.model.config[
"auto-update-default-version"
],
Expand All @@ -231,11 +232,6 @@ def _generate_environment(self) -> dict:
"POD_NAMESPACE": self.model.name,
"OBJECTSTORECONFIG_SECURE": "false",
"OBJECTSTORECONFIG_BUCKETNAME": self.model.config["object-store-bucket-name"],
"DBCONFIG_USER": db_data["db_username"],
"DBCONFIG_PASSWORD": db_data["db_password"],
"DBCONFIG_DBNAME": db_data["db_name"],
"DBCONFIG_HOST": db_data["db_host"],
"DBCONFIG_PORT": db_data["db_port"],
"DBCONFIG_CONMAXLIFETIME": "120s",
"DB_DRIVER_NAME": "mysql",
"DBCONFIG_MYSQLCONFIG_USER": db_data["db_username"],
Expand All @@ -252,6 +248,17 @@ def _generate_environment(self) -> dict:
"ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST": viz_data["service-name"],
"ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT": viz_data["service-port"],
"CACHE_IMAGE": self.model.config["cache-image"],

# Configurations charmed-kubeflow adds to those of upstream
"ARCHIVE_CONFIG_LOG_FILE_NAME": self.model.config["log-archive-filename"],
"ARCHIVE_CONFIG_LOG_PATH_PREFIX": self.model.config["log-archive-prefix"],
# OBJECTSTORECONFIG_HOST and _PORT currently have no effect due to
# https://github.com/kubeflow/pipelines/issues/9689, described more in
# https://github.com/canonical/minio-operator/pull/151
# They're included here so that when the upstream issue is fixed we don't break
"OBJECTSTORECONFIG_HOST": f"{object_storage['service']}.{object_storage['namespace']}",
"OBJECTSTORECONFIG_PORT": str(object_storage["port"]),
"OBJECTSTORECONFIG_REGION": "",
}

return env_vars
Expand Down

0 comments on commit 79a5b16

Please sign in to comment.