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

Adds support for floating IP pools #21

Closed
wants to merge 2 commits into from

Conversation

signed8bit
Copy link
Contributor

In my environment I ran into two problems with the latest version of the plugin. The first being the inability of jclouds to create and assign a floating IP without specifying a floating ip pool. This occurred where there were no existing IPs available in the pool. The second was Jenkins not being able to launch the node via SSH due to a variable delay in a instance with a floating IP becoming accessible over SSH. This pull request contains my changes to get the plugin working and should be useful to others.

  • Adds support for selecting a floating IP pool as part of the instance
    template. The Neutron networks available in this list are ones that
    are set to external:router True.
  • Introduces a configurable delay before launching SSH slaves. This
    allows the operator to work around slow availability of SSH on the
    slave instance.

- Adds support for selecting a floating IP pool as part of the instance
  template. The Neutron networks available in this list are ones that
  are set to external:router True.

- Introduces a configurable delay before launching SSH slaves. This
  allows the operator to work around slow availability of SSH on the
  slave instance.
@@ -428,6 +435,46 @@ public ListBoxModel doFillNetworkIdItems(@RelativePath("..") @QueryParameter Str
return m;
}

public ListBoxModel doFillFloatingIpPoolIdItems(@RelativePath("..") @QueryParameter String identity,
Copy link
Member

Choose a reason for hiding this comment

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

@Restricted(NoExternalUse.class)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olivergondza Should I add that annotation to the doFillFloatingIpPoolIdItems method? I didn't see that used anywhere else in the source and this is my first time delving into Jenkins plugin development.

Copy link
Member

Choose a reason for hiding this comment

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

It is a best practice for methods that are exposed for jelly/databinding and needs to be public. This clearly declares that it is not a part of plugin API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@olivergondza
Copy link
Member

How does the problem of not available ssh manifests?

@signed8bit
Copy link
Contributor Author

In my case, the launch method will immediately fail due to a connection error. I'd tried setting the various retry options in the SSHLauncher and never really saw retries happening. Other attempts just have an ssh connection hanging seemingly indefinitely e.g. several minutes. Given enough time I could successfully launch the slave manually via the Jenkins UI.

@olivergondza
Copy link
Member

I have run into some problems with ssh Launcher not able to complete without Relaunch slave agent. It seems that when invoked from openstack plugin it is not configured to timeout/retry the connection.

I prefer a way for Jenkins to detect if the slave is ready over configurable waittimes.

@juliogonzalez
Copy link

Same problem here with the ssh launcher.

It tries to connect before the instance is ready to accept SSH connections, either because it's launching or not even connected to the network (connection refused sometimes, no route to host other times), and it doesn't retry anymore.

@signed8bit
Copy link
Contributor Author

I agree that a more nuanced, intelligent approach is the right path forward for solving this. I will see if I can rework this request to address that.

@olivergondza
Copy link
Member

@signed8bit, I have implemented the pool selection in #46 and created #54 to cover the ssh launch problem. Closing the PR if you do not mind.

@signed8bit
Copy link
Contributor Author

Thanks @olivergondza I'll give the latest a go and see how it works in our environment.

@olivergondza
Copy link
Member

Do not hurry deploying to production, there as some things to fix before 2.1.

@signed8bit
Copy link
Contributor Author

Gotcha. Nope going to experiment with it in my test infrastructure first. Our target cloud has moved from Havana to Icehouse so I am curious if our SSH delay needs are as drastic as they were before.

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.

None yet

3 participants