feat: container outputs and dynamic environments#591
Conversation
69e8a78 to
39973b0
Compare
There was a problem hiding this comment.
was doing some functional testing this morning and was not able to get it working with stages. i see the container being spun up, but it doesn't look like /vela/outputs/.env is being injected. i can cat it, of course.
that's not an intentional limitation, right? didn't see anything on that in the proposal or here anyway.
wass3rw3rk
left a comment
There was a problem hiding this comment.
just a question/suggestion
|
friendly reminder to also add an accompanying docs PR :D |
| } | ||
| } | ||
|
|
||
| func WithOutputCtn(ctn *pipeline.Container) Opt { |
There was a problem hiding this comment.
| func WithOutputCtn(ctn *pipeline.Container) Opt { | |
| // WithOutputCtn sets the outputs container in the executor client for Linux. | |
| func WithOutputCtn(ctn *pipeline.Container) Opt { |
| return nil | ||
| } | ||
|
|
||
| // update engine logger with secret metadata |
There was a problem hiding this comment.
| // update engine logger with secret metadata | |
| // update engine logger |
|
love it. |
I will open up a follow up issue for this. And for the comments I will open up a follow up PR shortly |
This PR introduces dynamic environments using a sidecar outputs container.
Proposal ref: go-vela/community#988
Outputs Container Image
When not set, the build will proceed just as it does today, making this feature completely opt-in and easy to turn off.
The input for
VELA_EXECUTOR_OUTPUTS_IMAGEwill be the image used for the sidecar container that is spun up next to the Vela build. At some point, this could expand to be a programmatic/plugin implementation rather than what it is in this PR — a sleeping container plugged into the volume that is polled after the conclusion of each step.In the
docker-compose.yml, I decided to just go withalpine:latest.Substitution and Injection relocation
This block has moved from
CreateSteptoExecBuildfor the Docker runtime and will now occur after polling the outputs container. This will allow for dynamic environments such as this:Updates to privileged image checking
To protect against dynamic invocations of privileged images using this new feature, parsing images to determine whether they should run will now be at runtime. The logic has moved from
AssembleBuildtoExecStep/ExecService.Unfortunately this means that builds will run up until that step is set to execute before denying it, which is a slightly worse UX but I think the tradeoff is worth it.