Skip to content

CI: Add retry script for Docker commands #2516

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

Merged
merged 3 commits into from
Apr 3, 2018

Conversation

effigies
Copy link
Member

Fixes #2489.

Changes proposed in this pull request

  • Add retry_cmd.sh script
  • Replace loops in .circleci/config.yml

@effigies effigies added this to the 1.0.3 milestone Mar 28, 2018
@codecov-io
Copy link

codecov-io commented Mar 28, 2018

Codecov Report

Merging #2516 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2516      +/-   ##
==========================================
+ Coverage   66.84%   66.88%   +0.04%     
==========================================
  Files         327      327              
  Lines       42479    42479              
  Branches     5268     5268              
==========================================
+ Hits        28393    28411      +18     
+ Misses      13381    13366      -15     
+ Partials      705      702       -3
Flag Coverage Δ
#smoketests 50.83% <ø> (+0.3%) ⬆️
#unittests 64.22% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
nipype/pipeline/engine/nodes.py 83.91% <0%> (+0.33%) ⬆️
nipype/utils/provenance.py 84.71% <0%> (+1.27%) ⬆️
nipype/workflows/fmri/spm/preprocess.py 72.44% <0%> (+12.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab3ea2d...2cd3da3. Read the comment docs.

@effigies
Copy link
Member Author

effigies commented Mar 28, 2018

There are some limits to this script WRT multi-command behavior.

$ tools/retry_cmd.sh -n 2 -s 1 "echo TEST && exit 2"; echo $?  
sh: echo TEST && exit 2: command not found
sh: echo TEST && exit 2: command not found
127
$ tools/retry_cmd.sh -n 2 -s 1 echo TEST "&&" exit 2; echo $? 
TEST && exit 2
0

But for the current purposes this seems fine.

Copy link
Contributor

@oesteban oesteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot more readable than before. Please check the comment I left above.

#
# 2018 Chris Markiewicz
# Released into public domain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to set set +o pipefail here to work? After some digging, I think the original problem reported in #2489 is just that the steps are run with set -eo pipefile (circle has started to run it with 2.0). Using both -eo will make the script to exit even with that || true pipe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because those apply to each instance of the shell. It doesn't infect subprocesses.

@effigies effigies merged commit e446466 into nipy:master Apr 3, 2018
@effigies effigies deleted the ci/loop_script branch April 3, 2018 12:40
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

Successfully merging this pull request may close these issues.

3 participants