reanahub / reana-db

REANA database utilities
http://reana-db.readthedocs.org
MIT License
0 stars 31 forks source link

models: replace workflow.run_number with generation and restart number #205

Closed giuseppe-steduto closed 12 months ago

giuseppe-steduto commented 1 year ago

Change the workflow table to split the run_number into two integers: one referring to the generation of the workflows, and the other one referring to the restart number, thus removing the limit of 9 restarts.

Closes #186.


To test the PR, these quick scripts might be come in handy: 1) Run the specified number of workflows on REANA (default 15), to be run from a workflow directory (such as roofit).

#!/bin/bash

# Set the default number of runs to 15 if no argument is passed
NUM_RUNS=${1:-15}

# Run the setup environment command
eval $(reana-dev client-setup-environment)

# Run the workflow the specified number of times
for (( i=1; i<=NUM_RUNS; i++ ))
do
  echo "Starting run $i of $NUM_RUNS..."
  reana-client run -w root6-roofit
  echo "Run $i submitted."
done

2) Restart a specific generation of the roofit demo workflow (default 1) a certain number of times (default 15). ./restart.sh 50 3 will restart root6-roofit.3 50 times.

#!/bin/bash

# Set the default number of runs to 15 if no argument is passed
NUM_RUNS=${1:-15}
TO_RESTART=${2:-1}

# Run the setup environment command
eval $(reana-dev client-setup-environment)

# Run the workflow the specified number of times
for (( i=1; i<=NUM_RUNS; i++ ))
do
  echo "Starting restart $i of $NUM_RUNS..."
  reana-client restart -w root6-roofit.$TO_RESTART
  echo "Restart $i submitted."
done
codecov[bot] commented 1 year ago

Codecov Report

Merging #205 (589978b) into master (1fde517) will increase coverage by 0.20%. The diff coverage is 93.33%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/reanahub/reana-db/pull/205/graphs/tree.svg?width=650&height=150&src=pr&token=YJYO88RX5I&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub)](https://app.codecov.io/gh/reanahub/reana-db/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub) ```diff @@ Coverage Diff @@ ## master #205 +/- ## ========================================== + Coverage 74.24% 74.44% +0.20% ========================================== Files 7 7 Lines 893 900 +7 ========================================== + Hits 663 670 +7 Misses 230 230 ``` | [Files](https://app.codecov.io/gh/reanahub/reana-db/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub) | Coverage Δ | | |---|---|---| | [reana\_db/config.py](https://app.codecov.io/gh/reanahub/reana-db/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfZGIvY29uZmlnLnB5) | `0.00% <ø> (ø)` | | | [reana\_db/models.py](https://app.codecov.io/gh/reanahub/reana-db/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfZGIvbW9kZWxzLnB5) | `90.30% <95.83%> (+0.05%)` | :arrow_up: | | [reana\_db/utils.py](https://app.codecov.io/gh/reanahub/reana-db/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfZGIvdXRpbHMucHk=) | `76.29% <83.33%> (+0.08%)` | :arrow_up: |