-
Notifications
You must be signed in to change notification settings - Fork 3
feat: call build specific runtime functions #179
feat: call build specific runtime functions #179
Conversation
Runtime.SetupBuild
and Runtime.AssembleBuild
But it doesn't print anything for docker runtime which doesn't need it.
2d84251
to
59449bd
Compare
Many of the env vars added in PlanStep ae not available in Kubernetes because the env is immutable after pod creation. So, to make these vars available, we inject as many as possible in the CreateStep stage. STEP_STATUS and STEP_STARTED don't make sense in CreateStep, however, so we leave those out. They will just be empty for pipelines that get run by the kubernetes runtime.
So it is not an empty string. STEP_BUILD_STATUS and STEP_BUILD_STARTED cannot be populated until after the build has started (the pod exists in k8s) when each step starts. But env vars can't be updated after pod creation, so those will always show up as STEP_BUILD_STATUS=pending and STEP_BUILD_STARTED=0 to containers.
Please see go-vela/pkg-runtime#148 (comment) for more details on the |
Runtime.SetupBuild
and Runtime.AssembleBuild
go-vela/pkg-runtime#148 was merged, so this is ready for review. |
Codecov Report
@@ Coverage Diff @@
## master #179 +/- ##
==========================================
- Coverage 80.49% 79.82% -0.67%
==========================================
Files 31 31
Lines 2768 2825 +57
==========================================
+ Hits 2228 2255 +27
- Misses 451 473 +22
- Partials 89 97 +8
|
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.
Looks like the validate
workflow is still failing:
https://github.com/go-vela/pkg-executor/runs/4001465504?check_suite_focus=true
If you can't see that link, I believe the issue is with the deps in the go.sum
file.
To resolve this, you can run a make clean
👍
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.
LGTM
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.
LGTM
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.
lgtm
In kubernetes native secrets and a variety of
VELA_
variables do not get populated in the pod environment.This was happening because container environment is immutable after pod creation. So, we need to run
Runtime.SetupContainer
for all containers before we create the pod in kubernetes. Then, we have to movecontainer.Env
initialization to just before pod creation, so that all of the vars that get populated AFTERSetupContainer
make it to the container.So, I added 4 methods to the
Runtime
engine interface:SetupBuild
AssembleBuild
RemoveBuild
InspectBuild
This allows us to manage the pod at the build level instead of using heuristics to try and manage creating/removing the pod in the container management functions.
Requires: