Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Avoid unintentionally canceling the scheduled crate publishing job #13088

Merged
merged 31 commits into from
Jan 10, 2023

Conversation

joao-paulo-parity
Copy link
Contributor

@joao-paulo-parity joao-paulo-parity commented Jan 6, 2023

Since publish-crates and publish-crates-manual share the resource group crates-publishing, any instance of publish-crates-manual (i.e. even instances created but not run) cancels a running instance of publish-crates, as demonstrated by https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2212179. A workaround for that unintended interaction is to avoid creating manual instances of publish-crates-manual and instead require pipelines to be triggered manually by checking $CI_PIPELINE_SOURCE == "web". See #13088 (comment).

close https://github.com/paritytech/release-engineering/issues/146

because publish-crates and publish-crates-manual share the resource group
"crates-publishing", any instance of publish-crates-manual cancels a running
instance of publish-crates, as demonstrated by
https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2212179

a workaround for that unintended interaction is to avoid creating instances of
publish-crates-manual and instead require pipelines to be triggered manually by
checking $CI_JOB_MANUAL == "true"
@joao-paulo-parity joao-paulo-parity added A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Jan 6, 2023
@joao-paulo-parity joao-paulo-parity requested a review from a team as a code owner January 6, 2023 13:03
@paritytech-ci paritytech-ci requested a review from a team January 6, 2023 13:12
@joao-paulo-parity
Copy link
Contributor Author

I think my changes up to 533e1ff are not enough for avoiding the pipeline cancelation. On a broader look of https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines/236214 I noticed that not only publish-crates-locally but many other jobs, such as quick-benchmarks, were also cancelled. I think this was due to the interaction between interruptible: true and the "Auto-cancel redundant pipelines" GitLab CI settings; i.e. it might not be related to resource_group as (wrongly) deduced in #13088 (comment).

So I came up with a different workaround. @alvicsam @oleg-plakida please take another look.

@alvicsam alvicsam self-requested a review January 9, 2023 10:21
Copy link
Contributor

@alvicsam alvicsam left a comment

Choose a reason for hiding this comment

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

Why not add interruptible: false for the required job? The option can be added per job

@paritytech-ci paritytech-ci requested a review from a team January 10, 2023 09:19
@joao-paulo-parity
Copy link
Contributor Author

Why not add interruptible: false for the required job? The option can be added per job

@alvicsam The publish-crates job is at the publish stage. That stage might not be reached in case some jobs are canceled, right? e.g. if the test stage's jobs gets canceled, for instance.

Furthermore I think it's relevant for the whole pipeline to be run in order to ensure that the code is working correctly before publishing it. I don't want to skip or cancel the test or check stages' jobs for instance.

In light of that, if I'd go for the individual interruptible: false usage, I think I'd have to add it not only to the job in question but all the ones it needs - directly or indirectly. Quoting https://docs.gitlab.com/ee/ci/yaml/#interruptible

You can’t cancel subsequent jobs after a job with interruptible: false starts.

So considering all of this, it seems simpler and less cumbersome to set interruptible: false for everything.

Copy link
Contributor

@alvicsam alvicsam left a comment

Choose a reason for hiding this comment

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

Okay, I was hoping for an easier solution. A few nits and we can merge it.

.gitlab-ci.yml Outdated Show resolved Hide resolved
.gitlab-ci.yml Show resolved Hide resolved
.gitlab-ci.yml Show resolved Hide resolved
@paritytech-ci paritytech-ci requested a review from a team January 10, 2023 10:40
.gitlab-ci.yml Outdated Show resolved Hide resolved
.gitlab-ci.yml Outdated Show resolved Hide resolved
@paritytech-ci paritytech-ci requested a review from a team January 10, 2023 11:33
Co-authored-by: Alexander Samusev <[email protected]>
@joao-paulo-parity
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 4e38342 into paritytech:master Jan 10, 2023
@joao-paulo-parity joao-paulo-parity deleted the fix branch January 10, 2023 12:01
rossbulat pushed a commit that referenced this pull request Jan 11, 2023
…13088)

* avoid unintentionally canceling the scheduled crate publishing job

because publish-crates and publish-crates-manual share the resource group
"crates-publishing", any instance of publish-crates-manual cancels a running
instance of publish-crates, as demonstrated by
https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2212179

a workaround for that unintended interaction is to avoid creating instances of
publish-crates-manual and instead require pipelines to be triggered manually by
checking $CI_JOB_MANUAL == "true"

* check manual pipelines by $CI_PIPELINE_SOURCE instead of $CI_JOB_MANUAL

* make crate-publishing pipelines uninterruptible

* use conditional includes to work around interruptible limitations

* organize comments

* remove interruptible from common pipeline

* wip: check include

* wip: check include

* fix include

* fix include

* fix include

* fix yaml

* fix yaml

* remove shared common-pipeline

* wip: retry common-pipeline

* move .default-template to .gitlab-ci.yml

* fix the pipeline

add comments

* fix default-pipeline.yml

* revert publish-crates-manual to when: manual

* move "needs:" back to publish-crates

* avoid manual repetition

* improve previous commit

* try to avoid manual repetition

* fix indentation

* minor adjustments

* move defaults to top of .gitlab-ci.yml

* fix positioning on default in the diff

* comments

* indentation

* Apply suggestions from code review

Co-authored-by: Alexander Samusev <[email protected]>

Co-authored-by: Alexander Samusev <[email protected]>
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
…aritytech#13088)

* avoid unintentionally canceling the scheduled crate publishing job

because publish-crates and publish-crates-manual share the resource group
"crates-publishing", any instance of publish-crates-manual cancels a running
instance of publish-crates, as demonstrated by
https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2212179

a workaround for that unintended interaction is to avoid creating instances of
publish-crates-manual and instead require pipelines to be triggered manually by
checking $CI_JOB_MANUAL == "true"

* check manual pipelines by $CI_PIPELINE_SOURCE instead of $CI_JOB_MANUAL

* make crate-publishing pipelines uninterruptible

* use conditional includes to work around interruptible limitations

* organize comments

* remove interruptible from common pipeline

* wip: check include

* wip: check include

* fix include

* fix include

* fix include

* fix yaml

* fix yaml

* remove shared common-pipeline

* wip: retry common-pipeline

* move .default-template to .gitlab-ci.yml

* fix the pipeline

add comments

* fix default-pipeline.yml

* revert publish-crates-manual to when: manual

* move "needs:" back to publish-crates

* avoid manual repetition

* improve previous commit

* try to avoid manual repetition

* fix indentation

* minor adjustments

* move defaults to top of .gitlab-ci.yml

* fix positioning on default in the diff

* comments

* indentation

* Apply suggestions from code review

Co-authored-by: Alexander Samusev <[email protected]>

Co-authored-by: Alexander Samusev <[email protected]>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…aritytech#13088)

* avoid unintentionally canceling the scheduled crate publishing job

because publish-crates and publish-crates-manual share the resource group
"crates-publishing", any instance of publish-crates-manual cancels a running
instance of publish-crates, as demonstrated by
https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2212179

a workaround for that unintended interaction is to avoid creating instances of
publish-crates-manual and instead require pipelines to be triggered manually by
checking $CI_JOB_MANUAL == "true"

* check manual pipelines by $CI_PIPELINE_SOURCE instead of $CI_JOB_MANUAL

* make crate-publishing pipelines uninterruptible

* use conditional includes to work around interruptible limitations

* organize comments

* remove interruptible from common pipeline

* wip: check include

* wip: check include

* fix include

* fix include

* fix include

* fix yaml

* fix yaml

* remove shared common-pipeline

* wip: retry common-pipeline

* move .default-template to .gitlab-ci.yml

* fix the pipeline

add comments

* fix default-pipeline.yml

* revert publish-crates-manual to when: manual

* move "needs:" back to publish-crates

* avoid manual repetition

* improve previous commit

* try to avoid manual repetition

* fix indentation

* minor adjustments

* move defaults to top of .gitlab-ci.yml

* fix positioning on default in the diff

* comments

* indentation

* Apply suggestions from code review

Co-authored-by: Alexander Samusev <[email protected]>

Co-authored-by: Alexander Samusev <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants