aws / aws/aws-codedeploy-agent

Feature request: Guarantee deployment order on race conditions

Offen
#248 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
feature-request needs triage
Vorherrschende Sprache
Rust
Sterne
337
Forks
195
Ø Merge
10 Std. 54 Min.
Gemergte PRs (30 T.)
4

Beschreibung

This is not exactly an issue for the CodeDeploy Agent itself, but rather for the product API. Anyway, I am posting it here since I hope it will make it way into the CodeDeploy product team and I don't know a better place to try. So:

When calling the CodeDeploy API to trigger a new deployment from build pipelines (GitHub Actions, in my case, if that matters), it may happen that a `CreateDeployment` call fails with a `DeploymentLimitExceededException` because another deployment is currently running.

In this case, all you can do with the [JavaScript SDK](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CodeDeploy.html) is to call the `waitFor` method to... well... wait for the current deployment to finish and then try again.

Now, with long-running deployments and/or frequent commits, this effectively makes different builds race for the next deployment to happen. The result might not be what you would expect, regarding the order of deployments as well as the final (last) deployment made.

My suggestion is to add a new, optional parameter to the `CreateDeployment` call that can pass some kind of identifier. The API could reject `CreateDeployment` calls with a dedicated error code if this parameter is not monotonically increasing with regard to the last deployment created (or the currently active deployment?).

With this, things like CI build sequence numbers, build start timestamps or similar could be used to make sure we deploy "in order", possibly skipping deployments if they have been "overtaken" by newer ones.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Diese Anfrage betrifft die CodeDeploy-Produkt-API und nicht eine Datei mit einem benannten Agenten. Beginnen Sie mit der Überprüfung des CreateDeployment-Verhaltens, von DeploymentLimitExceededException und der in der Anfrage erwähnten waitFor-Dokumentation des JavaScript SDK. Die Aufgabe wäre erst dann abgeschlossen, wenn ein API-Level-Entwurf und eine Implementierung vorliegen, die Deployments in falscher Reihenfolge garantiert zulassen oder ablehnen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, javascript
Bereich
api, cloud, devops
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
15/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.