New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-48135] Support multiple containers in declarative pipeline #306
Conversation
Using the yaml syntax
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. This defaultContainer
could be useful as well for regular podTemplate.
I wouldn't know how to do implement |
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.
Why the move to YAML? Just because it's more Kubernetes-ish? Because it doesn't feel Pipeline-ish at all.
wouldn't at that point you want to put the kube ish yaml in a yaml file and have the pipeline just point to it? vs a mix of syntaxes in a string |
@abayer because this has been a pain, new java code needs to be written for each possible kubernetes api option. Unless there is a way to generate the Java model automatically from Kubernetes this is always lacking all sorts of features from k8s API @michaelneale I think that's the preferred option, you can use |
@carlossg Ok - I know that can be a pain. So you don't actually parse the YAML, you just pass it off to Kubernetes directly? If so, I think I could write up some code to let you specify the YAML equivalent in Declarative syntax and translate it into a YAML string, if that'd be of any interest to you. Would make sense as a followup, though. |
The possibility to have the Kubernete configuration in a seperate file should be kept tho, such configurations can become quite big and complex and it bloats the Jenkinsfile. |
sort of, I load it with the kubernetes-client java library kubernetes-plugin/src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplateBuilder.java Line 206 in 097922e
That gives me model objects, but those are outside the plugin (not jenkins annotated) Ideally the yaml would be kept in a separate file next to |
Very interested in this PR as well, we really want to use declarative pipelines as well, but currently the fact that every docker image is the same leads to awkward install steps in each container. Additionally, we currently have to use Also +1 on having the yaml file separate, but if this is a big effort I'd be quite happy about inline yaml as a first step and maybe adding the extraction later. Since everything seems green in this PR, do we have an ETA for when this can/will be merged already? Thanks a bunch and really looking forward! |
Hi, is there a way to not enforce in a declarative pipeline the initial container closure? It would be great to have an agent at pipeline level that can be used in most of the stages but doesn't collide with other agents that might be defined in parallel steps or at specific stage level. The problem with enforcing the initial closure is that if you want to run a stage in another node that is not a container it will break. So it would be really cool if we could have a solution that allows this, as it will optimize the pipelines by reducing the waiting time of procuring an agent. Currently the only way of avoiding this collisions is by defining agents at stage level that is not very optimal and time consuming. Many Thanks in advance. |
@dcarbajosa not following, any example ? maybe better to follow up in jenkins-user mailing list |
Can we define parent podTemplate in a shared library for declarative pipelines with out using jenkins config for "inheritFrom" feature? Let me put the same question like this, Is there any other way rather than defining parent pod template in jenkins config for declarative pipelines and get inherited with child pod defined in yaml in jenkinsfile? |
So a merge was made, but wasn't the fix? Any plans for this? |
Actually I have the same question here. |
Using the yaml syntax
JENKINS-48135
Supersedes #260
Example: