Source code for renku.domain_model.workflow.provider

# Copyright Swiss Data Science Center (SDSC). A partnership between
# École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Workflow executor provider."""

from __future__ import annotations

from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, Tuple

if TYPE_CHECKING:
    import networkx as nx


[docs]class IWorkflowProvider(metaclass=ABCMeta): """Abstract class for executing ``Plan``."""
[docs] @abstractmethod def workflow_provider(self) -> Tuple[IWorkflowProvider, str]: """Supported workflow description formats. Returns: Tuple[IWorkflowProvider,str]: A tuple of the provider itself and the workflow executor backends name. """ pass
[docs] @abstractmethod def workflow_execute(self, dag: nx.DiGraph, basedir: Path, config: Dict[str, Any]): """Executes a given ``AbstractPlan`` using the provider. Returns: A list of output paths that were generated by this workflow. """ pass