MAIA.maia_admin module#

MAIA.maia_admin.create_harbor_values(config_folder, project_id, cluster_config_dict)[source]#

Create and save Harbor values configuration for a given project and cluster configuration.

Parameters:
  • config_folder (str) – The path to the configuration folder where the Harbor values file will be saved.

  • project_id (str) – The unique identifier for the project.

  • cluster_config_dict (dict) –

    A dictionary containing cluster configuration details, including:
    • domain (str): The domain name for the Harbor registry.

    • ingress_class (str): The ingress class to be used (e.g., “maia-core-traefik”, “nginx”).

    • traefik_resolver (str, optional): The Traefik resolver to be used if ingress_class is “maia-core-traefik”.

Returns:

dict – A dictionary containing the following keys: - namespace (str): The Kubernetes namespace for Harbor. - release (str): The release name for the Harbor Helm chart. - chart (str): The name of the Harbor Helm chart. - repo (str): The URL of the Harbor Helm chart repository. - version (str): The version of the Harbor Helm chart. - values (str): The path to the generated Harbor values YAML file.

MAIA.maia_admin.create_keycloak_values(config_folder, project_id, cluster_config_dict)[source]#

Generates Keycloak Helm chart values and writes them to a YAML file.

Parameters:
  • config_folder (str) – The path to the configuration folder where the YAML file will be saved.

  • project_id (str) – The project identifier used to create a unique namespace and release name.

  • cluster_config_dict (dict) – A dictionary containing cluster configuration details such as domain, ingress class, and traefik resolver.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values YAML file.

MAIA.maia_admin.create_loginapp_values(config_folder, project_id, cluster_config_dict)[source]#

Creates and writes the loginapp values configuration file for a given project and cluster configuration.

Parameters:
  • config_folder (str) – The base directory where the configuration files will be stored.

  • project_id (str) – The unique identifier for the project.

  • cluster_config_dict (dict) –

    A dictionary containing cluster configuration details, including:
    • keycloak_maia_client_secret (str): The client secret for Keycloak.

    • domain (str): The domain name for the cluster.

    • ingress_class (str): The ingress class to be used (e.g., “maia-core-traefik” or “nginx”).

    • traefik_resolver (str, optional): The Traefik resolver to be used if ingress_class is “maia-core-traefik”.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values file.

Raises:
  • KeyError – If required keys are missing from the cluster_config_dict.

  • OSError – If there is an error creating directories or writing the configuration file.

MAIA.maia_admin.create_maia_admin_toolkit_values(config_folder, project_id, cluster_config_dict, maia_config_dict)[source]#

Creates and writes the MAIA admin toolkit values to a YAML file.

Parameters:
  • config_folder (str) – The path to the configuration folder.

  • project_id (str) – The project identifier.

  • cluster_config_dict (dict) – Dictionary containing cluster configuration values.

  • maia_config_dict (dict) – Dictionary containing MAIA configuration values.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values YAML file.

MAIA.maia_admin.create_maia_dashboard_values(config_folder, project_id, cluster_config_dict, maia_config_dict)[source]#

Create MAIA dashboard values for Helm chart deployment.

Parameters:
  • config_folder (str) – The path to the configuration folder.

  • project_id (str) – The project identifier.

  • cluster_config_dict (dict) – Dictionary containing cluster configuration details.

  • maia_config_dict (dict) – Dictionary containing MAIA configuration details.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values YAML file.

MAIA.maia_admin.create_maia_namespace_values(namespace_config, cluster_config, config_folder, minio_configs=None, mlflow_configs=None)[source]#

Create MAIA namespace values for deployment.

Parameters:
  • namespace_config (dict) – Configuration for the namespace, including group ID and users.

  • cluster_config (dict) – Configuration for the cluster, including SSH port type, port range, and storage class.

  • config_folder (str) – Path to the folder where configuration files will be saved.

  • minio_configs (dict, optional) – Configuration for MinIO, including access keys and console keys. Defaults to None.

  • mlflow_configs (dict, optional) – Configuration for MLflow, including user and password. Defaults to None.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values file.

MAIA.maia_admin.create_minio_operator_values(config_folder, project_id, cluster_config_dict)[source]#

Creates and writes MinIO operator values to a YAML file and returns a dictionary with deployment details.

Parameters:
  • config_folder (str) – The path to the configuration folder.

  • project_id (str) – The unique identifier for the project.

  • cluster_config_dict (dict) – A dictionary containing cluster configuration details.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated YAML values file.

MAIA.maia_admin.generate_minio_configs()[source]#

Generate configuration settings for MinIO.

Returns:

dict – A dictionary with the following keys: - access_key (str): The access key for MinIO. - secret_key (str): A randomly generated secret key for MinIO. - console_access_key (str): A base64 encoded access key for console access. - console_secret_key (str): A base64 encoded secret key for console access.

MAIA.maia_admin.generate_mlfow_configs(namespace)[source]#

Generate MLflow configuration dictionary with encoded user and password.

Parameters:

namespace (str) – The namespace to be encoded as the MLflow user.

Returns:

dict – A dictionary containing the encoded MLflow user and password.

MAIA.maia_admin.generate_mysql_configs(namespace)[source]#

Generate MySQL configuration dictionary.

Parameters:

namespace (str) – The namespace to be used as the MySQL user.

Returns:

dict – A dictionary containing MySQL user and password.

async MAIA.maia_admin.get_maia_toolkit_apps(group_id, token, argo_cd_host)[source]#

Retrieve and print information about a specific project and its associated applications from Argo CD.

Parameters:
  • group_id (str) – The group identifier used to construct project and application names.

  • token (str) – The authorization token for accessing the Argo CD API.

  • argo_cd_host (str) – The host URL of the Argo CD server.

Returns:

None

Raises:

ApiException – If there is an error when calling the Argo CD API.

async MAIA.maia_admin.install_maia_project(group_id, values_file, argo_cd_namespace, project_chart, project_repo=None, project_version=None)[source]#

Installs or upgrades a MAIA project using the specified Helm chart and values file.

Parameters:
  • group_id (str) – The group ID for the project. This will be used as the release name.

  • values_file (str) – Path to the YAML file containing the values for the Helm chart.

  • argo_cd_namespace (str) – The namespace in which to install the project.

  • project_chart (str) – The name of the Helm chart to use for the project.

  • project_repo (str, optional) – The repository URL where the Helm chart is located. Defaults to None.

  • project_version (str, optional) – The version of the Helm chart to use. Defaults to None.

Returns:

None

Raises:
  • FileNotFoundError – If the values file does not exist.

  • yaml.YAMLError – If there is an error parsing the values file.

  • Exception – If there is an error during the installation or upgrade process.

Example

await install_maia_project(

group_id=”example_group”, values_file=”/path/to/values.yaml”, argo_cd_namespace=”default”, project_chart=”example_chart”, project_repo=”https://example.com/charts”, project_version=”1.0.0”

)