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

[JENKINS-44104] - Add optional support of downloading new Remoting versions from master #724

Open
oleg-nenashev opened this issue May 7, 2017 · 9 comments

Comments

@oleg-nenashev
Copy link
Member

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.

@lemeurherve lemeurherve transferred this issue from jenkinsci/docker-inbound-agent Jan 16, 2024
@zhan9san
Copy link
Contributor

It can be done by pass VERSION as an argument when building an image.

ARG VERSION=3261.v9c670a_4748a_9

Can we close this issue?

@MarkEWaite
Copy link
Contributor

@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?

@zhan9san
Copy link
Contributor

Hi @MarkEWaite

Let me try to understand this case.

User 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.

Possible Solution

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.

@MarkEWaite
Copy link
Contributor

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.

@dduportal
Copy link
Contributor

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.

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?

@zhan9san
Copy link
Contributor

zhan9san commented Aug 25, 2024

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.

@dduportal
Copy link
Contributor

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?

@zhan9san
Copy link
Contributor

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.

@dduportal
Copy link
Contributor

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants