Templatize "Container Registry" and "Image" for CI Run Steps
long-term
I
Indigo Wolverine
E.g. in this yaml:
- step:
type: Run
spec:
connectorRef: My_Artifactory_Docker
image: <+variable.my_step_runner>
For CI run steps in self managed Kubernetes, it would increase flexibility and reduce maintenance if 'connectorRef' and 'image' could be combined to a small Harness template with versioning capability. That way, we could keep a Stable version for most steps and pipelines, but create and easily test a new template version with an experimental step runner image. For example when we need to add a new dependency or base OS upgrade for our generic image, we could safely validate on one step or pipeline, then move the stable version forward and quickly update all pipelines.
Log In
N
Nofar Bluestein
long-term
I
Indigo Wolverine
Ideally, the connectorRef and image fields could be a mini-template to be used inside Run steps or even step templates. E.g. I have ~45 pipelines with multiple steps and some used nested pipeline/stage/step templates. So if I want to change the custom docker image we use to run all those steps, I'd have to edit every step or template individually. Instead, I use a project variable named
step_runner
to hold the image name. But even with that, to upgrade incrementally I'd have to edit each step individually to use a new variable such as variable.step_runner_experimental
. Then edit them again once the experimental image is "stable". Sounds like the perfect model for a mini-template where every step would point to the Stable version and I could slide that forward in one place when we're ready.It's a very similar scenario to the spec.infrastructure config that gets duplicated across many steps and could benefit from being its own mini-template. E.g.
infrastructure:
type: KubernetesDirect
spec:
connectorRef: account.vscommercesreaks
namespace: <+variable.build_namespace>
initTimeout: 4m
automountServiceAccountToken: true
tolerations:
- effect: NoSchedule
key: nodeClass
operator: Equal
value: harness-build
- effect: NoSchedule
operator: Equal
value: spot
nodeSelector:
nodeClass: harness-build
harnessImageConnectorRef: account.Global_Docker_Proxy
os: Linux
N
Nofar Bluestein
pending feedback
N
Nofar Bluestein
Hey, is your intent to create a step template ?
This is an example of a run step that templatizes the 'connectorRef' and 'image'
template:
name: template step
type: Step
projectIdentifier: playground
orgIdentifier: default
spec:
type: Run
spec:
connectorRef: <+input>
image: <+input>
shell: Sh
command: echo 'hey'
identifier: my_step
versionLabel: v1.0
Could you please elaborate on you use case? what kind of templates / steps are you trying to templatize?
Thank you
Nofar Bluestein,
CI Product Team
template:
name: template step
type: Step
projectIdentifier: playground
orgIdentifier: default
spec:
type: Run
spec:
connectorRef: <+input>
image: <+input>
shell: Sh
command: echo 'hey'
identifier: my_step
versionLabel: v1.0
Could you please elaborate on you use case? what kind of templates / steps are you trying to