Open oleg-nenashev opened 7 years ago
It can be done by pass VERSION
as an argument when building an image.
Can we close this issue?
@zhan9san I believe that the request is to download the new remoting version when the container is run rather than when the container is built. Doesn't the ARG VERSION
require a rebuild of the container image?
Hi @MarkEWaite
Let me try to understand this case.
If a image tag, jenkins/inbound-agent:3261.v9c670a_4748a_9-2-jdk21
is used, and there is a new version such as 3262.xxx
is released in https://github.com/jenkinsci/remoting/releases, the user does not want to rebuild the inbound-agent
image but expects to use the 3262.xxx
of remoting
.
I think the only way we can do it is to add some logic in entrypoint, jenkins-agent
.
Add an environment variable JENKINS_AGENT_VERSION
, and compare it with the remoting version in image.
If it matches, do noting.
If not, download the specified version and overwrite the existing one.
I'd like to hear your feedback.
I think that your idea would work, though I'm not that we want to add this suggested enhancement in any case. Replacing the version of remoting inside the agent container seems worse (to me) that expecting that the user will configure the remoting / agent version explicitly.
If a image tag,
jenkins/inbound-agent:3261.v9c670a_4748a_9-2-jdk21
is used, and there is a new version such as3262.xxx
is released in https://github.com/jenkinsci/remoting/releases, the user does not want to rebuild theinbound-agent
image but expects to use the3262.xxx
ofremoting
.
That is true, but in that case, the user should track the image tag version and is expected to update it to jenkins/inbound-agent:3262.xxx
=> for 99% of the cases at least.
But let's consider you're using the :latest
tag, in that case that would make sense to provide an optional "Retrieve last version". Of course the tagged version could benefit from this feature.
However it should not enabled by default. It's really important otherwise the default behavior stopped to be deterministic. It would be a huge source of breakage, hard to reproduce or debug.
Something like this could probably work:
$ docker run --rm --env JENKINS_USE_AGENT_FROM_CONTROLLER=true jenkins/inbound-agent:3261.v9c670a_4748a_9-2-jdk21
# ... Download agent.jar version from the agent with a log message informing the user that specified agent version is overided)
WDYT?
That is true, but in that case, the user should track the image tag version and is expected to update it to jenkins/inbound-agent:3262.xxx => for 99% of the cases at least.
Totally agree with you. If the tag version is not the same as the one really using, it would introduce confusion.
docker run --rm --env JENKINS_USE_AGENT_FROM_CONTROLLER=true jenkins/inbound-agent:3261.v9c670a_4748a_9-2-jdk21
it would introduce confusion also.
I find the original request is for compatibility
In my option, the remoting version should be set explicitly.
Generally, if we upgrade jenkins controller, we have to test the compatibility firstly, whether the remoting works with both old and new version of controller before upgrade.
I'm sorry I don't understand what you are asking for then.
If you want the remoting version XX
then you only use the Docker image jenkins/inbound-agent:XX
no?
That is the whole reason why using this Docker image should be done with tags.
I might be missing something: can you elaborate on the root problem?
The request is from https://github.com/jenkinsci/docker-agent/issues/724#issue-2085104406
IIUC, the request expects to overwrite the remoting version in image to another one which is from Jenkins controller.
I think we should reject it as well.
The request is from #724 (comment)
IIUC, the request expects to overwrite the remoting version in image to another one which is from Jenkins controller.
I think we should reject it as well.
Oh my bad, i understand now. I agree with you, the issue should be refused !
See https://issues.jenkins-ci.org/browse/JENKINS-44104
There was an attempt to do it in jenkinsci/docker-inbound-agent#19, but it was rejected. This update should be optional.