Spinnaker: Deciding which stage to go next - spinnaker

I'm creating this scenario where:
Stage A which is a Jenkins,
Stage B which will run if Stage A is successful,
Stage C which will run if Stage A fail.

In the desired pipeline select Stage A > Execution Options > If stage fails > ignore the failure
Stage B > Execution Options > Conditional on Expression > Add your expression when succesful
Stage C > Execution Options > Conditional on Expression > Add your expression when Stage A fails...
i made a short video tutorial feel free to watch it.

Related

How to create a conditional task in Taskfile?

I have three tasks created with TASKFILE, main-task and its two preconditions(or deps) e.g A and B. I need the main-task to run task A, if task A works fine and did the job then ignore the second task B, otherwise fallback to task B and execute it (that's why I added ignore_error: true). How to put this logic inside main-task using taskfile syntax? thanks
Example:
---
version: 3
tasks:
A:
cmds:
- cmd: exit 1
ignore_error: true
B:
cmds:
- exit 1
main-task:
deps: # Run A only, But if it fails then Run B
cmds:
- task: # or here: Run A only, But if it fails then Run B
Unfortunately, there isn't a way to run a task only if another one failed. You can run it only if succeeded by calling it after the previous one, or always by using defer.

snakemake dry run for a single wildcard in order of execution

Is it possible to do a dry run for snakemake for a single wildcard, in the order of execution?
When I call a dry run, I get the following at the bottom:
Job counts:
count jobs
1 all
1 assembly_eval
5 cat_fastq
1 createGenLogDir
5 createLogDir
5 flye
5 medaka_first
5 medaka_second
5 minimap_first
5 quast_medaka_first
5 quast_medaka_second
5 quast_racon_first
5 racon_first
5 symLinkFQ
58
This was a dry-run (flag -n). The order of jobs does not reflect the order of execution.
So I guess it would be useful to:
get the dry run commands for a single wildcard (except for the aggregate rules, obviously), after all, the only thing that differs among the commands of any of those rules is the wildcard in the input, output and param directives.
get the workflow printed in the order of execution, for enhanced visualisation.
I did not find a suitable option using snakemake -h, and I'd be looking for something that --rulegraph, does compared --dag, which is to avoid redundancy.
If there is no solution to this, or if the solution is too cumbersome, I guess I will suggest this as enhancement in their github page.
Here are some possible solutions:
You can specify a target file with the specific wildcard you want, e.g. snakemake -nq output_wc1.txt
If your wildcards are stored in a list/dataframe, limit to just the first. I frequently do this while developing, e.g. chroms = range(1,2) # was range(1, 23)
If you have a single job for each rule and dependencies are simple (A -> B -> C), the jobs should be listed in order of execution. This is not true when your workflow has concurrent or branching rules.
Have you also checked --filegraph and --summary?

I want to execute a JCL step no matter what the RC of previous step is?

There are 3 steps in my JCL:
STEP 1: process
STEP 2: NDM
STEP 3: DELETE OUTPUT after NDM
What I want to accomplish?
I want to execute STEP 3 no matter what the return code of step 2 is.
I tried this:
COND=(16,GT) and COND=(16,ST,STEP 2) but it's not doing what I want to do.
Using COND=EVEN has the potential pitfall that the STEP will run even if the previous step ABENDS. Coding COND=(0,GT,STEP2) should allow the step to run but not if there is an ABEND.
Alternately you could use IF/THEN/ELSE/ENDIF coding.
e.g.
//STEP2 EXEC PGM=NDM
//IF STEP2.RC >= 0 THEN
//STEP3 EXEC PGM=???
//ENDIF
or
//STEP2 EXEC PGM=NDM
//IF STEP2.RC GE 0 THEN
//STEP3 EXEC PGM=???
//ENDIF
i.e. either >= or GE can be used.
You may find this helpful IF/THEN/ELSE/ENDIF Statement Construct
or for the COND parameter COND Parameter
Try COND=EVEN on your final step’s EXEC statement.
From the documetnation:
COND=EVEN tells MVS to execute this job step EVEN IF a prior step in
the same job abends, unless the job is canceled by the MVS
operator.
There's also a COND=ONLY:
COND=ONLY tells MVS to execute this job step ONLY IF a prior step in
the same job abends.
Explanation of COND:
COND is fairly counter-intuitive. The description is:
If none of these tests is satisfied, the system executes the job step;
if any test is satisfied, the system skips the job step on which the
COND= parameter is coded.
So your COND=(16,GT) means "If 16 is greater than the return code from any previous steps, don't execute this step". So this step would only execute if ALL the previous steps finished with a RC > 16.
COND=(16,ST,STEP 2) is invalid - ST is not a valid condition. Valid tests are :
EQ - equal
LT - less than
LE - less than or equal to
NE - not equal
GT - greater than
GE - greater than or equal to
To make a step run, no matter what the condition codes from previous steps are, you could code COND=(0,GT), which means 'if 0 is greater than any previous return code (which it won't be), skip this step.'.
To be safe, you could code:
COND=((0,GT),EVEN)
as EVEN will cause this step to execute even if a previous step ABENDs.

Gitlab-CI runner hangs after makefile test fails

I am using Gitlab-CI for my build tests. I have a very simple test which compares the output of the test install/build with the known output. I put the test in a makefile.
The Makefile entry looks like this:
test:clean
make install DESTDIR=$(TEST_DIR)
$(TEST_DIR)/path/to/executable > $(TEST_DIR)/tmp.out
diff test/test.result $(TEST_DIR)/tmp.out
When the diff passes, an exit code of 0 is returned, a exit code of 1 is returned if the diff shows a difference in the files.
What I've tried:
Running make test from any shell runs the tests and exits, regardless of diff result
Running make test from the shell as gitlab_ci_runner runs the tests and exists regardless of diff result
When ran from Gitlab-CI, and the diff exit status is 0, the build returns success
The problem:
When ran in the Gitlab-CI and the diff exit status is non-0, the build hangs.
The output on the build screen is the output of the diff, and the last line is the expected error: make: *** [test] Error 1
After that, the cycle symbol keeps on, the runner does not exit with a build fail.
Any ideas? I thought that it might be something with Makefiles, but the Gitlab-CI will exit with a fail status if the Make exits with Error 1 for any other test. I can only see it happening on the output of the diff.
Thanks!
Also posted this to the GitLab mailinglist https://groups.google.com/d/msgid/gitlabhq/77e82813-b98e-4abe-9755-f39e07043384%40googlegroups.com?utm_medium=email&utm_source=footer

Bamboo vs CxxTest

When I create a plan in Bamboo and add a task for running CxxTest test code(running function TS_ASSERT(1==1) or st). When I try to run for checking failure (TS_ASSERT(1==2)), this test case is fail and Bamboo output a log as:
12-Mar-2014 15:12:07 Failed 1 and Skipped 0 of 2 tests
12-Mar-2014 15:12:07 Success rate: 50%
12-Mar-2014 15:12:07 Failing task since return code was 1 while expected 0
So, does anyone here know why bamboo can understand the test result, and what is the return code here(return code was 1 while expected 0)?
From my observation, one windows, Bamboo consider value of the %ERRORLEVEL% as the result of the task. so return code was 1 while expected 0 means your task is returning 1 and Bamboo is expecting 0. Yes, it's expecting 0 since it considers any value other than 0 as failure.