Queue CodeBuild tasks
Asked Answered
P

2

7

Is there are way to make a CodeBuild project execute build tasks one at a time (max concurrency = 1)?

I know one of the selling points of CodeBuild is that you can run builds concurrently and I like that feature.

However, for this one specific project, I NEED to make sure only one CodeBuild build task for this project executes at a time. If there is an incoming "startBuild" request while a previous request is still running, I want it to be queued and wait until the previous build task if finished.

As additional info on the project, this project runs integration tests across our various APIs (serverless APIs and legacy APIs on EC2) and running those tests concurrently may cause the tests to fail due to their setup and teardown procedures.

Plourde answered 19/12, 2017 at 16:48 Comment(0)
P
2

Update (2021-02-17)

AWS CodeBuild just added the ability to define a maximum number of concurrent builds per project.

enter image description here

Reference: https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-console.html#create-project-console-project-config

Plourde answered 17/2, 2021 at 0:12 Comment(2)
This does not solve OPs problem. Sure, it limits the number of builds running at the same time, but whilst a build is running, you cannot queue another build.Bunchy
As @MrPablo says, this does not actually queue builds. The AWS docs state "If the build project has a concurrent build limit set, builds return an error if the number of running builds reaches the concurrent build limit for the project. For more information, see Enable concurrent build limit." Reference - docs.aws.amazon.com/codebuild/latest/userguide/…Bitchy
S
4

I am from the AWS CodeBuild team. Thanks for your feedback. At this point the feature you requested isn't supported. We'll pass along the feedback to our product management team so they may consider adding it to our future roadmap.

However, you maybe able to implement something at your end by using CodeBuild's Build notifications feature. At a high level, you could listen to the CloudWatch Events sent by CodeBuild to find when a build completes, and at that time "release" a new build from a queue that you maintain at your end.

Saxecoburggotha answered 19/12, 2017 at 20:24 Comment(1)
This is still missing and much needed, any progress?Ahwaz
P
2

Update (2021-02-17)

AWS CodeBuild just added the ability to define a maximum number of concurrent builds per project.

enter image description here

Reference: https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-console.html#create-project-console-project-config

Plourde answered 17/2, 2021 at 0:12 Comment(2)
This does not solve OPs problem. Sure, it limits the number of builds running at the same time, but whilst a build is running, you cannot queue another build.Bunchy
As @MrPablo says, this does not actually queue builds. The AWS docs state "If the build project has a concurrent build limit set, builds return an error if the number of running builds reaches the concurrent build limit for the project. For more information, see Enable concurrent build limit." Reference - docs.aws.amazon.com/codebuild/latest/userguide/…Bitchy

© 2022 - 2024 — McMap. All rights reserved.