pepkit / looper

A job submitter for Portable Encapsulated Projects
http://looper.databio.org
BSD 2-Clause "Simplified" License
20 stars 7 forks source link

run: Return code when no samples are submitted #289

Closed afrendeiro closed 1 year ago

afrendeiro commented 4 years ago

Currently the run command returns 0 when no samples are submitted (see for example https://travis-ci.org/github/epigen/microtest/builds/721682599).

I guess there would be valid reasons why a call without submissions should give a good exit code (I'm thinking of a dry run of course, but other cases I guess). Question is: is this the most common case? Should looper return a non-zero exit code unless it's a dry run for example?

nsheff commented 4 years ago

well, if all jobs are complete, it would submit no samples but should still return 0, right?

what exactly is your question? Is what the most common case? are you trying to ask: "Should looper return !0 when no samples are submitted?" If so, I would say: No, for the use case above. Submitting no samples doesn't necessarily indicate failure.

afrendeiro commented 4 years ago

Yeah I understand, but could looper distinguish between everything has been done or it is a dry run, and the remaining cases? Or are there more cases in which there is no submission and it should still return 0?

afrendeiro commented 4 years ago

I can see that this could be quite a lot of logic with special cases to implement. I'm just trying to understand the breadth of use cases, the possible outcomes and their expected return codes.

nsheff commented 4 years ago

well, looper knows if individual submissions succeeded. I just had a case where I submitted 150 jobs. All but 1 succeeded -- the one that failed did so due to the cluster engine just hiccuping -- rerunning the sbatch command worked, but there was a split second network outage or something. in this case, it would be better to return nonzero. I suppose it could return an error exit code if any attempted submission failed, couldn't it?

I'd propose the following:

dry run, and no jobs left to run both fall under "no attempted submissions" and would return 0.

afrendeiro commented 4 years ago

Sounds good to me.

Just to be clear, does attempting to submit also include samples that are not valid for job generation? E.g. no valid interface?

nsheff commented 4 years ago

does attempting to submit also include samples that are not valid for job generation? E.g. no valid interface?

my first reaction is yes, that would also be an error.

ayobi commented 1 year ago

I'd propose the following:

* if any job attempted submission but didn't, return non-zero.

It looks like there is some logic handling this in the exceptions here: https://github.com/pepkit/looper/blob/df535be2a0bd7257ee37148cb601d688ec557909/looper/exceptions.py#L42-L48

ayobi commented 1 year ago

Logic here: https://github.com/pepkit/looper/blob/df535be2a0bd7257ee37148cb601d688ec557909/looper/conductor.py#L408-L421