Esempio n. 1
0
def health():
    mpijob_crd_version = resolve_mpijob_crd_version(api_context=True)
    return {
        "version": config.version,
        "namespace": config.namespace,
        "docker_registry": config.httpdb.builder.docker_registry,
        "remote_host": config.remote_host,
        "mpijob_crd_version": mpijob_crd_version,
        "ui_url": config.resolve_ui_url(),
        "ui_projects_prefix": config.ui.projects_prefix,
        "artifact_path": config.artifact_path,
        "spark_app_image": config.spark_app_image,
        "spark_app_image_tag": config.spark_app_image_tag,
    }
Esempio n. 2
0
 def get_client_spec(self):
     mpijob_crd_version = resolve_mpijob_crd_version(api_context=True)
     return mlrun.api.schemas.ClientSpec(
         version=config.version,
         namespace=config.namespace,
         docker_registry=config.httpdb.builder.docker_registry,
         remote_host=config.remote_host,
         mpijob_crd_version=mpijob_crd_version,
         ui_url=config.resolve_ui_url(),
         artifact_path=config.artifact_path,
         spark_app_image=config.spark_app_image,
         spark_app_image_tag=config.spark_app_image_tag,
         spark_history_server_path=config.spark_history_server_path,
         kfp_image=config.kfp_image,
         dask_kfp_image=config.dask_kfp_image,
         api_url=config.httpdb.api_url,
         nuclio_version=self._resolve_nuclio_version(),
         # These don't have a default value, but we don't send them if they are not set to allow the client to know
         # when to use server value and when to use client value (server only if set). Since their default value is
         # empty and not set is also empty we can use the same _get_config_value_if_not_default
         default_function_priority_class_name=self._get_config_value_if_not_default(
             "default_function_priority_class_name"
         ),
         valid_function_priority_class_names=self._get_config_value_if_not_default(
             "valid_function_priority_class_names"
         ),
         # These have a default value, therefore we want to send them only if their value is not the default one
         # (otherwise clients don't know when to use server value and when to use client value)
         ui_projects_prefix=self._get_config_value_if_not_default(
             "ui.projects_prefix"
         ),
         scrape_metrics=self._get_config_value_if_not_default("scrape_metrics"),
         hub_url=self._get_config_value_if_not_default("hub_url"),
         default_function_node_selector=self._get_config_value_if_not_default(
             "default_function_node_selector"
         ),
         igz_version=self._get_config_value_if_not_default("igz_version"),
         auto_mount_type=self._get_config_value_if_not_default(
             "storage.auto_mount_type"
         ),
         auto_mount_params=self._get_config_value_if_not_default(
             "storage.auto_mount_params"
         ),
         spark_operator_version=self._get_config_value_if_not_default(
             "spark_operator_version"
         ),
         default_tensorboard_logs_path=self._get_config_value_if_not_default(
             "default_tensorboard_logs_path"
         ),
     )
Esempio n. 3
0
    def _generate_context_link(context: mlrun.MLClientCtx,
                               link_text: str = "view in MLRun") -> str:
        """
        Generate a hyperlink from the provided context to view in the MLRun web.

        :param context:   The context to generate his link.
        :param link_text: Text to present instead of the link.

        :return: The generated link.
        """
        return '<a href="{}/{}/{}/jobs/monitor/{}/overview" target="_blank">{}</a>'.format(
            config.resolve_ui_url(),
            config.ui.projects_prefix,
            context.project,
            context.uid,
            link_text,
        )
Esempio n. 4
0
def health():
    mpijob_crd_version = resolve_mpijob_crd_version(api_context=True)
    return {
        "version":
        config.version,
        "namespace":
        config.namespace,
        "docker_registry":
        config.httpdb.builder.docker_registry,
        "remote_host":
        config.remote_host,
        "mpijob_crd_version":
        mpijob_crd_version,
        "ui_url":
        config.resolve_ui_url(),
        "artifact_path":
        config.artifact_path,
        "spark_app_image":
        config.spark_app_image,
        "spark_app_image_tag":
        config.spark_app_image_tag,
        "kfp_image":
        config.kfp_image,
        "dask_kfp_image":
        config.dask_kfp_image,
        "api_url":
        config.httpdb.api_url,
        # These have a default value, therefore we want to send them only if their value is not the default one
        # (otherwise clients don't know when to use server value and when to use client value)
        "ui_projects_prefix":
        _get_config_value_if_not_default("ui.projects_prefix"),
        "scrape_metrics":
        _get_config_value_if_not_default("scrape_metrics"),
        "hub_url":
        _get_config_value_if_not_default("hub_url"),
        "default_function_node_selector":
        _get_config_value_if_not_default("default_function_node_selector"),
    }