-
Notifications
You must be signed in to change notification settings - Fork 329
Introduce Generations for Mutable Deployments #1298
Conversation
6f123a3
to
be47a50
Compare
seq = g.InitialSequence | ||
} | ||
|
||
return "v" + strconv.FormatUint(seq, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For mutable deploys with a generation ID, should we append something like latest
after v<generation-id>
onto the URL to show they will share the same URL for future deploys?
Deployment URL: https://namely-adapting-poodle--v1-latest.waypoint.run
Or maybe even just latest
instead of v1
if it never changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see where a plugin might do in-place deploys but want to increment the generation id, so maybe something like v<gen-id>-latest
would work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generation IDs are long UUIDs though so that'd be a pretty wild URL I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, ok. Yeah maybe not then 😅
- Generate a default if not set - Index it
Since some ops like PushedArtifact doesn't support generations.
be47a50
to
22040a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had been using this after testing the nomad jobspec and k8s apply plugins. Looks good to me and works as expected.
Do you plan on opening a PR for the SDK changes before merging these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
// Init the metadata | ||
msg, err := op.Init(a) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
|
||
// Get our hooks | ||
hooks := op.Hooks(a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this need to move because of the added functionality to reinit components, or is this a "this should have been here all along" thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this was necessary for the init change, I updated the comment on init to reflect why hopefully (basically adding the semantics that Init is always called first before any other callback)
Thins looks great! Just a question on this: for easier debugging, should we output the generation UUID in the CLI success message? |
plugin/kubernetes-apply: Apply a directory of YAML or JSON files
Nomad Jobspec Plugin
The UUIDs aren't currently useful for anything (they don't show up in the UI, you can't look things up with them via the API, etc.) so at the moment I think no. I do think showing the UUIDs in some way for the UI, or some other visual marker or grouping that an operation is all part of the same generation, would be helpful. I think this may require some API changes but happy to do so and discuss that. |
Fixes #1235
This introduces the core concept of a "generation." Deployments can optionally advertise a "generation". Two operations that operate on the same generation expect that underlying resources were mutated rather than replaced. This enables plugins such as Nomad jobspec where the job specification updates a deployment in place. This will in the future enable support for raw Kubernetes apply, Helm charts, etc. as well.
The behavior of matching generations in a nutshell:
waypoint up
shows output to let the user know the URL will be the same and it was updated in place.