cyberark / conjur-service-broker

Implementation of the Open Service Broker API for Conjur

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pipeline is updated to avoid collisions

izgeri opened this issue · comments

At current, the pipeline is set up to deploy the service broker to a foundation running in AWS to run some e2e tests.

However, the service broker must be uniquely defined by its service_id and plan_id (defined here here), so if two service brokers are deployed to the same foundation, one of them will error. This means in practice that if two pipelines run at once, one of them will likely fail.

One way we can prevent this is to lock the pipeline so only one can run at a time. It will cause some PRs to have slow builds, but it will also prevent failures and reruns. You can prevent a double run by adding the following in the Jenkinsfile under options:

    lock resource: "<some static string>"

The actual string doesn't matter, but should be unique to this project. We may consider setting it to the service_id, so that its value is tied to the string val that blocks concurrent builds.

If there is a way to enable concurrent pipeline runs, that would also be nice - but if that's not simple, this can be used to improve reliability of pipelines on PRs in the nearterm.

A better reference for where the plan and service ids are defined might be https://github.com/cyberark/conjur-service-broker/blob/master/config/catalog.yml.

It at least used to be case that these had to be unique in the foundation/cluster, so we weren't able to have two parallel installations at once. If that's still the case, the lock is great idea!

Ah, thanks @micahlee!! I was looking all over for that, and the closest I found was the one I linked to. I'll update the main post to reference catalog.yml instead.