-
Notifications
You must be signed in to change notification settings - Fork 57
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
Environment mapping broken when using multiple odsComponentPipelines #394
Comments
@segfault16 hmmmm - this was never really supported - sort of luck that it worked... it's a pretty big change to make this fly on master again. Is this critical, or do you have a way to split this up? The above will also not work in the context of the release manager.. @michaelsauter fyi |
@clemensutschig I guess we could attempt to reset the registry at the start in the component pipeline if we are not in an orchestration context? |
@michaelsauter - that's an idea :) do we have this problem somewhere else? ... the fix is very surgical- just remove the if ... but again - in the above case - this is not working with the release manager... |
Yes, no idea how to make the above work with the release manager :) So not sure we actually want to open that box and support multiple pipelines officially ... would there be a way for you to achieve the same result within one pipeline? One question toward that end: Why are you building the builder image in |
@michaelsauter - yes - we will not open the can |
I assume this will fail in https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/orchestration/util/MROPipelineUtil.groovy#L353 - or only deliver the last artifacts ... no idea ... I'll try it Correction : this works :) (at least on my not latest master) :) I copied the odsPipelineStage and the last build / deployments where taken... @michaelsauter - can you fix this as part of your open PR ... :) |
I'm building it every run since I want the tooling to be up to date with what we have in our git repository. We're using the same Dockerfile for generating code on local dev and thus can make sure that every developer has the exact same environment (as with multistage docker files for the separate components). This is also why I want to keep this image in the same repo as the components. Building each run in general doesn't add too much overhead since docker caching mechanisms generally work very well and with FE build times for the optimised prod code being long anyway the time to build this image is negligible. @michaelsauter FYI not using release manager. My requirements are pretty basic and pretty simple:
|
@michaelsauter - that would lean itself towards re-init Openshift service in the NON mro case ... |
@segfault16 Can you explain the "chicken-egg problem"? I am not sure I understand why you cannot put the following into the main pipeline, before you run the other stuff?
@clemensutschig Yes, we can re-init OpenShiftService, that probably won't hurt. But you still might run into more problems down the road ... |
@michaelsauter the snippet you mentioned builds docker-registry.default.svc:5000/biob-cd/proto-codegen:latest, which is used as a container in the agent for this pipeline. |
@michaelsauter @clemensutschig
In general I think it's a good idea to use singletons only where necessary (as might be in the advanced orchestration case) but rely on dependency injection otherwise. |
@segfault16 Ah, now I got it. The only way around it would be to do the build steps you are running to generate Injecting the service registry is not possible, as the only means to communicate between orchestration pipeline and component pipeline is via env vars (as the orchestration pipeline just executes the Jenkinsfile of the component). Resetting like mentioned above in non-MRO case would unblock you, so maybe we just do that - even though that does not mean using multiple pipelines is a supported use case ... sorry :( |
@michaelsauter - did you fix this along the way now? |
No, this isn't fixed yet. I have been thinking about this a little. As you know, my original approach was to put the project into the Wit that in mind, I can either "just get it to work" by resetting the OpenShiftService in the non-MRO case, or I can change the approach to just always pass the project ... hmm :) I want to work on the Jenkins plugins issue today, so I'll leave this open for now. |
In one of my Jenkinsfile I'm utilising two consecutive ODS pipelines to
The Jenkinsfile looks something like this:
In the second pipeline the
odsComponentStageBuildOpenShiftImage
instageBackend
andstageFrontend
is executed with target projectcd
instead oftest
ordev
as specified in the odsComponentPipeline.This is due to the OpenShiftService being registered only once:
https://github.com/opendevstack/ods-jenkins-shared-library/blob/ea285ce/src/org/ods/component/Pipeline.groovy#L124-L132
The text was updated successfully, but these errors were encountered: