Ejemplo n.º 1
0
def convert(
    owner_name: str,
    project_name: str,
    run_name: str,
    run_uuid: str,
    content: str,
    default_auth: bool,
) -> Dict:
    polypod_config = PolypodConfig()
    compiled_operation = CompiledOperationSpecification.read(content)

    polypod_config.resolve(compiled_operation=compiled_operation)
    return converter.convert(
        compiled_operation=compiled_operation,
        owner_name=owner_name,
        project_name=project_name,
        run_name=run_name,
        run_uuid=run_uuid,
        namespace=polypod_config.namespace,
        polyaxon_init=polypod_config.polyaxon_init,
        polyaxon_sidecar=polypod_config.polyaxon_sidecar,
        run_path=run_uuid,
        artifacts_store=polypod_config.artifacts_store,
        connection_by_names=polypod_config.connection_by_names,
        secrets=polypod_config.secrets,
        config_maps=polypod_config.config_maps,
        default_sa=polypod_config.default_sa,
        converters=PLATFORM_CONVERTERS,
        default_auth=default_auth,
    )
Ejemplo n.º 2
0
def make(
    owner_name: str,
    project_name: str,
    project_uuid: str,
    run_name: str,
    run_uuid: str,
    run_path: str,
    compiled_operation: V1CompiledOperation,
    params: Optional[Dict],
    default_sa: str = None,
    internal_auth: bool = False,
    default_auth: bool = False,
    converters: Dict[str, Any] = converter.CORE_CONVERTERS,
):
    resolver_obj, compiled_operation = resolver.resolve(
        compiled_operation=compiled_operation,
        owner_name=owner_name,
        project_name=project_name,
        project_uuid=project_uuid,
        run_name=run_name,
        run_path=run_path,
        run_uuid=run_uuid,
        params=params,
    )
    return converter.convert(
        namespace=resolver_obj.namespace,
        owner_name=resolver_obj.owner_name,
        project_name=resolver_obj.project_name,
        run_name=resolver_obj.run_name,
        run_path=resolver_obj.run_path,
        run_uuid=resolver_obj.run_uuid,
        compiled_operation=compiled_operation,
        connection_by_names=resolver_obj.connection_by_names,
        internal_auth=internal_auth,
        artifacts_store=resolver_obj.artifacts_store,
        secrets=resolver_obj.secrets,
        config_maps=resolver_obj.config_maps,
        polyaxon_sidecar=resolver_obj.polyaxon_sidecar,
        polyaxon_init=resolver_obj.polyaxon_init,
        default_sa=default_sa,
        converters=converters,
        default_auth=default_auth,
    )