Skip to content
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

provide no-jdk distribution #99

Open
rursprung opened this issue Jul 26, 2021 · 26 comments
Open

provide no-jdk distribution #99

rursprung opened this issue Jul 26, 2021 · 26 comments
Assignees
Labels
distributions enhancement New Enhancement help wanted Extra attention is needed triaged This issue has been reviewed by the triage team

Comments

@rursprung
Copy link
Contributor

Is your feature request related to a problem? Please describe.
we want to be able to control the JDK being used (we have our own base docker images with a JDK configured the way we want (correct vendor, up-to-date security fixes, etc.) and thus don't need a JDK to be shipped with OpenSearch.

Describe the solution you'd like
please provide a no-jdk distribution (at least of the current "minimal" distribution) which - as the name implies - does not come with a pre-packaged JDK.

Describe alternatives you've considered
downloading the existing archive and manually removing the JDK would be a huge overhead and would also make the docker image larger (if we do this in the docker image; we could of course do it in a pre-step but that'd make things even more complicated) and it would be a non-standard setup which is harder for others to replicate.

Additional context
this has been discussed in the forum: No-jdk distribution of opensearch?

@rursprung rursprung added the enhancement New Enhancement label Jul 26, 2021
@peternied peternied added the help wanted Extra attention is needed label Sep 14, 2021
@peternied
Copy link
Member

[Triage] The build process can support this, it would need to be integrated and tested so it could be released.

@peternied peternied added the triaged This issue has been reviewed by the triage team label Sep 21, 2021
@gaiksaya
Copy link
Member

[Triage] @dblock @CEHENKLE Does the opensearch-min artifact generation process (gradle) support this today?

@dblock
Copy link
Member

dblock commented Nov 16, 2021

[Triage] @dblock @CEHENKLE Does the opensearch-min artifact generation process (gradle) support this today?

AFAIK yes, but I am not familiar with details

@rursprung
Copy link
Contributor Author

out of interest: where's the code which packages the JDK with the ZIP file? is this here or in the opensearch repo? i couldn't find it in either with a cursory glance (plus i'm not certain if this is even something which could easily be contributed by somebody who doesn't have access to the complete build infrastructure as, after all, the no-jdk dist will have to be published and linked to in various places?)

@dblock
Copy link
Member

dblock commented Dec 18, 2021

It's in OpenSearch, search for no-jdk, e.g. https://github.com/opensearch-project/OpenSearch/blob/0ba0e7cc26060f964fcbf6ee45bae53b3a9941d0/qa/os/src/test/java/org/opensearch/packaging/util/Distribution.java#L60

I think the first step for this one is to produce the no-jdk distribution as part of the daily build. Probably the easiest is to always make a JDK and no-JDK build when calling gradlew assemble (a change in OpenSearch). A slightly hackier solution is to add a different gradlew assemble to https://github.com/opensearch-project/opensearch-build/blob/main/scripts/default/opensearch/build.sh#L68. We pickup everything in build/distributions, so that would just get included for the ride across all platforms/architectures.

@rursprung
Copy link
Contributor Author

i browsed around a bit and found the following relevant things:

what i haven't seen yet at first glance is where gradlew assemble would define what should be created during tests (then again, i've only been clicking around on the web UI and haven't even cloned the repo yet... i'll do that next year if nobody picks it up until then).

@rursprung
Copy link
Contributor Author

what is missing here? from what i can see there are various distribution:archives:no-jdk-* (see archives) which seem to work (i ran assemble on the windows ZIP (because i'm on windows right now) and it created a ZIP w/o the JDK in it, as expected.

based on that i'd somehow expect that now only (AWS-internal?) tooling is missing which grabs this during the release process and publishes it everywhere?

@dblock
Copy link
Member

dblock commented May 5, 2022

@rursprung I think the next step is to add it to https://github.com/opensearch-project/opensearch-build/blob/main/jenkins/opensearch/distribution-build.jenkinsfile, so it starts appearing in the build output

These currently run in a private Jenkins instance, but are this close to being run in public https://build.ci.opensearch.org/, see opensearch-project/opensearch-ci#2.

@rursprung
Copy link
Contributor Author

@rursprung I think the next step is to add it to https://github.com/opensearch-project/opensearch-build/blob/main/jenkins/opensearch/distribution-build.jenkinsfile, so it starts appearing in the build output

These currently run in a private Jenkins instance, but are this close to being run in public https://build.ci.opensearch.org/, see opensearch-project/opensearch-ci#2.

thanks, that's good news!

however, i'm not sure how much sense it'll make if i'll try to contribute to this as i can't test whether my changes to the script would work.
and, if i understood the script correctly, it'd need some changes to buildAssembleUpload (which might still be somewhere in the not-yet-opensourced part?) - but then again i admittedly don't quite see yet where the script decides which artifact to pull in (it e.g. never seems to explicitly say whether it wants x64 or arm64?).

@dblock
Copy link
Member

dblock commented May 6, 2022

@peterzhuamazon Could you help @rursprung make sense of this stuff please? This is all visible and testable, and even documented, but a bit dense ;) let's try to update the documentation as we go

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Sep 26, 2022

[Copy from another conversation]:

Hi All,

This is a rather complicated task.

Just from the top of my head you need to introduce a new param in python side to allow jdk/non-jdk input.
Then the input needs to be passed to the building script side in order to call the corresponding gradle task without jdk.
I have not check the gradle tasks yet but if I recall correctly there exists non-jdk task for tar, probably not for rpm I am not sure.

If we introduce non-jdk this needs to be discussed extensively as well as on an issue.
Since all the distributions must take this new settings in mind, not just tar.
Also, whether OSD needs nodejs bundled or not is also something to follow up, not just OS.

Adding @bbarani into the discussion on this.

Thanks,
Peter

@peterzhuamazon peterzhuamazon self-assigned this Sep 26, 2022
@rursprung
Copy link
Contributor Author

Thanks a lot for your feedback @peterzhuamazon! That does sound more complicated than it sounded initially!

I ran a quick test (on the latest main branch and on Windows) and it does seem that the standard assemble call already builds both the non-jdk as well as the bundled package (both [..]\distribution\archives\windows-zip\build\distributions\opensearch-min-3.0.0-SNAPSHOT-windows-x64.zip and [..]\distribution\archives\no-jdk-windows-zip\build\distributions\opensearch-min-3.0.0-SNAPSHOT-no-jdk-windows-x64.zip were generated). So maybe there’s no need to call a new gradle target and instead this is already part of the target being called?
There also seem to be gradle targets for no-jdk deb & rpm packages: https://github.com/opensearch-project/OpenSearch/tree/main/distribution/packages

Note that I raised the ticket explicitly for OpenSearch, not OpenSearch Dashboards – we’re currently not using that, so it’s of no relevance for me. Though I can see that the same discussion can be had there, I think it should be split away (and be driven by somebody involved in / using OpenSearch Dashboards) and could potentially also result in a different decision (AFAIK Node.JS versions are more finicky than JDK versions?).

@dblock
Copy link
Member

dblock commented Sep 27, 2022

I think the next step is to add a step to https://github.com/opensearch-project/opensearch-build/blob/main/jenkins/opensearch/distribution-build.jenkinsfile that would call these gradle tasks that exist.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Sep 27, 2022

@rursprung all the non-jdk task I have seen so far:

task logs

distribution:archives:no-jdk-darwin-tar:assemble - Assembles the outputs of this project.
distribution:archives:no-jdk-freebsd-tar:assemble - Assembles the outputs of this project.
distribution:archives:no-jdk-linux-tar:assemble - Assembles the outputs of this project.
distribution:archives:no-jdk-windows-zip:assemble - Assembles the outputs of this project.
distribution:packages:no-jdk-deb:assemble - Assembles the outputs of this project.
distribution:packages:no-jdk-rpm:assemble - Assembles the outputs of this project.
distribution:archives:no-jdk-darwin-tar:build - Assembles and tests this project.
distribution:archives:no-jdk-freebsd-tar:build - Assembles and tests this project.
distribution:archives:no-jdk-linux-tar:build - Assembles and tests this project.
distribution:archives:no-jdk-windows-zip:build - Assembles and tests this project.
distribution:packages:no-jdk-deb:build - Assembles and tests this project.
distribution:packages:no-jdk-rpm:build - Assembles and tests this project.
distribution:archives:no-jdk-darwin-tar:clean - Deletes the build directory.
distribution:archives:no-jdk-freebsd-tar:clean - Deletes the build directory.
distribution:archives:no-jdk-linux-tar:clean - Deletes the build directory.
distribution:archives:no-jdk-windows-zip:clean - Deletes the build directory.
distribution:packages:no-jdk-deb:clean - Deletes the build directory.
distribution:packages:no-jdk-rpm:clean - Deletes the build directory.
distribution:archives:no-jdk-darwin-tar:assembleDist - Assembles the main distributions
distribution:archives:no-jdk-freebsd-tar:assembleDist - Assembles the main distributions
distribution:archives:no-jdk-linux-tar:assembleDist - Assembles the main distributions
distribution:archives:no-jdk-windows-zip:assembleDist - Assembles the main distributions
distribution:packages:no-jdk-deb:assembleDist - Assembles the main distributions
distribution:packages:no-jdk-rpm:assembleDist - Assembles the main distributions
distribution:archives:no-jdk-darwin-tar:distTar - Bundles the project as a distribution.
distribution:archives:no-jdk-freebsd-tar:distTar - Bundles the project as a distribution.
distribution:archives:no-jdk-linux-tar:distTar - Bundles the project as a distribution.
distribution:archives:no-jdk-windows-zip:distTar - Bundles the project as a distribution.
distribution:packages:no-jdk-deb:distTar - Bundles the project as a distribution.
distribution:packages:no-jdk-rpm:distTar - Bundles the project as a distribution.
distribution:archives:no-jdk-darwin-tar:distZip - Bundles the project as a distribution.
distribution:archives:no-jdk-freebsd-tar:distZip - Bundles the project as a distribution.
distribution:archives:no-jdk-linux-tar:distZip - Bundles the project as a distribution.
distribution:archives:no-jdk-windows-zip:distZip - Bundles the project as a distribution.
distribution:packages:no-jdk-deb:distZip - Bundles the project as a distribution.
distribution:packages:no-jdk-rpm:distZip - Bundles the project as a distribution.
distribution:archives:no-jdk-darwin-tar:installDist - Installs the project as a distribution as-is.
distribution:archives:no-jdk-freebsd-tar:installDist - Installs the project as a distribution as-is.
distribution:archives:no-jdk-linux-tar:installDist - Installs the project as a distribution as-is.
distribution:archives:no-jdk-windows-zip:installDist - Installs the project as a distribution as-is.
distribution:packages:no-jdk-deb:installDist - Installs the project as a distribution as-is.
distribution:packages:no-jdk-rpm:installDist - Installs the project as a distribution as-is.
distribution:archives:no-jdk-darwin-tar:buildEnvironment - Displays all buildscript dependencies declared in project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:buildEnvironment - Displays all buildscript dependencies declared in project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:buildEnvironment - Displays all buildscript dependencies declared in project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:buildEnvironment - Displays all buildscript dependencies declared in project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:buildEnvironment - Displays all buildscript dependencies declared in project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:buildEnvironment - Displays all buildscript dependencies declared in project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:components - Displays the components produced by project ':distribution:archives:no-jdk-darwin-tar'. [incubating]
distribution:archives:no-jdk-freebsd-tar:components - Displays the components produced by project ':distribution:archives:no-jdk-freebsd-tar'. [incubating]
distribution:archives:no-jdk-linux-tar:components - Displays the components produced by project ':distribution:archives:no-jdk-linux-tar'. [incubating]
distribution:archives:no-jdk-windows-zip:components - Displays the components produced by project ':distribution:archives:no-jdk-windows-zip'. [incubating]
distribution:packages:no-jdk-deb:components - Displays the components produced by project ':distribution:packages:no-jdk-deb'. [incubating]
distribution:packages:no-jdk-rpm:components - Displays the components produced by project ':distribution:packages:no-jdk-rpm'. [incubating]
distribution:archives:no-jdk-darwin-tar:dependencies - Displays all dependencies declared in project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:dependencies - Displays all dependencies declared in project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:dependencies - Displays all dependencies declared in project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:dependencies - Displays all dependencies declared in project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:dependencies - Displays all dependencies declared in project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:dependencies - Displays all dependencies declared in project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:dependencyInsight - Displays the insight into a specific dependency in project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:dependencyInsight - Displays the insight into a specific dependency in project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:dependencyInsight - Displays the insight into a specific dependency in project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:dependencyInsight - Displays the insight into a specific dependency in project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:dependencyInsight - Displays the insight into a specific dependency in project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:dependencyInsight - Displays the insight into a specific dependency in project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:dependentComponents - Displays the dependent components of components in project ':distribution:archives:no-jdk-darwin-tar'. [incubating]
distribution:archives:no-jdk-freebsd-tar:dependentComponents - Displays the dependent components of components in project ':distribution:archives:no-jdk-freebsd-tar'. [incubating]
distribution:archives:no-jdk-linux-tar:dependentComponents - Displays the dependent components of components in project ':distribution:archives:no-jdk-linux-tar'. [incubating]
distribution:archives:no-jdk-windows-zip:dependentComponents - Displays the dependent components of components in project ':distribution:archives:no-jdk-windows-zip'. [incubating]
distribution:packages:no-jdk-deb:dependentComponents - Displays the dependent components of components in project ':distribution:packages:no-jdk-deb'. [incubating]
distribution:packages:no-jdk-rpm:dependentComponents - Displays the dependent components of components in project ':distribution:packages:no-jdk-rpm'. [incubating]
distribution:archives:no-jdk-darwin-tar:help - Displays a help message.
distribution:archives:no-jdk-freebsd-tar:help - Displays a help message.
distribution:archives:no-jdk-linux-tar:help - Displays a help message.
distribution:archives:no-jdk-windows-zip:help - Displays a help message.
distribution:packages:no-jdk-deb:help - Displays a help message.
distribution:packages:no-jdk-rpm:help - Displays a help message.
distribution:archives:no-jdk-darwin-tar:model - Displays the configuration model of project ':distribution:archives:no-jdk-darwin-tar'. [incubating]
distribution:archives:no-jdk-freebsd-tar:model - Displays the configuration model of project ':distribution:archives:no-jdk-freebsd-tar'. [incubating]
distribution:archives:no-jdk-linux-tar:model - Displays the configuration model of project ':distribution:archives:no-jdk-linux-tar'. [incubating]
distribution:archives:no-jdk-windows-zip:model - Displays the configuration model of project ':distribution:archives:no-jdk-windows-zip'. [incubating]
distribution:packages:no-jdk-deb:model - Displays the configuration model of project ':distribution:packages:no-jdk-deb'. [incubating]
distribution:packages:no-jdk-rpm:model - Displays the configuration model of project ':distribution:packages:no-jdk-rpm'. [incubating]
distribution:archives:no-jdk-darwin-tar:outgoingVariants - Displays the outgoing variants of project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:outgoingVariants - Displays the outgoing variants of project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:outgoingVariants - Displays the outgoing variants of project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:outgoingVariants - Displays the outgoing variants of project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:outgoingVariants - Displays the outgoing variants of project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:outgoingVariants - Displays the outgoing variants of project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:projects - Displays the sub-projects of project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:projects - Displays the sub-projects of project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:projects - Displays the sub-projects of project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:projects - Displays the sub-projects of project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:projects - Displays the sub-projects of project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:projects - Displays the sub-projects of project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:properties - Displays the properties of project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:properties - Displays the properties of project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:properties - Displays the properties of project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:properties - Displays the properties of project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:properties - Displays the properties of project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:properties - Displays the properties of project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:tasks - Displays the tasks runnable from project ':distribution:archives:no-jdk-darwin-tar'.
distribution:archives:no-jdk-freebsd-tar:tasks - Displays the tasks runnable from project ':distribution:archives:no-jdk-freebsd-tar'.
distribution:archives:no-jdk-linux-tar:tasks - Displays the tasks runnable from project ':distribution:archives:no-jdk-linux-tar'.
distribution:archives:no-jdk-windows-zip:tasks - Displays the tasks runnable from project ':distribution:archives:no-jdk-windows-zip'.
distribution:packages:no-jdk-deb:tasks - Displays the tasks runnable from project ':distribution:packages:no-jdk-deb'.
distribution:packages:no-jdk-rpm:tasks - Displays the tasks runnable from project ':distribution:packages:no-jdk-rpm'.
distribution:archives:no-jdk-darwin-tar:cleanEclipse - Cleans all Eclipse files.
distribution:archives:no-jdk-freebsd-tar:cleanEclipse - Cleans all Eclipse files.
distribution:archives:no-jdk-linux-tar:cleanEclipse - Cleans all Eclipse files.
distribution:archives:no-jdk-windows-zip:cleanEclipse - Cleans all Eclipse files.
distribution:packages:no-jdk-deb:cleanEclipse - Cleans all Eclipse files.
distribution:packages:no-jdk-rpm:cleanEclipse - Cleans all Eclipse files.
distribution:archives:no-jdk-darwin-tar:cleanIdea - Cleans IDEA project files (IML, IPR)
distribution:archives:no-jdk-freebsd-tar:cleanIdea - Cleans IDEA project files (IML, IPR)
distribution:archives:no-jdk-linux-tar:cleanIdea - Cleans IDEA project files (IML, IPR)
distribution:archives:no-jdk-windows-zip:cleanIdea - Cleans IDEA project files (IML, IPR)
distribution:packages:no-jdk-deb:cleanIdea - Cleans IDEA project files (IML, IPR)
distribution:packages:no-jdk-rpm:cleanIdea - Cleans IDEA project files (IML, IPR)
distribution:archives:no-jdk-darwin-tar:eclipse - Generates all Eclipse files.
distribution:archives:no-jdk-freebsd-tar:eclipse - Generates all Eclipse files.
distribution:archives:no-jdk-linux-tar:eclipse - Generates all Eclipse files.
distribution:archives:no-jdk-windows-zip:eclipse - Generates all Eclipse files.
distribution:packages:no-jdk-deb:eclipse - Generates all Eclipse files.
distribution:packages:no-jdk-rpm:eclipse - Generates all Eclipse files.
distribution:archives:no-jdk-darwin-tar:idea - Generates IDEA project files (IML, IPR, IWS)
distribution:archives:no-jdk-freebsd-tar:idea - Generates IDEA project files (IML, IPR, IWS)
distribution:archives:no-jdk-linux-tar:idea - Generates IDEA project files (IML, IPR, IWS)
distribution:archives:no-jdk-windows-zip:idea - Generates IDEA project files (IML, IPR, IWS)
distribution:packages:no-jdk-deb:idea - Generates IDEA project files (IML, IPR, IWS)
distribution:packages:no-jdk-rpm:idea - Generates IDEA project files (IML, IPR, IWS)
distribution:archives:no-jdk-darwin-tar:check - Runs all checks.
distribution:archives:no-jdk-freebsd-tar:check - Runs all checks.
distribution:archives:no-jdk-linux-tar:check - Runs all checks.
distribution:archives:no-jdk-windows-zip:check - Runs all checks.
distribution:packages:no-jdk-deb:check - Runs all checks.
distribution:packages:no-jdk-rpm:check - Runs all checks.
distribution:archives:no-jdk-darwin-tar:checkExtraction
distribution:archives:no-jdk-freebsd-tar:checkExtraction
distribution:archives:no-jdk-linux-tar:checkExtraction
distribution:archives:no-jdk-windows-zip:checkExtraction
distribution:packages:no-jdk-deb:checkExtraction
distribution:packages:no-jdk-rpm:checkExtraction
distribution:archives:no-jdk-darwin-tar:checkLicense
distribution:archives:no-jdk-freebsd-tar:checkLicense
distribution:archives:no-jdk-linux-tar:checkLicense
distribution:archives:no-jdk-windows-zip:checkLicense
distribution:packages:no-jdk-deb:checkLicense
distribution:packages:no-jdk-rpm:checkLicense
distribution:packages:no-jdk-deb:checkLicenseMetadata
distribution:packages:no-jdk-rpm:checkLicenseMetadata
distribution:archives:no-jdk-darwin-tar:checkNotice
distribution:archives:no-jdk-freebsd-tar:checkNotice
distribution:archives:no-jdk-linux-tar:checkNotice
distribution:archives:no-jdk-windows-zip:checkNotice
distribution:packages:no-jdk-deb:checkNotice
distribution:packages:no-jdk-rpm:checkNotice
distribution:archives:no-jdk-darwin-tar:checkPart1
distribution:archives:no-jdk-freebsd-tar:checkPart1
distribution:archives:no-jdk-linux-tar:checkPart1
distribution:archives:no-jdk-windows-zip:checkPart1
distribution:packages:no-jdk-deb:checkPart1
distribution:packages:no-jdk-rpm:checkPart1
distribution:archives:no-jdk-darwin-tar:checkPart2
distribution:archives:no-jdk-freebsd-tar:checkPart2
distribution:archives:no-jdk-linux-tar:checkPart2
distribution:archives:no-jdk-windows-zip:checkPart2
distribution:packages:no-jdk-deb:checkPart2
distribution:packages:no-jdk-rpm:checkPart2
distribution:archives:no-jdk-darwin-tar:cleanEclipseProject
distribution:archives:no-jdk-freebsd-tar:cleanEclipseProject
distribution:archives:no-jdk-linux-tar:cleanEclipseProject
distribution:archives:no-jdk-windows-zip:cleanEclipseProject
distribution:packages:no-jdk-deb:cleanEclipseProject
distribution:packages:no-jdk-rpm:cleanEclipseProject
distribution:archives:no-jdk-darwin-tar:cleanIdeaModule
distribution:archives:no-jdk-freebsd-tar:cleanIdeaModule
distribution:archives:no-jdk-linux-tar:cleanIdeaModule
distribution:archives:no-jdk-windows-zip:cleanIdeaModule
distribution:packages:no-jdk-deb:cleanIdeaModule
distribution:packages:no-jdk-rpm:cleanIdeaModule
distribution:archives:no-jdk-darwin-tar:copyEclipseSettings
distribution:archives:no-jdk-freebsd-tar:copyEclipseSettings
distribution:archives:no-jdk-linux-tar:copyEclipseSettings
distribution:archives:no-jdk-windows-zip:copyEclipseSettings
distribution:packages:no-jdk-deb:copyEclipseSettings
distribution:packages:no-jdk-rpm:copyEclipseSettings
distribution:archives:no-jdk-darwin-tar:eclipseProject - Generates the Eclipse project file.
distribution:archives:no-jdk-freebsd-tar:eclipseProject - Generates the Eclipse project file.
distribution:archives:no-jdk-linux-tar:eclipseProject - Generates the Eclipse project file.
distribution:archives:no-jdk-windows-zip:eclipseProject - Generates the Eclipse project file.
distribution:packages:no-jdk-deb:eclipseProject - Generates the Eclipse project file.
distribution:packages:no-jdk-rpm:eclipseProject - Generates the Eclipse project file.
distribution:archives:no-jdk-darwin-tar:ideaModule - Generates IDEA module files (IML)
distribution:archives:no-jdk-freebsd-tar:ideaModule - Generates IDEA module files (IML)
distribution:archives:no-jdk-linux-tar:ideaModule - Generates IDEA module files (IML)
distribution:archives:no-jdk-windows-zip:ideaModule - Generates IDEA module files (IML)
distribution:packages:no-jdk-deb:ideaModule - Generates IDEA module files (IML)
distribution:packages:no-jdk-rpm:ideaModule - Generates IDEA module files (IML)
distribution:archives:no-jdk-darwin-tar:resolveAllDependencies
distribution:archives:no-jdk-freebsd-tar:resolveAllDependencies
distribution:archives:no-jdk-linux-tar:resolveAllDependencies
distribution:archives:no-jdk-windows-zip:resolveAllDependencies
distribution:packages:no-jdk-deb:resolveAllDependencies
distribution:packages:no-jdk-rpm:resolveAllDependencies
distribution:archives:no-jdk-darwin-tar:wipeEclipseSettings
distribution:archives:no-jdk-freebsd-tar:wipeEclipseSettings
distribution:archives:no-jdk-linux-tar:wipeEclipseSettings
distribution:archives:no-jdk-windows-zip:wipeEclipseSettings
distribution:packages:no-jdk-deb:wipeEclipseSettings
distribution:packages:no-jdk-rpm:wipeEclipseSettings

@peterzhuamazon
Copy link
Member

Notable:

distribution:archives:no-jdk-darwin-tar
distribution:archives:no-jdk-linux-tar
distribution:archives:no-jdk-windows-zip
distribution:packages:no-jdk-rpm

Basically covered all the distributions we are looking at.

@rursprung
Copy link
Contributor Author

I think the next step is to add a step to https://github.com/opensearch-project/opensearch-build/blob/main/jenkins/opensearch/distribution-build.jenkinsfile that would call these gradle tasks that exist.

this is where i got stuck in may (see our comments from may 5 & 6) - i haven't seen how that build script decides what to actually build, i.e. i haven't understood what i'd have to add/change to get a no-jdk build. if you could point me in the right direction there (and tell me how to test it) that'd be great!

@dblock
Copy link
Member

dblock commented Sep 28, 2022

So from the top:

                            buildManifest(
                                componentName: "${COMPONENT_NAME}",
                                inputManifest: "manifests/${INPUT_MANIFEST}",
                                distribution: 'tar',
                                snapshot: true
                            )

This says take a manifest, e.g. https://github.com/opensearch-project/opensearch-build/blob/main/manifests/3.0.0/opensearch-3.0.0.yml and build it with build.sh ... + bunch of arguments such as the above distribution and snapshot=true/false. That iterates over components in the manifest and for each locates a build.sh. So for opensearch core it will by default call https://github.com/opensearch-project/opensearch-build/blob/main/scripts/components/OpenSearch/build.sh in which you can see a big switch that ultimately turns this into a ./gradle ... command. I think you want to start modifying that build.sh to support nojdk-tar so it can be referenced from the above snippet.

Alternatively, and possibly easier, build.sh for opensearch could always produce both a JDK and no-JDK distribution, so you would add a second line below ./gradlew :distribution:$TYPE:$TARGET:assemble -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER in https://github.com/opensearch-project/opensearch-build/blob/main/scripts/components/OpenSearch/build.sh. Then that file would be automatically collected and published next to the min distribution that we have today.

@rursprung
Copy link
Contributor Author

rursprung commented Oct 3, 2022

Alternatively, and possibly easier, build.sh for opensearch could always produce both a JDK and no-JDK distribution, so you would add a second line below ./gradlew :distribution:$TYPE:$TARGET:assemble -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER in https://github.com/opensearch-project/opensearch-build/blob/main/scripts/components/OpenSearch/build.sh. Then that file would be automatically collected and published next to the min distribution that we have today.

i've now added it on the same line even (makes the build much faster as it avoids running the other tasks twice):

./gradlew :distribution:$TYPE:$TARGET:assemble :distribution:$TYPE:no-jdk-$TARGET:assemble -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER

however, this does require that every target called this way also has a corresponding no-jdk target.
i've checked the targets in the OpenSearch repository and saw that the following are currently missing:

  • :distribution:archives:no-jdk-linux-arm64-tar
  • :distribution:archives:no-jdk-linux-s390x-tar (though the s390x platform is anyway currently unsupported by build.sh - was this intentional @pantovad (you recently introduced support for s390x with add support for s390x architecture OpenSearch#4001)) - EDIT: after further checking i just realised that s390x-tar is always a no-jdk release, i.e. the name is misleading. would it make sense to rename the target? or should there be a target with a JDK as well (= change of behaviour of the target added with the PR, so that it'll ship with a JDK and there'll be a new one without a JDK - which would be aligned with the namping pattern?)
  • :distribution:archives:no-jdk-integ-test-zip (probably not needed: integ-test-zip sounds like a special target and is unsupported in build.sh?)
  • :distribution:packages:no-jdk-arm64-deb
  • :distribution:packages:no-jdk-arm64-rpm

is there a specific reason why these do not exist or could/should they be added?

i'm also a bit surprised that for some targets there's a sub-folder with an empty build.gradle in archives and packages and for others (e.g. the s390x platform) there isn't. are these even still needed or could they be deleted to avoid confusion (i first didn't notice that platform because i looked at the folders and only looked at the actual gradle targets in a second step)? some initial tests seem to show that they're not needed (what's relevant is just the entry in settings.gradle.

suggested next steps (if you agree with them):

  1. add the missing no-jdk targets (see list above; everything but no-jdk-integ-test-zip) to OpenSearch on main & 2.x
  2. update the build.sh line here as indicated on main
  3. optional, unrelated: remove the (probably unnecessary?) empty folders for the targets in OpenSearch on main to avoid confusion in the future

does the build.sh of this repository need to be compatible with multiple OpenSearch releases (i presume so, based on the fact that it's pretty version-agnostic otherwise?). if so, would we have to add the missing no-jdk targets also to older OpenSearch releases (where applicable)?

@dblock
Copy link
Member

dblock commented Oct 3, 2022

is there a specific reason why these do not exist or could/should they be added?

I don't know of any specific reason, simply unused.

i'm also a bit surprised ...

That's because it is unused, so no "good" reason.

suggested next steps (if you agree with them):

  1. add the missing no-jdk targets (see list above; everything but no-jdk-integ-test-zip) to OpenSearch on main & 2.x
  2. update the build.sh line here as indicated on main
  3. optional, unrelated: remove the (probably unnecessary?) empty folders for the targets in OpenSearch on main to avoid confusion in the future

Sounds good!

does the build.sh of this repository need to be compatible with multiple OpenSearch releases (i presume so, based on the fact that it's pretty version-agnostic otherwise?). if so, would we have to add the missing no-jdk targets also to older OpenSearch releases (where applicable)?

We have been moving build.sh's into each repo so that it branches with the repo, and you can do the same for OpenSearch repo. The default in this repo can go away if all built branches in opensearch-project/OpenSearch have script/build.sh.

@rursprung
Copy link
Contributor Author

i've done the first and third step in the PRs opensearch-project/OpenSearch#4722 and opensearch-project/OpenSearch#4723 (the latter isn't actually relevant for this topic here, just a cleanup).

We have been moving build.sh's into each repo so that it branches with the repo, and you can do the same for OpenSearch repo. The default in this repo can go away if all built branches in opensearch-project/OpenSearch have script/build.sh.

where exactly should the file go? directly as /script/build.sh or in another location? then i'd just copy it over from the current main branch of this repository here?
and what about the other files in /scripts/components/OpenSearch? do they stay here or should they be moved as well?
do you maybe have an example PR where you already did such a move to see what should be changed?

@dblock
Copy link
Member

dblock commented Oct 11, 2022

where exactly should the file go? directly as /script/build.sh or in another location? then i'd just copy it over from the current main branch of this repository here?

Yes.

and what about the other files in /scripts/components/OpenSearch? do they stay here or should they be moved as well? do you maybe have an example PR where you already did such a move to see what should be changed?

They can stay here until there's a build.sh in all active branches of OpenSearch. We should backport build.sh all over the place, and then delete here.

@rursprung
Copy link
Contributor Author

all active branches of OpenSearch

is there a full list of those? my presumption would be that it's the following:

  • main
  • 2.x
  • 1.x

and maybe also the following?

  • 2.3
  • 2.2
  • 2.1
  • 2.0
  • 1.3

though with pure semver i don't see why they'd still be maintained (or why they exist as branches at all), as e.g. (random example) 2.4.0 with a bugfix would be a perfectly valid upgrade path for a user on 2.1.0, so no 2.1.1 would be needed. but that'd then be a discussion for elsewhere 😄

and then delete here.

does it afterwards automatically look for the correct script in the other repo or are more changes needed here (or elsewhere) than just deleting the files?

@dblock
Copy link
Member

dblock commented Oct 11, 2022

@peterzhuamazon Am I correct for the list of active branches? I don't see 1.3.x being built in that list, but I know we just released 1.3.6. Do you typically add that on demand? Should @rursprung backport build.sh changes to 1.x and 1.3 in opensearch?

rursprung added a commit to rursprung/OpenSearch that referenced this issue Oct 25, 2022
with commit e357246 the `build.sh` has been moved to this repository
and with commit dfa1118 the missing no-jdk builds have been added.
with these preliminary works done we can now start building the no-jdk
distributions as part of the release build so that they can then be
published.

this is part of opensearch-project/opensearch-build#99.

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
dblock added a commit to opensearch-project/OpenSearch that referenced this issue Oct 25, 2022
with commit e357246 the `build.sh` has been moved to this repository
and with commit dfa1118 the missing no-jdk builds have been added.
with these preliminary works done we can now start building the no-jdk
distributions as part of the release build so that they can then be
published.

this is part of opensearch-project/opensearch-build#99.

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
rursprung added a commit to rursprung/OpenSearch that referenced this issue Oct 31, 2022
…ct#4902)

with commit e357246 the `build.sh` has been moved to this repository
and with commit dfa1118 the missing no-jdk builds have been added.
with these preliminary works done we can now start building the no-jdk
distributions as part of the release build so that they can then be
published.

this is part of opensearch-project/opensearch-build#99.

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
(cherry picked from commit 8c9ca4e)
reta pushed a commit to opensearch-project/OpenSearch that referenced this issue Oct 31, 2022
with commit e357246 the `build.sh` has been moved to this repository
and with commit dfa1118 the missing no-jdk builds have been added.
with these preliminary works done we can now start building the no-jdk
distributions as part of the release build so that they can then be
published.

this is part of opensearch-project/opensearch-build#99.

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
(cherry picked from commit 8c9ca4e)
rursprung added a commit to rursprung/opensearch-build that referenced this issue Nov 1, 2022
`build.sh` has been copied over to all active branches(*) of the
OpenSearch repo and can now consequently be deleted here. this means,
that from now on, the scripts from the respository will be picked up.

for more information on the order of evaluation of the custom build
scripts, see the [documentation][].

this gives the advantage to have branch-specific new logic in place
there. this has already been used to add the no-jdk targets to the
builds on main and 2.x.

(*): the following branches have been considered as active:
- main
- 2.x
- 2.3
- 1.x
- 1.3

this is part of opensearch-project#99

[documentation]: https://github.com/opensearch-project/opensearch-build/tree/main/src/build_workflow#custom-build-scripts

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
rursprung added a commit to rursprung/opensearch-build that referenced this issue Nov 1, 2022
`build.sh` has been copied over to all active branches(*) of the
OpenSearch repo and can now consequently be deleted here. this means,
that from now on, the scripts from the respository will be picked up.

for more information on the order of evaluation of the custom build
scripts, see the [documentation][].

this gives the advantage to have branch-specific new logic in place
there. this has already been used to add the no-jdk targets to the
builds on main and 2.x.

two tests were based on the assumption that there would be a `build.sh`
for OpenSearch in this repository, however these are generic tests and
just used OpenSearch as an example. they have been switched to be based
on OpenSearch-Dashboards instead which - for the time being - still has
its own `build.sh` here.

(*): the following branches have been considered as active:
- main
- 2.x
- 2.3
- 1.x
- 1.3

this is part of opensearch-project#99

[documentation]: https://github.com/opensearch-project/opensearch-build/tree/main/src/build_workflow#custom-build-scripts

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
rursprung added a commit to rursprung/opensearch-build that referenced this issue Nov 1, 2022
`build.sh` has been copied over to all active branches(*) of the
OpenSearch repo and can now consequently be deleted here. this means,
that from now on, the scripts from the respository will be picked up.

for more information on the order of evaluation of the custom build
scripts, see the [documentation][].

this gives the advantage to have branch-specific new logic in place
there. this has already been used to add the no-jdk targets to the
builds on main and 2.x.

two tests were based on the assumption that there would be a `build.sh`
for OpenSearch in this repository, however these are generic tests and
just used OpenSearch as an example. they have been switched to be based
on OpenSearch-Dashboards instead which - for the time being - still has
its own `build.sh` here.

(*): the following branches have been considered as active:
- main
- 2.x
- 2.3
- 1.x
- 1.3

this is part of opensearch-project#99

[documentation]: https://github.com/opensearch-project/opensearch-build/tree/main/src/build_workflow#custom-build-scripts

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
rursprung added a commit to rursprung/opensearch-build that referenced this issue Nov 1, 2022
`build.sh` has been copied over to all active branches(*) of the
OpenSearch repo and can now consequently be deleted here. this means,
that from now on, the scripts from the respository will be picked up.

for more information on the order of evaluation of the custom build
scripts, see the [documentation][].

this gives the advantage to have branch-specific new logic in place
there. this has already been used to add the no-jdk targets to the
builds on main and 2.x.

two tests were based on the assumption that there would be a `build.sh`
for OpenSearch in this repository, however these are generic tests and
just used OpenSearch as an example. they have been switched to be based
on OpenSearch-Dashboards instead which - for the time being - still has
its own `build.sh` here.

(*): the following branches have been considered as active:
- main
- 2.x
- 2.3
- 1.x
- 1.3

this is part of opensearch-project#99

[documentation]: https://github.com/opensearch-project/opensearch-build/tree/main/src/build_workflow#custom-build-scripts

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
rursprung added a commit to rursprung/opensearch-build that referenced this issue Nov 1, 2022
`build.sh` has been copied over to all active branches(*) of the
OpenSearch repo and can now consequently be deleted here. this means,
that from now on, the scripts from the respository will be picked up.

for more information on the order of evaluation of the custom build
scripts, see the [documentation][].

this gives the advantage to have branch-specific new logic in place
there. this has already been used to add the no-jdk targets to the
builds on main and 2.x.

two tests were based on the assumption that there would be a `build.sh`
for OpenSearch in this repository, however these are generic tests and
just used OpenSearch as an example. they have been switched to be based
on OpenSearch-Dashboards instead which - for the time being - still has
its own `build.sh` here.

(*): the following branches have been considered as active:
- main
- 2.x
- 2.3
- 1.x
- 1.3

this is part of opensearch-project#99

[documentation]: https://github.com/opensearch-project/opensearch-build/tree/main/src/build_workflow#custom-build-scripts

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
@rursprung
Copy link
Contributor Author

rursprung commented Nov 1, 2022

@peterzhuamazon (or anyone else who knows this): is there anything else left to be done so that the files created by the build process are also published to artifacts.opensearch.org?

the other question is: where should these files be linked to? i'd suggest to just add them in the package dropdown of OpenSearch on the downloads page.
EDIT: just had a look at how the page is set up and if i saw it correctly it'd be enough to then add an additional file along the lines of this one, just specific for no-jdk? and then some site generator magic would pick it up and it'd end up in the dropdown?

@peterzhuamazon
Copy link
Member

@peterzhuamazon (or anyone else who knows this): is there anything else left to be done so that the files created by the build process are also published to artifacts.opensearch.org?

Based on the email exchange let's start some discussion on this.
I will sync up with you on the necessary steps.

cc: @setiah @bbarani

Thanks.

ashking94 pushed a commit to ashking94/OpenSearch that referenced this issue Nov 7, 2022
…ct#4902)

with commit e357246 the `build.sh` has been moved to this repository
and with commit dfa1118 the missing no-jdk builds have been added.
with these preliminary works done we can now start building the no-jdk
distributions as part of the release build so that they can then be
published.

this is part of opensearch-project/opensearch-build#99.

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributions enhancement New Enhancement help wanted Extra attention is needed triaged This issue has been reviewed by the triage team
Projects
None yet
Development

No branches or pull requests

6 participants