diff --git a/src/lsst/cmservice/common/butler.py b/src/lsst/cmservice/common/butler.py index 343f530b..a75933e0 100644 --- a/src/lsst/cmservice/common/butler.py +++ b/src/lsst/cmservice/common/butler.py @@ -7,6 +7,7 @@ from lsst.daf.butler import Butler, MissingCollectionError from ..common import errors +from ..config import config async def remove_run_collections( @@ -28,6 +29,7 @@ async def remove_run_collections( fake_reset: bool Allow for missing butler """ + fake_reset = fake_reset or config.butler.mock try: butler_f = partial( Butler.from_config, @@ -68,6 +70,7 @@ async def remove_non_run_collections( fake_reset: bool Allow for missing butler """ + fake_reset = fake_reset or config.butler.mock try: butler_f = partial( Butler.from_config, @@ -109,6 +112,7 @@ async def remove_collection_from_chain( fake_reset: bool Allow for missing butler """ + fake_reset = fake_reset or config.butler.mock if fake_reset: return raise NotImplementedError @@ -137,6 +141,7 @@ async def remove_datasets_from_collections( fake_reset: bool Allow for missing butler """ + fake_reset = fake_reset or config.butler.mock if fake_reset: return raise NotImplementedError diff --git a/src/lsst/cmservice/common/htcondor.py b/src/lsst/cmservice/common/htcondor.py index cf2596f5..0e23a597 100644 --- a/src/lsst/cmservice/common/htcondor.py +++ b/src/lsst/cmservice/common/htcondor.py @@ -21,26 +21,26 @@ async def write_htcondor_script( - htcondor_script_path: str | Path, - htcondor_log: str | Path, - script_url: str | Path, - log_url: str | Path, + htcondor_script_path: Path, + htcondor_log: Path, + script_url: Path, + log_url: Path, **kwargs: Any, ) -> Path: """Write a submit wrapper script for htcondor Parameters ---------- - htcondor_script_path: str | anyio.Path + htcondor_script_path: anyio.Path Path for the wrapper file written by this function - htcondor_log: str | anyio.Path + htcondor_log: anyio.Path Path for the wrapper log - script_url: str | anyio.Path + script_url: anyio.Path Script to submit - log_url: str | anyio.Path + log_url: anyio.Path Location of job log file to write Returns @@ -58,6 +58,13 @@ async def write_htcondor_script( ) options.update(**kwargs) + if config.htcondor.alias_path is not None: + _alias = Path(config.htcondor.alias_path) + # FIXME can we use the actual campaign prod_area here + script_url = _alias / script_url.relative_to("/output") + htcondor_log = _alias / htcondor_log.relative_to("/output") + log_url = _alias / log_url.relative_to("/output") + htcondor_script_contents = [ f"executable = {script_url}", f"log = {htcondor_log}", diff --git a/src/lsst/cmservice/config.py b/src/lsst/cmservice/config.py index 8ffb352a..5d28d7d9 100644 --- a/src/lsst/cmservice/config.py +++ b/src/lsst/cmservice/config.py @@ -141,6 +141,12 @@ class HTCondorConfiguration(BaseModel): description="...", default=True, serialization_alias="_condor_DAGMAN_MANAGER_JOB_APPEND_GETENV" ) + alias_path: str | None = Field( + description="The alias path to use in htcondor submission files instead of a campaign's prod_area", + default=None, + exclude=True, + ) + class SlurmConfiguration(BaseModel): """Configuration settings for slurm client operations.