Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on how to write scripts that interact with DIRAC #7115

Open
chaen opened this issue Jul 24, 2023 Discussed in #7114 · 1 comment
Open

Add documentation on how to write scripts that interact with DIRAC #7115

chaen opened this issue Jul 24, 2023 Discussed in #7114 · 1 comment

Comments

@chaen
Copy link
Contributor

chaen commented Jul 24, 2023

Basically document the initialize() or parseCommandLine() magic

Discussed in #7114

Originally posted by IgorPelevanyuk July 21, 2023
Hello,

In version 8 the idea behind development of scripts changed a bit.
It looks like it is necessary to include all developed scripts in special console_scripts variable in setup.cfg.
Without that the script will throw an error "Something is very wrong" from https://github.com/DIRACGrid/DIRAC/blob/1cd1173303b177dbfe44ede43d18d25514713301/src/DIRAC/Core/Base/Script.py#L55C40-L55C63

My question is the following. How to write a custom python script that use DIRAC API and that may be distributed with a job to be executed during userjob execution?

@chrisburr
Copy link
Member

chrisburr commented Jul 27, 2023

My question is the following. How to write a custom python script that use DIRAC API and that may be distributed with a job to be executed during userjob execution?

I think this should work:

import DIRAC
DIRAC.initialize()
# All remaining DIRAC imports

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

No branches or pull requests

2 participants