i-VRESSE / haddock3-webapp

Web app which is front-end for bartender and wraps workflow builder with haddock3 catalog
Apache License 2.0
1 stars 0 forks source link

Make run_dir optional when uploading in the builder #112

Closed sverhoeven closed 1 month ago

sverhoeven commented 4 months ago

The default value for run_dir did not work during validation. As ajv has useDefaults:false, see https://github.com/i-VRESSE/workflow-builder/pull/159 why that was not used.

Fixes https://github.com/i-VRESSE/workflow-builder/issues/154

To test

Case 1

  1. Goto builder page
  2. Upload 2 molecules
  3. Press download button, zip hould have run_dir=output
  4. Reload page
  5. Upload zip
  6. Download workflow again, should have run_dir=output

Case 2

  1. Goto scenario page
  2. Upload 2 molecules select residues for both
  3. Press download button, zip should have run_dir=output
  4. goto builder page
  5. Upload zip
  6. Download workflow again, should have run_dir=output

Case 3

  1. Goto scenario page
  2. Upload 2 molecules select residues for both
  3. Press 'refine in builder' button
  4. Press download button, zip should have run_dir=output
  5. Reload page
  6. Upload zip
  7. Download workflow again, zip should have run_dir=output

Case 4

  1. Goto builder page
  2. Upload 2 molecules
  3. Press download button, zip should have run_dir=output
  4. Set run_dir=somedir to workflow.cfg in zip
  5. Reload page
  6. Upload modified zip
  7. Download workflow again, zip should have run_dir=output

Case 5

  1. Goto builder page
  2. Upload modified zip from case 4
  3. submit
  4. Wait for job to complete
  5. Download input archive, workflow.cfg should have run_dir=output

Case 6

Same as case 5 but submit on upload page

sverhoeven commented 4 months ago

@VGPReys could you test this branch to see if it fixes https://github.com/i-VRESSE/workflow-builder/issues/154 for you?

sverhoeven commented 1 month ago

When run_dir is optional and default is unset then zip without run_dir is valid, but download misses run_dir When run_dir is optional and default is set then zip without run_dir is valid, but download misses run_dir When run_dir is required and default is set then zip without run_dir is invalid, but download has run_dir.. When run_dir is required and default is unset then zip without run_dir is invalid, but download misses run_dir..

So there is no configuration where uploaded zip without run_dir is valid and download has run_dir.

sverhoeven commented 1 month ago
I tried to inject run_dir on download but look likes recoil does not settle state before save() is executed. A second download has correct run_dir, but that is not very useful. ```jsx const setGlobal =useGlobalFormData()[1] function saveWithRunDir() { setGlobal(current => { return { ...current, run_dir: JOB_OUTPUT_DIR, } }) save() } return ( ); ```

Could try https://recoiljs.org/docs/api-reference/utils/waitForAllSettled ,but would need new @i-vresse/wb-core release if it works. See https://github.com/i-VRESSE/workflow-builder/pull/161

sverhoeven commented 1 month ago

I tried to inject run_dir on download but look likes recoil does not settle state before save() is executed. A second download has correct run_dir, but that is not very useful. Could try https://recoiljs.org/docs/api-reference/utils/waitForAllSettled ,but would need new @i-vresse/wb-core release if it works. See i-VRESSE/workflow-builder#161

With useSaveWithGlobalRewrite hook in https://www.npmjs.com/package/@i-vresse/wb-core/v/3.1.0 the run_dir is overwritten when you download. So now uploaded zip without run_dir is valid and download always has run_dir=output.

github-actions[bot] commented 1 month ago

Please delete the images belonging to this Pull Request as they are no longer useful.

Goto versions page of each image, find version called pr-112, filter on tagged versions by clicking "N tagged" button in table header, click on ... button and select Delete version.