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-56839] Allow disabling T2/T3 Unlimited Mode for T3 instances #375

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Tblue
Copy link
Contributor

@Tblue Tblue commented Jun 27, 2019

Quoting the JIRA issue:

AWS' new T3 instance type is set to run with T2/T3 Unlimited enabled.

The way that the current EC2 plugin is designed, we cannot create T3 slaves which have Unlimited disabled. The EC2 plugin has a checkbox to enable/disable. However, it uses the default if this is unchecked.

The EC2 plugin should probably take that setting exactly and use it to set the value. Thus, to use T3 instances with bursting, the Jenkins admin must manually check the box.

Alternatively, you could have a drop-down with options like: 1. Enabled 2. Disabled 3. Instance-type default

This pull request implements the latter suggestion. Instead of a simple checkbox for Unlimited Mode, there now is a drop-down, allowing the administrator to choose whether to explicitly enable/disable Unlimited Mode, or whether to use the AWS default for the chosen instance type (by not specifying any preference for Unlimited Mode when creating instances).

The old boolean setting is migrated to preserve existing configurations.

Previously, it was only possible to either explicitly enable Unlimited
Mode, or use the AWS default ("unlimited" for T3 and T3a instances, and
"standard"/limited for T2 instances).
@Tblue
Copy link
Contributor Author

Tblue commented Jun 27, 2019

It seems like the Windows node used to run checks for pull requests is unreliable:

[2019-06-27T10:37:27.401Z] win2012-467eb0 was marked offline: Connection was broken: java.util.concurrent.TimeoutException: Ping started at 1561631607399 hasn't completed by 1561631847400

Is there any way for me to trigger a re-build? I logged into ci.jenkins.io, but don't seem to have the necessary permissions.

@res0nance
Copy link
Contributor

Close and open PR should trigger a rebuild

Copy link
Contributor

@res0nance res0nance left a comment

Choose a reason for hiding this comment

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

I'm a little concerned that this will break backwards compatibility with JCasC. You should also deprecate the current constructor instead of modifying it as it breaks backwards compatibility with groovy scripts

@thoulen
Copy link
Contributor

thoulen commented Jun 30, 2019

I would prefer to use a simple solution, that is to set the value all the time and not to change the interface

@Tblue
Copy link
Contributor Author

Tblue commented Jul 1, 2019

@thoulen, all right, I can do that.

@Tblue
Copy link
Contributor Author

Tblue commented Jul 4, 2019

@thoulen: While implementing your suggestion, testing showed that AWS allows specifying a CPU credit option (i. e. the Unlimited Mode option) only for T2/T3 instances. Specifying any CPU credit option for other instance types, no matter the value of the option, leads to AWS rejecting the API request: The only solution is to not specify any CPU credit option at all in this case.

So it looks like we do need the "Use Instance Type Default" option after all so that people can properly use instance types other than T2/T3.

@res0nance: I'm not familar with JCasC, but shouldn't things continue working as-is as long as burstableUnlimitedMode is unset in the JCasC configuration file? I will see if I can add a test for that. I will also look into your other suggestions -- thanks!

@thoulen
Copy link
Contributor

thoulen commented Jul 4, 2019

Thanks for the try

@thoulen thoulen closed this Jul 4, 2019
@thoulen thoulen reopened this Jul 4, 2019
@Tblue
Copy link
Contributor Author

Tblue commented Jul 4, 2019

The build is failing because https://repo.azure.jenkins.io/ seems to be experiencing issues. :(

- Deprecate old constructor instead of modifying it (and use the old
  one where appropriate).
- Resolve burstableUnlimitedMode in readResolve().
@@ -175,7 +181,8 @@ public SlaveTemplate(String ami, String zone, SpotConfiguration spotConfig, Stri
String instanceCapStr, String iamInstanceProfile, boolean deleteRootOnTermination,
boolean useEphemeralDevices, boolean useDedicatedTenancy, String launchTimeoutStr, boolean associatePublicIp,
String customDeviceMapping, boolean connectBySSHProcess, boolean monitoring,
boolean t2Unlimited, ConnectionStrategy connectionStrategy, int maxTotalUses) {
boolean t2Unlimited, BurstableUnlimitedMode burstableUnlimitedMode, ConnectionStrategy connectionStrategy,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder whether t2Unlimited should maybe be removed completely from this constructor and be made into a (deprecated) DataBoundSetter instead (to make it clear that t2Unlimited is deprecated; its presence in the DataBoundConstructor signature might be confusing).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized that this would break the migration of t2Unlimited, unless we move that from readResolve() back to e. g. getBurstableUnlimitedMode()... So let's leave things like they are for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do it this way, it removes the Deprecated field from the ctor to make it less confusing.

this.connectionStrategy = ConnectionStrategy.backwardsCompatible(this.usePrivateDnsName, this.connectUsingPublicIp, this.associatePublicIp);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, right. I will look into that.

@Tblue
Copy link
Contributor Author

Tblue commented Jul 4, 2019

@res0nance: I addressed your suggestions; please have a look.

@res0nance res0nance added the enhancement Feature additions or enhancements label Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature additions or enhancements
Projects
None yet
3 participants