-
Notifications
You must be signed in to change notification settings - Fork 188
[8.0] Interpret outputPath with LFN: prefix as an absolute one #8603
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
base: rel-v8r0
Are you sure you want to change the base?
Changes from 4 commits
7da83a2
b464e93
444c0ca
fbf4654
c4b8fd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,11 +70,11 @@ In this section all the attributes that can be used in the DIRAC JDL job descrip | |
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
| | *InputDataPolicy* | Job input data policy | InputDataPolicy = ``"DIRAC.WorkloadManagementSystem.Client.DownloadInputData";`` | | ||
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
| | *OutputData* | Job output data files | OutputData = ``{"output1","output2"};`` | | ||
| | *OutputData* [1] | Job output data files | OutputData = ``{"output1","output2"};`` | | ||
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
| | *OutputPath* | The output data path in the File Catalog | OutputPath = ``{"/myjobs/output"};`` | | ||
| | *OutputPath* [2] | The output data path in the File Catalog | OutputPath = ``{"/myjobs/output"};`` | | ||
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
| | *OutputSE* | The output data Storage Element | OutputSE = ``{"DIRAC-USER"};`` | | ||
| | *OutputSE* [3] | The output data Storage Element | OutputSE = ``{"DIRAC-USER"};`` | | ||
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
| | | | ||
| | :subtitle:`Parametric Jobs` | | ||
|
|
@@ -91,3 +91,24 @@ In this section all the attributes that can be used in the DIRAC JDL job descrip | |
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
| | *ParameterFactor* | Parameter multiplier | ParameterFactor = 1.1; (default 1.) | | ||
| +---------------------+---------------------------------------------+-------------------------------------------------------------------------------------+ | ||
|
|
||
| 1. Elements of OutputData can be specified in several forms: | ||
|
|
||
| - file names; in this case files with the specified names will be looked for in the job directory and uploaded | ||
| to a location specified by the OutputPath; | ||
| - file names with wild cards; same after the file names expansion; | ||
| - file names in a form "LFN:/vo/full/destination/path/file.name"; in this case the file will be uploaded | ||
| to the specified LFN path without taking into account the OutputPath. Note that file.name here can be also | ||
| specified with wild cards. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Give an example of a wild card. |
||
|
|
||
| 2. The OutputPath can be specified in several ways | ||
|
|
||
| - if not given it will be taken as the user's home directory + the job directory | ||
| for example "/lhcb/user/a/atsareg/1234/1234567", where 1234567 is the job ID; | ||
| - if given as path starting with "/", it will be appended to the user's home | ||
| directory; | ||
| - if given as "LFN:/output/path", it will be taken as an absolute path for | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens If, while submitting a user job I request |
||
| output files in the logical namespace. | ||
|
|
||
| 3. If multiple output SEs are specified, they will be tried one-by-one for each | ||
| output file until a successful file upload. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -951,7 +951,17 @@ def __transferOutputDataFiles(self, outputData, outputSE, outputPath): | |||||
| else: | ||||||
| nonlfnList.append(out) | ||||||
|
|
||||||
| # Check whether list of outputData has a globbable pattern | ||||||
| # Check whether the list of LFNs has globbable patterns | ||||||
| globbedLfnList = [] | ||||||
| for lfn in lfnList: | ||||||
| lfnPath = os.path.dirname(lfn) | ||||||
| lfnLocal = os.path.basename(lfn) | ||||||
| globbedLfnList += [os.path.join(lfnPath, gLfn) for gLfn in List.uniqueElements(getGlobbedFiles(lfnLocal))] | ||||||
| if globbedLfnList != lfnList and globbedLfnList: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slightly more precise:
Suggested change
|
||||||
| self.log.info("Found a pattern in the output data LFN list, LFNs to upload are:", ", ".join(globbedLfnList)) | ||||||
| lfnList = globbedLfnList | ||||||
|
|
||||||
| # Check whether the list of outputData has a globbable pattern | ||||||
|
Comment on lines
+954
to
+964
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a code duplication between these inserted lines and those that follow, care to refactor for simplicity? |
||||||
| globbedOutputList = List.uniqueElements(getGlobbedFiles(nonlfnList)) | ||||||
| if globbedOutputList != nonlfnList and globbedOutputList: | ||||||
| self.log.info( | ||||||
|
|
@@ -1113,6 +1123,10 @@ def __getLFNfromOutputFile(self, outputFile, outputPath=""): | |||||
| # If output path is given, append it to the user path and put output files in this directory | ||||||
| if outputPath.startswith("/"): | ||||||
| outputPath = outputPath[1:] | ||||||
| # If output path is given with the LFN: prefix, take it as an absolute path | ||||||
| elif outputPath.startswith("LFN:"): | ||||||
| outputPath = outputPath[4:] | ||||||
| basePath = "" | ||||||
|
Comment on lines
+1126
to
+1129
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this block be before the previous 2 lines? For the case when |
||||||
| else: | ||||||
| # By default the output path is constructed from the job id | ||||||
| subdir = str(int(self.jobID / 1000)) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"file names"?
"LFN:/vo/full/destination/path/file.name"is a a full "file path" (directory path / filename). It's better to be precise to avoid confusion.And in the previous 2 lines, did you mean "filename", "file path", or both?