Repository navigation
Conversation
chrisburr
left a comment
There was a problem hiding this comment.
I've spent a while going through this and I get the impression it would be better/simpler to do cwltool --pack? In DiracX we would then only need to:
- Client: run
cwltool --pack, take thedirac:hints out into the transformation fields and drop them from the document. - Server: split the
$graphinto components, replace eachrun: #xwith the child's hash and hash each component withhash_json. - Both: run one shared
check_self_contained()(stdlib only, in diracx-core) so the document never needs anything from outside once it reaches DiracX:- no
$keys except$namespaces($schemasgets fetched) - every
runis a#idwithin the$graph - requirement/hint classes from an allowlist (cwltool tries to fetch unknown ones)
File/Directoryliterals only with inlinecontents(pack turns a localpathinto the submitter's absolutefile:///path and keeps URLs)- no
dockerLoad/dockerImport/dockerFile
- no
The identity is then the hash of what was submitted rather than of a normalised form. A different cwltool version, a renamed file or an edited doc gives a new id, but that only costs a duplicate row. In exchange we drop the rules that reimplement schema-salad's resolution.
|
I haven't had a look at the PR yet, but your suggestion makes sense to me.
I think packing the cwl from the client was the idea we discussed during the workshop, am I wrong?
Note that @natthan-pigoux made it possible to get docker images from CVMFS if I remember correctly. Can you remind us how it works please? |
It was not directly targeting CVMFS but it was for |
4d18f33 to
9049493
Compare
Documentation build overview
24 files changed ·
|
The client submits a document packed by cwltool --pack: a $graph of processes in which a step's run names another entry or holds an inline body. A process is identified by hash_json of the process as submitted, with each run replaced by its child's identity, so a workflow's identity covers its children's (a Merkle tree). Nothing is normalised: another cwltool version, an edited doc or a renamed file gives another identity, which only costs a duplicate row, and DiracX never rewrites what the user tested. check_self_contained refuses a document that needs anything from outside itself: a $ key other than the top-level $graph and $namespaces, a run that is not an entry of the $graph or an inline body, and a File or Directory given by path or location rather than inline contents. subgraph returns the document one entry runs. Closes DIRACGrid#1106 Part of DIRACGrid#1080
9049493 to
f716e6a
Compare
The following points are listed in #1107 so I assume they are expected to come later. |
aldbr
left a comment
There was a problem hiding this comment.
Could you just check what would happen with the following examples please?
(this is kind of niche, but it can happen if you would try to submit a CWL process without passing through the diracx client and directly go through the REST API for instance)
- duplicate ids:
{
"cwlVersion": "v1.2",
"$graph": [
{"id": "#main", "class": "Workflow",
"steps": [{"id": "sim", "run": "#gauss.cwl"},
{"id": "merge", "run": "#merge.cwl"}]},
{"id": "#gauss.cwl", "class": "Workflow",
"steps": [{"id": "run", "run": "#lb-run-app.cwl"}]},
{"id": "#lb-run-app.cwl", "class": "CommandLineTool",
"baseCommand": ["lb-run", "Gauss/v56r1"]}, // entry A
{"id": "#merge.cwl", "class": "Workflow",
"steps": [{"id": "run", "run": "#lb-run-app.cwl"}]},
{"id": "#lb-run-app.cwl", "class": "CommandLineTool",
"baseCommand": ["lb-run", "--verbose", "LHCb/v57r2"]} // entry B, same id
]
}- missing ids:
{
"cwlVersion": "v1.2",
"$graph": [
{"class": "CommandLineTool", "baseCommand": ["echo", "first"]},
{"class": "CommandLineTool", "baseCommand": ["echo", "second"]}
]
}|
|
||
| :func:`check_self_contained` makes sure that a document needs nothing from | ||
| outside itself, so that neither the services nor a runner fetch anything. | ||
| See ``docs/dev/explanations/cwl-process-store.md`` for a worked example. |
There was a problem hiding this comment.
| See ``docs/dev/explanations/cwl-process-store.md`` for a worked example. | |
| See ``docs/dev/explanations/cwl-process-identity.md`` for a worked example. |
Identifies each CWL process by
hash_jsonof the process as submitted in acwltool --packdocument, with each step'srunreplaced by its child's identity, so a workflow's identity covers its children's. Nothing is normalised: another cwltool version, an editeddocor a renamed file only costs a duplicate row, and DiracX never rewrites what the user tested.check_self_containedrefuses documents that need anything from outside themselves ($keys other than$graph/$namespaces, arunoutside the$graph,File/Directorygiven by path or location), andsubgraphreturns the document one transformation runs. A worked example is indocs/dev/explanations/cwl-process-identity.md.Closes #1106. Part of #1080.