Skip to content

Conversation

@Loxeris
Copy link
Member

@Loxeris Loxeris commented Jan 14, 2026

Fixes problems related to the execution of the job wrapper on pilots (i.e. cwl ids link to local path).
Also initialize DIRAC in the job wrapper as it's needed to access Dirac Resources (i.e. /Resources/FileCatalogs).

See #44

if os.getenv("DIRAC_PROTO_LOCAL") == "1":
self._sandbox_store_client = MockSandboxStoreClient()
else:
DIRAC.initialize()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay for now but just for your information:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems Script.parseCommandLine() needs to be run before importing any DIRAC component. So the job wrapper template would look like this. If it's ok for you, then it can replace the DIRAC.initialize() without any problem.

from cwl_utils.parser import load_document_by_uri
from cwl_utils.parser.cwl_v1_2_utils import load_inputfile
from DIRAC.Core.Base.Script import Script  # type: ignore[import-untyped]
from ruamel.yaml import YAML

if os.getenv("DIRAC_PROTO_LOCAL") != "1":
    Script.parseCommandLine()

from dirac_cwl_proto.job.job_wrapper import JobWrapper
from dirac_cwl_proto.submission_models import JobModel


def main():
    """Execute the job wrapper for a given job model."""
    if len(sys.argv) != 2:
    ...

It also may change the default logging configuration a bit, but it shouldn't be too much of an issue.

For the DIRACX_URL env var I'm not yet sure how to get the url but I guess we will see when it's needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants