reanahub / reana-workflow-engine-serial

REANA Workflow Engine Serial
http://reana-workflow-engine-serial.readthedocs.org
MIT License
0 stars 33 forks source link

add kubernetes_job_timeout parameter #159

Closed VMois closed 2 years ago

VMois commented 2 years ago

closes reanahub/reana-job-controller#343

How to test:

This PR is part of a bigger group of PRs. Please refer to the addressed issue to see all of them.

  1. Modify Serial helloworld example, with kubernetes_job_timeout=20 (in seconds) and sleeptime=2 (2 seconds so the workflow will definitely run longer than 20 seconds):

reana.yml

...
parameters:
    helloworld: code/helloworld.py
    inputfile: data/names.txt
    outputfile: results/greetings.txt
    sleeptime: 2  # <= here 
...
steps:
      - environment: 'python:2.7-slim'
        kubernetes_job_timeout: 20  # <= here
...
  1. Start workflow reana-client run -w serial-timeout -f reana.yaml

  2. After 25-30 seconds, check using reana-client list if workflow failed. It should.

  3. Using reana-client logs check if the reason is Job was killed due to timeout.

  4. Try to input string or object instead of integer for kubernetes_job_timeout, the workflow should fail with an error message like:

('Error while marshalling value=not_correct_timeout to type=integer/int32.', ValueError("invalid literal for int() with base 10: 'not_correct_timeout'"))

Check it using reana-client logs.

Note: You will see an error message above, but you will not see engine logs in the reana-client logs output. This is due to this issue. It will be fixed after this PR.

codecov-commenter commented 2 years ago

Codecov Report

Merging #159 (458faea) into master (ebb8214) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #159   +/-   ##
=======================================
  Coverage   27.46%   27.46%           
=======================================
  Files           5        5           
  Lines         142      142           
=======================================
  Hits           39       39           
  Misses        103      103           
Impacted Files Coverage Δ
reana_workflow_engine_serial/tasks.py 0.00% <ø> (ø)
reana_workflow_engine_serial/utils.py 35.61% <ø> (ø)