Skip to content

Conversation

@Dohbedoh
Copy link
Contributor

@Dohbedoh Dohbedoh commented Sep 10, 2025

Testing done

  • Only Unit Tests
  • TODO: EC2 provisioning with different strategies

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@Dohbedoh
Copy link
Contributor Author

  • First commit to reproduce the issue and also check that testcontainers works in CI environment
  • Second commit will demonstrate the fix

@Dohbedoh
Copy link
Contributor Author

Dohbedoh commented Sep 10, 2025

I do not have an environment set up for EC2. I need a but more time to do manual testing.
Maybe the maintainers @jenkinsci/ec2-plugin-developers can help ?

@mwebber
Copy link

mwebber commented Sep 10, 2025

@Dohbedoh I have an EC2 environment that I can use for testing, if you can give me a download link for the updated plugin.

@Dohbedoh
Copy link
Contributor Author

@mwebber
Copy link

mwebber commented Sep 10, 2025

@Dohbedoh I tested your 2028.v430f54b_d2b_9d version. Unfortunately there's still a problem.

It's better: an existing Agents (EC2 instances) that are currently stopped are currently started and used.
However, it I start a pipeline that needs an Agent type for which there are no existing instances, it fails to start and use a new instance. Here's the Jenkins log:

Sep 10, 2025 3:12:45 PM INFO hudson.plugins.ec2.EC2Cloud provision
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. Attempting to provision agent needed by excess workload of 1 units

Sep 10, 2025 3:12:45 PM INFO hudson.plugins.ec2.SlaveTemplate getImage
Getting image for request DescribeImagesRequest(ExecutableUsers=[], ImageIds=[], Owners=[self], Filters=[Filter(Name=description, Values=[Jenkins_Agent/OEDPipeline_v2/x86_64])])

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate logProvisionInfo
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. Considering launching

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate setupRootDevice
AMI had /dev/xvda

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate setupRootDevice
EbsBlockDevice(DeleteOnTermination=true, Iops=3000, SnapshotId=snap-0f779b4f95ea20ffb, VolumeSize=8, VolumeType=gp3, Throughput=125, Encrypted=false)

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate setupRootDevice
Request had /dev/xvda

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate logProvisionInfo
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. EBS default encryption value set to: Based on AMI (null)

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate logProvisionInfo
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. Setting Instance Initiated Shutdown Behavior : ShutdownBehavior.Stop

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate logProvisionInfo
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. Looking for existing instances with describe-instance: DescribeInstancesRequest(Filters=[Filter(Name=image-id, Values=[ami-0ec97eadd82b04955]), Filter(Name=instance-type, Values=[z1d.large]), Filter(Name=key-name, Values=[TransformService-DEV-ControllerToAgent]), Filter(Name=availability-zone, Values=[us-east-1d]), Filter(Name=tenancy, Values=[default]), Filter(Name=subnet-id, Values=[subnet-0c412b529608b4a7c]), Filter(Name=instance.group-id, Values=[sg-09697908f06666b67]), Filter(Name=tag:Department, Values=[OxfordLanguages]), Filter(Name=tag:Name, Values=[TransformService-DEV/Agent-OEDPipeline-x86_64-ephemeral-Matthew]), Filter(Name=tag:OLMonitoringLabel, Values=[TransformService_Agent_OEDPipeline/x86_64]), Filter(Name=tag:Environment, Values=[Development]), Filter(Name=tag:jenkins_slave_type, Values=[demand_Pipeline(x86_64)-Matthew]), Filter(Name=tag:jenkins_server_url, Values=[https://transformation-service.dev.oxfordlanguages.com/]), Filter(Name=tag:Application, Values=[TS-OEDPipeline]), Filter(Name=tag:jenkins_cloud_name, Values=[OED])])

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.SlaveTemplate logProvisionInfo
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. Jenkins attempted to reserve 1 instances and received this EC2 exception: Network interfaces and an instance-level subnet ID may not be specified on the same request (Service: Ec2, Status Code: 400, Request ID: 1093a99a-44e9-46fb-b8aa-4656fc7b793c) (SDK Attempt Count: 1)

Sep 10, 2025 3:12:46 PM WARNING hudson.plugins.ec2.EC2Cloud provision
SlaveTemplate{description='Pipeline(x86_64)-Matthew', labels='x86_64 OEDPipeline-matthew'}. Exception during provisioning
software.amazon.awssdk.services.ec2.model.Ec2Exception: Network interfaces and an instance-level subnet ID may not be specified on the same request (Service: Ec2, Status Code: 400, Request ID: 1093a99a-44e9-46fb-b8aa-4656fc7b793c) (SDK Attempt Count: 1)
	at PluginClassLoader for aws-java-sdk2-ec2//software.amazon.awssdk.services.ec2.model.Ec2Exception$BuilderImpl.build(Ec2Exception.java:113)
	at PluginClassLoader for aws-java-sdk2-ec2//software.amazon.awssdk.services.ec2.model.Ec2Exception$BuilderImpl.build(Ec2Exception.java:61)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.retryPolicyDisallowedRetryException(RetryableStageHelper.java:168)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:73)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:36)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:53)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:35)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:82)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:62)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:43)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:50)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:32)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:210)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:173)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:80)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
	at PluginClassLoader for aws-java-sdk2-core//software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
	at PluginClassLoader for aws-java-sdk2-ec2//software.amazon.awssdk.services.ec2.DefaultEc2Client.runInstances(DefaultEc2Client.java:39697)
	at PluginClassLoader for ec2//hudson.plugins.ec2.SlaveTemplate.provisionOndemand(SlaveTemplate.java:2208)
	at PluginClassLoader for ec2//hudson.plugins.ec2.SlaveTemplate.provisionOndemand(SlaveTemplate.java:2128)
	at PluginClassLoader for ec2//hudson.plugins.ec2.SlaveTemplate.provision(SlaveTemplate.java:1887)
	at PluginClassLoader for ec2//hudson.plugins.ec2.EC2Cloud.getNewOrExistingAvailableSlave(EC2Cloud.java:1013)
	at PluginClassLoader for ec2//hudson.plugins.ec2.EC2Cloud.provision(EC2Cloud.java:1040)
	at hudson.slaves.Cloud.provision(Cloud.java:228)
	at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:728)
	at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:327)
	at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:825)
	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:92)
	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Sep 10, 2025 3:12:46 PM INFO hudson.plugins.ec2.EC2Cloud provision

We have now 10 computers, waiting for 0 more

@Dohbedoh
Copy link
Contributor Author

I merged the branch with the latest master. It was missing the commit 19e816a.

New incrementals: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/ec2/2032.v4d8865268e1f/. I will try to test it as well today.

@mwebber
Copy link

mwebber commented Sep 11, 2025

The 2032.v4d8865268e1f version seemed OK in my (fairly basic) testing. Thanks!

@SciPlayD
Copy link

The 2032.v4d8865268e1f version also seemed OK in my (fairly basic) testing. Thanks!

@res0nance res0nance merged commit 92a4be7 into jenkinsci:master Sep 16, 2025
17 checks passed
@Dohbedoh Dohbedoh deleted the JENKINS-76083 branch September 18, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants