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

cli: validate workflow hints #486

Open
1 of 3 tasks
tiborsimko opened this issue Mar 24, 2021 · 1 comment
Open
1 of 3 tasks

cli: validate workflow hints #486

tiborsimko opened this issue Mar 24, 2021 · 1 comment
Assignees

Comments

@tiborsimko
Copy link
Member

tiborsimko commented Mar 24, 2021

Current behaviour

After the validate command was enriched in REANA 0.7.3, we could improve it even more.

For example, currently, the typos in compute backend clause are not detected:

$ cd ~r/reana-demo-root6-roofit
$ git reset --hard 
$ sed -i 's,compute_backend,c_b,g' reana-htcondorcern.yaml
$ git diff            
diff --git a/reana-htcondorcern.yaml b/reana-htcondorcern.yaml
index affb577..a75372f 100644
--- a/reana-htcondorcern.yaml
+++ b/reana-htcondorcern.yaml
@@ -13,13 +13,13 @@ workflow:
     steps:
       - name: gendata
         environment: 'reanahub/reana-env-root6:6.18.04'
-        compute_backend: htcondorcern
+        c_b: htcondorcern
         htcondor_max_runtime: espresso
         commands:
         - mkdir -p results && root -b -q 'code/gendata.C(${events},"${data}")'
       - name: fitdata
         environment: 'reanahub/reana-env-root6:6.18.04'
-        compute_backend: htcondorcern
+        c_b: htcondorcern
         htcondor_max_runtime: espresso
         commands:
         - root -b -q 'code/fitdata.C("${data}","${plot}")'
$ reana-client validate --environments -f ./reana-htcondorcern.yaml
==> Verifying REANA specification file... /home/tibor/private/project/reana/src/reana-demo-root6-roofit/reana-htcondorcern.yaml
  -> SUCCESS: Valid REANA specification file.
==> Verifying workflow parameters and commands... 
  -> SUCCESS: Workflow parameters and commands appear valid.
==> Verifying environments in REANA specification file...
  -> SUCCESS: Environment image reanahub/reana-env-root6:6.18.04 has the correct format.
  -> SUCCESS: Environment image reanahub/reana-env-root6:6.18.04 exists locally.
  -> SUCCESS: Environment image reanahub/reana-env-root6:6.18.04 exists in Docker Hub.
  -> WARNING: Environment image UID is recommended to be 1000. UID 0 was found.
  -> SUCCESS: Environment image reanahub/reana-env-root6:6.18.04 has the correct format.
  -> SUCCESS: Environment image reanahub/reana-env-root6:6.18.04 exists locally.
  -> SUCCESS: Environment image reanahub/reana-env-root6:6.18.04 exists in Docker Hub.
  -> WARNING: Environment image UID is recommended to be 1000. UID 0 was found.

Expected behaviour

One would expect to see that c_b is not a valid workflow hint.

Let's enrich reana-client validate command to capture these situations early.

Note that this would mean to look also for htcondor_max_runtime and friends. Note that clause values, such as "espresso", are already validated. It is only clause names, such as "htcondor_max_runtime", that are not.

This could be a new section in the validation output about validating workflow hints:

==> Verifying workflow hints...
   -> ERROR: "htcrn" is not a valid value for "compute_backend' declaration clause

As usual, beware of different hint declarations in CWL, Serial, Yadage engines.

@ParthS007
Copy link
Member

After discussing with @diegodelemos and @mvidalgarcia on Friday stand-up, we talked about enriching the JSON schema for every workflow so that the properties and values are checked there.

If we enrich JSON schema, we don't have to check the workflow hints on our side, and it will be taken care of by JSON schema validation.

What do you think @tiborsimko ?

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