Skip to content

Commit

Permalink
🔧 add optional requirements for local jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ddomenico committed Feb 16, 2024
1 parent 3aaf788 commit 69e877b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions isabl_cli/batch_systems/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@

from isabl_cli import api
from isabl_cli import utils
from isabl_cli.settings import system_settings
from isabl_cli.settings import perform_import


def submit_local(app, command_tuples):
"""Submit analyses locally and serially."""
# make sure analyses are in submitted status to avoid
# merging project level analyses in every success
ret = []

get_requirements = system_settings.SUBMIT_CONFIGURATION.get("get_requirements")

if get_requirements:
name = "SUBMIT_CONFIGURATION.get_requirements"
get_requirements = perform_import(val=get_requirements, setting_name=name)
method = command_tuples[0][0]["targets"][0]["technique"]["method"]
requirements = get_requirements(app, method)

api.patch_analyses_status([i for i, _ in command_tuples], "SUBMITTED")
label = f"Running {len(command_tuples)} analyses..."

Expand All @@ -22,6 +33,10 @@ def submit_local(app, command_tuples):
api.patch_analysis_status(i, "STARTED")
oldmask = os.umask(0o22)
status = app._get_after_completion_status(i)

# add requirements if specified
if requirements:
j = f"{requirements} {j}"

with open(log, "w") as stdout, open(err, "w") as stderr:
try:
Expand Down

0 comments on commit 69e877b

Please sign in to comment.