Skip to content

[JENKINS-48050] introduce "container" agent type#255

Closed
ndeloof wants to merge 8 commits intojenkinsci:masterfrom
ndeloof:master
Closed

[JENKINS-48050] introduce "container" agent type#255
ndeloof wants to merge 8 commits intojenkinsci:masterfrom
ndeloof:master

Conversation

@ndeloof
Copy link
Copy Markdown

@ndeloof ndeloof commented Mar 13, 2018

ndeloof added 2 commits March 1, 2018 15:35
introduce ContainerAgentProvisioner extension point
default implementation based on docker-plugin

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@abayer abayer requested review from abayer and rsandell March 13, 2018 21:32
@abayer
Copy link
Copy Markdown
Member

abayer commented Mar 14, 2018

Needs a time stamped SNAPSHOT of docker-plugin deployed and used as the dependency.

Copy link
Copy Markdown
Member

@abayer abayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is work in progress, but it really, really needs tests.

}
}

public static ContainerAgentProvider getProvider() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get some javadoc here and elsewhere to explain what these are doing?

/**
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
*/
public class ContainerAgentProvider {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely needs javadoc since there’s nothing actually in here to help figure it out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see this is incomplete - this looks, from other code, to actually be an extension point?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would "Provides ContainerAgent" javadoc be really helpful here ?
isn't class name obvious ?

Comment thread pipeline-model-definition/pom.xml Outdated
<dependency>
<groupId>io.jenkins.docker</groupId>
<artifactId>docker-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the time stamped snapshot version here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct me if I'm wrong, but we don't publish timestamped snapshots for plugins' pull-request builds
https://ci.jenkins.io/job/Plugins/job/docker-plugin/job/JENKINS-48050/8/console

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. You need to do a mvn deploy by hand. Also, make sure these new dependencies are in dependencyManagement in the parent pom.

-->

<p>
The job or stage will run within a Docker container.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a config.jelly for supporting the changes coming in #250

ndeloof added 3 commits March 14, 2018 14:00
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
Copy link
Copy Markdown
Author

ndeloof commented Mar 14, 2018

I know this is work in progress, but it really, really needs tests.

see 6bd5444

@abayer
Copy link
Copy Markdown
Member

abayer commented Mar 14, 2018

@ndeloof Thanks - still needs more tests for making sure things like environment interact properly, stage-level agents...it would be great to see if https://issues.jenkins-ci.org/browse/JENKINS-48319 and https://issues.jenkins-ci.org/browse/JENKINS-46831 are issues with container or not, etc.

@ndeloof
Copy link
Copy Markdown
Author

ndeloof commented Mar 14, 2018

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@abayer
Copy link
Copy Markdown
Member

abayer commented Mar 14, 2018

@ndeloof I’d still like to see tests in Declarative itself.

@ndeloof
Copy link
Copy Markdown
Author

ndeloof commented Mar 15, 2018

JENKINS-48319, JENKINS-46831: those are irrelevant with container agents are those are just plain agents, without anything shared between a "top level" and "stage" agent. container probably won't address the use case those issues have been reported for. We could write a test case for them with plain label agent as well, this would not demonstrate anything has been fixed.

@abayer
Copy link
Copy Markdown
Member

abayer commented Mar 15, 2018

I’d still like tests demonstrating that the issues are not relevant for the container implementation. It’s always better to overdo it with tests than to miss something.

@abayer
Copy link
Copy Markdown
Member

abayer commented Mar 15, 2018

And again, please do a mvn deploy of docker-plugin yourself, and use the timestamp SNAPSHOT version as the dependency here.

private String registryCredentials;

@DataBoundConstructor
public ContainerAgent(@Nonnull String image) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need some more setters/fields - String type for overriding the default container implementation, for certain, and probably some way to specify sidecar containers and a way to specify implementation-specific configuration.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sidecar containers is out of scope for JENKINS-48050 phase 1
(but easy to add later)
I don't understand the need for "type". All implementation should create the exact same container deployment, just using distinct API (i.e docker or kubectl)

}

@Extension
public static class DescriptorImpl extends Descriptor<ContainerAgentProvider> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a @Symbol for use in specifying an overriding implementation.

this.registry = registry;
}

public ContainerAgentProvider getProvider() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this same logic in FolderConfig too.

@abayer
Copy link
Copy Markdown
Member

abayer commented Mar 15, 2018

Please fix the findbugs error and the failing unit tests. Thanks.

pipeline-model to define abstract "container" agent
and docker-plugin or kubernetes-plugin for implementation
@bitwiseman
Copy link
Copy Markdown
Contributor

@ndeloof @abayer @jglick
It's been over a year since last update. Should we close or move this forward?

@jglick
Copy link
Copy Markdown
Member

jglick commented May 28, 2019

@bitwiseman FWIW my counterproposal is jenkinsci/docker-plugin#681. Anything to put a nail in the coffin of docker-workflow (jenkinsci/docker-workflow-plugin#148 (comment)).

@ndeloof
Copy link
Copy Markdown
Author

ndeloof commented Sep 6, 2019

inactive, feel free to take over

@ndeloof ndeloof closed this Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants