-
Notifications
You must be signed in to change notification settings - Fork 277
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
Switching to multi-JDK image, enriching build manifest with desired JDK version #769
Conversation
942ea57
to
4632a62
Compare
@peterzhuamazon @dblock what do you think about this solution guys? Ideally, it would be great to pick the JDK right from the branch itself (.ci/java-versions.properties), but the checkout is buried deeply in the build scripts so it is not possible to get there from the |
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.
I think it's alright, but I wonder whether we can get closer to what GHA does?
ci:
image:
- multi-whatever-docker-container-thing
env:
- JAVA_HOME=...
Putting those in the manifest would make Jenkinsfile a lot lighter. The environment should be loaded and set when executing the build.
@dblock I think your idea is good but would make maintaining / updating images challenging - it is in one place now, but we would have to update each and every manifest otherwise. Also, I think the manifests are high level in a sense they say what is needed but not how to get that: for example |
We should not be updating manifests for versions that have been released. Hence the manifest sort of needs to know which VM it was built against, or it might need more fixes to work on a newer VM when we decide to backport, for example, a security patch.
I understand and agree. That's why GHA came up with a concept of actions that abstract this completely. That's totally fine by me if we implement that in Python. I would just not add this logic into Jenkinsfile because it quickly becomes a huge mess. You could introduce a In general though, we're reinventing GHA and that concept and product has been exceptional IMO, we just weren't able to use it because reasons. I'd stick close to that. |
Oh, right, the manifests are for exact versions, agree with you, a bit lost which Jenkinsfile is for what, in this case we could certainly have images included in the manifest, @peterzhuamazon, any objection from your side?
I would +1 following GHA idioms. But I am completely lost in Python, it goes way beyond my expertise, @peterzhuamazon could you give me a hand here? I can definitely implement the @dblock thank you, I was looking also into |
I'd be happy to help. Try getting the image going and I can take care of dependences on top of that?
|
…DK version Signed-off-by: Andriy Redko <[email protected]>
ad0863d
to
bdcedc2
Compare
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.
I like this better!
Needs to propagate to OpenSearch Dashboards Jenkinsfile.
Add some rudimentary tests for the name and args in Python.
|
||
dockerImage = "${manifest.ci?.image?.name}" | ||
// If the 'image' key is not present, it is populated with "null" string | ||
if (dockerImage == null || dockerImage == "null") { |
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.
Let's hard fail here and require the image in CI?
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.
👍
Signed-off-by: Andriy Redko <[email protected]>
84ffba6
to
13de88b
Compare
Signed-off-by: Andriy Redko <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #769 +/- ##
=======================================
Coverage 91.30% 91.30%
=======================================
Files 75 75
Lines 1990 2002 +12
=======================================
+ Hits 1817 1828 +11
- Misses 173 174 +1
Continue to review full report at Codecov.
|
Signed-off-by: Andriy Redko <[email protected]>
@dblock seems like all your comments have been addressed with respect to new |
Are you trying to ask what change have I done to that Jenkins Agent? |
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.
👏 nice work @reta, you just learned Python :)
@@ -21,13 +21,36 @@ pipeline { | |||
} | |||
} | |||
} | |||
stage('detect Docker image + args to use for the build') { |
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.
How do we reuse things in Jenkins 💭
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.
One I know of is by using pipeline libraries
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.
Someone will have to show us how :)
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.
It sadly needs access to Jenkins instance and happens at job / pipeline level
@peterzhuamazon more precisely, if these agents use the same CI multi-jdk images you've published or different ones? |
They use the one you define in the Jenkinsfile. |
@peterzhuamazon Sorry, I am not following, this is a complete Jenkinsfile (https://github.com/opensearch-project/OpenSearch/blob/main/Jenkinsfile), it uses labelled agents which have to be provided by Jenkins.
|
The docker image will run in those agent you defined. Edit: ignore my comments I was not getting what @reta means earlier. |
@peterzhuamazon thank you, to completely erase the confusion, what |
We are using freestyle in Jenkins to build dashboards min, which we still need to convert to pipeline Jenkinsfile. Thanks. |
@peterzhuamazon Is this good to merge? Needs your approval. |
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.
Thanks.
Signed-off-by: Andriy Redko [email protected]
Description
Use new CI Docker images, enriching build manifest with desired JDK version. The build manifest has been enriched with new optional section
ci
:This build manifest is being read in preparation to running Jenkins job and the its JDK version, if specified, is enforced (the defaults stay unchanged and use JDK-14).
Issues Resolved
Part of #732
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.