-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Intrapipeline Queueing (#16) * documentation: update comments * feat: add internal queue * Job, Command, Renames / Recontextulization (#18) * feat: renames * feat: add ability to ignore specific workflows * fix: formatting * fix: shellcheck * fix: job name * fix: shellcheck * Validate Queue Behavior (#19) * feat: ensure we can validate the correct ordering of jobs * fix: rename to the correct pipeline to ignore * debugging * fix: debug * walk back validation * feat: update documentation * Update src/jobs/global-queue.yml Co-authored-by: Andy Horner <[email protected]> * Update src/commands/global_block.yml Co-authored-by: Andy Horner <[email protected]> --------- Co-authored-by: Andy Horner <[email protected]>
- Loading branch information
1 parent
369a5f8
commit 96876d5
Showing
16 changed files
with
409 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test-global-queue: | ||
./src/scripts/test.sh global-queue.sh | ||
|
||
test-pipeline-queue: | ||
./src/scripts/test.sh pipeline-queue.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
description: > | ||
When used, this command blocks the assigned workflow from running until all previous (global) workflows have completed. | ||
This ensures only one instance of a given workflow is running at a time across all defined branches. | ||
parameters: | ||
debug: | ||
type: boolean | ||
default: false | ||
description: "When enabled, additional debug logging with be output." | ||
time: | ||
type: string | ||
default: "10" | ||
description: "Number of minutes to wait for a lock before giving up." | ||
dont-quit: | ||
type: boolean | ||
default: false | ||
description: "If true, forces the job through once time expires instead of failing." | ||
only-on-branch: | ||
type: string | ||
default: "*" | ||
description: "Only queue on specified branch" | ||
confidence: | ||
type: string | ||
default: "1" | ||
description: > | ||
Due to concurrency issues, the number of times should we requery the pipeline list to ensure previous jobs are "pending", | ||
but not yet active. This number indicates the threshold for API returning no previous pending pipelines. | ||
Default is `1` confirmation, increase if you see issues. | ||
ignored-workflows: | ||
type: string | ||
default: "" | ||
description: Comma separated list of workflow names to ignore as blocking workflows for the global queue. | ||
include-on-hold: | ||
type: boolean | ||
default: false | ||
description: Consider `on-hold` workflows waiting for approval as running and include them in the queue. | ||
|
||
steps: | ||
- run: | ||
name: Block execution until the current workflow is at the front of the line | ||
environment: | ||
CONFIG_DEBUG_ENABLED: "<< parameters.debug >>" | ||
CONFIG_TIME: "<< parameters.time >>" | ||
CONFIG_DONT_QUIT: "<< parameters.dont-quit >>" | ||
CONFIG_ONLY_ON_BRANCH: "<< parameters.only-on-branch >>" | ||
CONFIG_CONFIDENCE: "<< parameters.confidence >>" | ||
CONFIG_IGNORED_WORKFLOWS: "<< parameters.ignored-workflows >>" | ||
CONFIG_INCLUDE_ON_HOLD: " << parameters.include-on-hold >>" | ||
command: <<include(scripts/global-queue.sh)>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
description: > | ||
This command blocks execution of a workflow within the context of a given pipeline. | ||
parameters: | ||
debug: | ||
type: boolean | ||
default: false | ||
description: "When enabled, additional debug logging with be output." | ||
confidence: | ||
type: string | ||
default: "1" | ||
description: > | ||
Due to concurrency issues, the number of times should we requery the pipeline list to ensure previous jobs are "pending", | ||
but not yet active. This number indicates the threshold for API returning no previous pending pipelines. | ||
Default is `1` confirmation, increase if you see issues. | ||
steps: | ||
- run: | ||
name: Blocking execution until the current workflow is the last to run in the given pipeline. | ||
environment: | ||
CONFIG_DEBUG_ENABLED: "<< parameters.debug >>" | ||
CONFIG_CONFIDENCE: "<< parameters.confidence >>" | ||
command: <<include(scripts/pipeline-queue.sh)>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
description: > | ||
This job ensures only a single defined global workflow is running at a given point in time. | ||
docker: | ||
- image: cimg/base:stable | ||
resource_class: small | ||
|
||
parameters: | ||
debug: | ||
type: boolean | ||
default: false | ||
description: "When enabled, additional debug logging with be output." | ||
time: | ||
type: string | ||
default: "10" | ||
description: "Number of minutes to wait for a lock before giving up." | ||
dont-quit: | ||
type: boolean | ||
default: false | ||
description: "If true, forces the job through once time expires instead of failing." | ||
only-on-branch: | ||
type: string | ||
default: "*" | ||
description: "Only queue on specified branch" | ||
confidence: | ||
type: string | ||
default: "1" | ||
description: > | ||
Due to concurrency issues, the number of times should we requery the pipeline list to ensure previous jobs are "pending", | ||
but not yet active. This number indicates the threshold for API returning no previous pending pipelines. | ||
Default is `1` confirmation, increase if you see issues. | ||
ignored-workflows: | ||
type: string | ||
default: "" | ||
description: Comma separated list of workflow names to ignore as blocking workflows for the global queue. | ||
include-on-hold: | ||
type: boolean | ||
default: false | ||
description: Consider `on-hold` workflows waiting for approval as running and include them in the queue. | ||
|
||
steps: | ||
- global_block: | ||
debug: << parameters.debug >> | ||
time: << parameters.time >> | ||
dont-quit: << parameters.dont-quit >> | ||
only-on-branch: << parameters.only-on-branch >> | ||
confidence: << parameters.confidence >> | ||
ignored-workflows: << parameters.ignored-workflows >> | ||
include-on-hold: << parameters.include-on-hold >> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
description: > | ||
This job prevents a workflow within a given pipeline from running until all previous workflows have completed. | ||
docker: | ||
- image: cimg/base:stable | ||
resource_class: small | ||
|
||
parameters: | ||
debug: | ||
type: boolean | ||
default: false | ||
description: "If enabled, DEBUG messages will be logged." | ||
confidence: | ||
type: string | ||
default: "1" | ||
description: > | ||
Due to concurrency issues, how many times should we requery the pipeline list to ensure previous jobs are "pending", | ||
but not yet active. This number indicates the threshold for API returning no previous pending pipelines. | ||
Default is one confirmation, increase if you see issues. | ||
steps: | ||
- pipeline_block: | ||
debug: <<parameters.debug>> | ||
confidence: <<parameters.confidence>> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.