Comments (14)
What is the issues with using
tool
?
It is not tool
itself per se, it is the downloads from every build to some Internet location controlled by someone else—a URL that could break at any time, or suddenly impose rate limiting to the ci.jenkins.io IP address, etc. And it is pretty silly when we have the required tool already available to the agent—we just need to point to it.
If we adjust the path, is it ok to define the PATH/JAVA_HOME variables at agent level
Well that would be the option to adjust images. I am guessing it would be simpler to just adjust buildPlugin.groovy
etc. to select the desired tool path from a single image.
from pipeline-library.
not sure if needed for container images as they will only have one java version installed.
Right, we only need to change how VM agents work:
pipeline-library/vars/buildPlugin.groovy
Line 44 in 83d5819
from pipeline-library.
We should pack the JDK & Maven into VMs, not just container images, or at a minimum offer our own (e.g., Artifactory) download locations rather than using public URLs.
We already do that, should be fine to just remove them.
from pipeline-library.
We already do that
And are they in $PATH
/ %Path%
? If so it would suffice to simply delete tool
steps and associated code.
from pipeline-library.
hmm, https://github.com/jenkins-infra/packer-images/blob/main/scripts/ubuntu-20-provision.sh#L121-L139
https://github.com/jenkins-infra/packer-images/blob/main/scripts/windows-2019-provision.ps1#L82
maybe not, would probably be simpler if we built an image per java version, otherwise they are all installed and the path needs to be manipulated.
cc @dduportal
for the kubernetes pods / aci it should all work fine as there'll only be one installed
from pipeline-library.
simpler if we built an image per java version, otherwise they are all installed and the path needs to be manipulated
Adjusting the path should be easy enough I guess.
from pipeline-library.
I got 2 question in order to move forward:
- What is the issues with using
tool
? (I never used it before on my own controllers but I don't see immediatly the challenge) - If we adjust the path, is it ok to define the PATH/JAVA_HOME variables at agent level (so we would avoid the complexity of maintining multiple VM images, and we would use the Casc config to define different agent templates with the same VM image but different Java default version)?
from pipeline-library.
I've started working on this one.
The main challenge is to maintain the "datasource" that will list the java installation paths per Operating System (and per java version).
This datasource can be represented with a 2-levels map such as the following:
def javaSetups = [
jdk8: [
windows: 'C:\\Tools\\jdk8u302-b08',
linux: "/opt/jdk8u302-b08",
],
jdk11: [
windows: 'C:\\Tools\\jdk-11.0.12+7',
linux: "/opt/jdk-11.0.12+7/bin/java",
],
jdk17: [
windows: 'C:\\Tools\\jdk-17+35',
linux: "/opt/jdk-17+35/bin/java",
],
]
But it means that we must update this map each time there is a JDK upgrade on the VM templates.
- It's the same challenge as today's tool though
- It should be automatable through our current process that checks for "latest template version" to update the ci.jenkins.io's template IDs
=> What do you think about keep using the "tool" setup but disable the automatic download and use the JAVA_HOME path instead (in the tool configuration) ?
- CasC managed so the update can be synchronized with agent template's update on a single PR
- can be overriden per controller (not only ci.jenkins.io uses this shared library)
- no need to update the shared library groovy code on each JDK upgrade
- The tool already defines tools per platform (based on agent labels) so it already holds the datasource for us and it should avoid messing with PATH names (slash? antislash, etc.)
from pipeline-library.
I would just extract it out to a major version level
/opt/java-8
/opt/java-11
/opt/java-17
We don't need the minor version in the path, installers don't include it.
from pipeline-library.
What do you think about keep using the "tool" setup but disable the automatic download
That could work, if you can somehow arrange for each VM agent to get a https://javadoc.jenkins.io/hudson/tools/ToolLocationNodeProperty.html with suitable configuration.
I think it would be simpler, though, to just use generic permanent paths like /opt/jdk-8
and hard-code those into the library. No need to mess with CasC.
from pipeline-library.
Gotcha. Started jenkins-infra/packer-images#103 to have a set of static paths on the VMs to get started.
Next steps:
- Same for container images
- Define tools with the static path (still worth it to avoid unneeded downloads from untrusted sources)
- Define static paths on the library here
from pipeline-library.
not sure if needed for container images as they will only have one java version installed.
as we take them (mostly) from upstream.
from pipeline-library.
Wip in #231
from pipeline-library.
Fixed by #231
from pipeline-library.
Related Issues (17)
- Extend configuration with `testsCategories` parameter HOT 1
- `maven` label broken HOT 2
- Pipeline succeeds with failure during incremental upload HOT 2
- Feature Request(buildand publichDocker) allow testing images of PRs in the `jenkins4eval` namespace HOT 3
- tune the number of forks run for surefire HOT 1
- [buildAndPublishDocker] error when recording lint results when the docker image name contains `:`
- Plugin does not build on Jenkins HOT 8
- `buildDockerAndPublishImage` fails at `GitHub Release` stage if there are more than one "next" draft releases HOT 1
- buildDockerAndPublishImage: manage "monorepo" with a new `multipleSemverImagesBuild` parameter
- Default `buildPlugin()` and `buildPluginWithGradle()` to Java 11 HOT 10
- feature request: allow running `updatecli()` in the current agent
- cleanup request: replace all the `readYaml()` occurences by an agent command (`yq`, `sed`, whatever) HOT 27
- Allow to add a `skip-updatecli` label on pull requests to avoid failing builds when introducing new files HOT 5
- Don't fail builds if hadolint logs something on the "info" level HOT 5
- Library build fails on Java 17 HOT 3
- Usage of deprecated `publishCoverage` step in `buildPlugin()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pipeline-library.