Warning
This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
Source code for galaxy.job_execution.compute_environment
import os
from abc import (
ABCMeta,
abstractmethod,
)
from typing import (
Any,
Dict,
)
from galaxy.job_execution.setup import JobIO
from galaxy.model import Job
[docs]def dataset_path_to_extra_path(path: str) -> str:
base_path = path[0 : -len(".dat")]
return f"{base_path}_files"
[docs]class ComputeEnvironment(metaclass=ABCMeta):
"""Definition of the job as it will be run on the (potentially) remote
compute server.
"""
[docs] @abstractmethod
def input_path_rewrite(self, dataset):
"""Input path for specified dataset."""
[docs] @abstractmethod
def output_path_rewrite(self, dataset):
"""Output path for specified dataset."""
[docs] @abstractmethod
def input_extra_files_rewrite(self, dataset):
"""Input extra files path rewrite for specified dataset."""
[docs] @abstractmethod
def output_extra_files_rewrite(self, dataset):
"""Output extra files path rewrite for specified dataset."""
[docs] @abstractmethod
def input_metadata_rewrite(self, dataset, metadata_value):
"""Input metadata path rewrite for specified dataset."""
[docs] @abstractmethod
def unstructured_path_rewrite(self, path):
"""Rewrite loc file paths, etc.."""
[docs] @abstractmethod
def working_directory(self):
"""Job working directory (potentially remote)"""
[docs] @abstractmethod
def config_directory(self):
"""Directory containing config files (potentially remote)"""
[docs] @abstractmethod
def env_config_directory(self):
"""Working directory (possibly as environment variable evaluation)."""
[docs] @abstractmethod
def new_file_path(self):
"""Absolute path to dump new files for this job on compute server."""
[docs] @abstractmethod
def tool_directory(self):
"""Absolute path to tool files for this job on compute server."""
[docs] @abstractmethod
def version_path(self):
"""Location of the version file for the underlying tool."""
[docs] @abstractmethod
def home_directory(self):
"""Home directory of target job - none if HOME should not be set."""
[docs] @abstractmethod
def tmp_directory(self):
"""Temp directory of target job - none if HOME should not be set."""
[docs] @abstractmethod
def galaxy_url(self):
"""URL to access Galaxy API from for this compute environment."""
[docs] @abstractmethod
def get_file_sources_dict(self) -> Dict[str, Any]:
"""Return file sources dict for current user."""