• Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ec2-plugin
    • None

      Update the EC2 plugin to use the AWS SDK for Java 2.x as provided by the AWS SDK for Java 2.x API plugin

      Confirm that the EC2 plugin works as expected.

          [JENKINS-73640] Update EC2 plugin to use AWS SDK for Java 2.x

          Basil Crow added a comment -

          dduportal That sounds great! When you're ready, you should be able to install the latest incremental build from https://github.com/jenkinsci/ec2-plugin/pull/1021. Please also ensure that the aws-credentials, aws-global-configuration, and AWS Java SDK 2 plugins are all upgraded to the latest versions (and aws-java-sdk2-sts is uninstalled). I can debug any issues related to the v2 upgrade, but I won't be able to help with issues that are also present in the v1 SDK.

          Basil Crow added a comment - dduportal That sounds great! When you're ready, you should be able to install the latest incremental build from https://github.com/jenkinsci/ec2-plugin/pull/1021 . Please also ensure that the aws-credentials , aws-global-configuration , and AWS Java SDK 2 plugins are all upgraded to the latest versions (and aws-java-sdk2-sts is uninstalled). I can debug any issues related to the v2 upgrade, but I won't be able to help with issues that are also present in the v1 SDK.

          Basil Crow added a comment -

          Deployed version 1793.vd89384144eb_d to Incrementals with the fix for JENKINS-75014. Download link:

          Plugin Installation Manager input format: (documentation): ec2:incrementals;org.jenkins-ci.plugins;1793.vd89384144eb_d

          Basil Crow added a comment - Deployed version 1793.vd89384144eb_d to Incrementals with the fix for JENKINS-75014 . Download link: ec2 Plugin Installation Manager input format: ( documentation ): ec2:incrementals;org.jenkins-ci.plugins;1793.vd89384144eb_d

          basil Unfortunately, that did not work. I get the same error message and I triple-checked that the correct versions were installed and that STS was not.

          I think this might be a cross-account issue, because it works when using the same account the Jenkins controller is located and has an IAM role in, but not in any other account.

          Denis Blanchette added a comment - basil Unfortunately, that did not work. I get the same error message and I triple-checked that the correct versions were installed and that STS was not. I think this might be a cross-account issue, because it works when using the same account the Jenkins controller is located and has an IAM role in, but not in any other account.

          Basil Crow added a comment -

          dblanchette Interesting, I am not very familiar with AWS but I will try to think about this some more. I re-read the code in createCredentialsProvider and found what I think is a bug in how we create the default credentials provider chain. I fixed that in https://github.com/jenkinsci/ec2-plugin/pull/1021/commits/bbe92168a2072d30c1cf72f7f39b37c97cee2014 so maybe you could try again once the build completes and a new incremental is available.

          Basil Crow added a comment - dblanchette Interesting, I am not very familiar with AWS but I will try to think about this some more. I re-read the code in createCredentialsProvider and found what I think is a bug in how we create the default credentials provider chain. I fixed that in https://github.com/jenkinsci/ec2-plugin/pull/1021/commits/bbe92168a2072d30c1cf72f7f39b37c97cee2014 so maybe you could try again once the build completes and a new incremental is available.

          basil It took me a while, but I found the issue. Our controller node is in another region than the agents we are launching. There are places in the code where we pass the default EC2 endpoint (when no override is set). This does not work without a region in a cross-region context.

          I fixed it so that we get the first of: the override endpoint (if provided), the endpoint with the region (if a region has been provided), or the default region-less endpoint.

          I tested a local build with my changes on our former production instance and it works. I tested the "Test Connection" and "Check AMI" buttons, the population of the regions in the dropdown, launching instances in the same account/region (instance profile), and launching instances in a different account and region (instance profile + role).

          My changes are here: https://github.com/coveord/ec2-plugin/tree/fix/JENKINS-73640. Like last time, I made them on top of your branch, so they should merge without issues. Bear in mind I'm more of a Python developer, so I might have made some changes that are not idiomatic. I also left a TODO in the code (I don't know how regions work in Eucalyptus).

          Happy holidays!

          Denis Blanchette added a comment - basil It took me a while, but I found the issue. Our controller node is in another region than the agents we are launching. There are places in the code where we pass the default EC2 endpoint (when no override is set). This does not work without a region in a cross-region context. I fixed it so that we get the first of: the override endpoint (if provided), the endpoint with the region (if a region has been provided), or the default region-less endpoint. I tested a local build with my changes on our former production instance and it works. I tested the "Test Connection" and "Check AMI" buttons, the population of the regions in the dropdown, launching instances in the same account/region (instance profile), and launching instances in a different account and region (instance profile + role). My changes are here: https://github.com/coveord/ec2-plugin/tree/fix/JENKINS-73640 . Like last time, I made them on top of your branch, so they should merge without issues. Bear in mind I'm more of a Python developer, so I might have made some changes that are not idiomatic. I also left a TODO in the code (I don't know how regions work in Eucalyptus). Happy holidays!

          Basil Crow added a comment -

          I also left a TODO in the code (I don't know how regions work in Eucalyptus).

          Eucalyptus seems dead. I filed https://github.com/jenkinsci/ec2-plugin/pull/1027 to flense it. That should eliminate this TODO.

          Basil Crow added a comment - I also left a TODO in the code (I don't know how regions work in Eucalyptus). Eucalyptus seems dead. I filed https://github.com/jenkinsci/ec2-plugin/pull/1027 to flense it. That should eliminate this TODO.

          Basil Crow added a comment -

          dblanchette I cleaned up the region code and deployed version 1796.vdd7f420b_9298 to Incrementals. Can you please give it a try? Download link:

          Plugin Installation Manager input format: (documentation): ec2:incrementals;org.jenkins-ci.plugins;1796.vdd7f420b_9298

          Basil Crow added a comment - dblanchette  I cleaned up the region code and deployed version 1796.vdd7f420b_9298 to Incrementals. Can you please give it a try? Download link: ec2 Plugin Installation Manager input format: ( documentation ): ec2:incrementals;org.jenkins-ci.plugins;1796.vdd7f420b_9298

          basil Thank you! I installed the incremental in our instance and I confirm it works.

          Denis Blanchette added a comment - basil Thank you! I installed the incremental in our instance and I confirm it works.

          Basil Crow added a comment -

          Thanks dblanchette! Is anyone else interested in doing some more real-world testing of this plugin on AWS SDK for Java v2?

          Basil Crow added a comment - Thanks dblanchette ! Is anyone else interested in doing some more real-world testing of this plugin on AWS SDK for Java v2?

          Laszlo Gaal added a comment -

          Hi basil ;

          my apologies for not getting back to you earlier; life has kept me entertained in various other ways.

          However, starting this weekend I'll probably have some bandwidth to test the plugin. Is this one (https://issues.jenkins.io/browse/JENKINS-73640?focusedId=451499&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-451499 ) still the latest version I should grab?
          I'll scan the whole thread for dependency installtion instructions, but I may come back with newbie questions, as I've only used plugins from the official released plugins list so far.

          Last but not least: thank a lot for picking this up and keeping the the gate open for new EC2 functionality, it is highly appreciated!

          Laszlo Gaal added a comment - Hi basil ; my apologies for not getting back to you earlier; life has kept me entertained in various other ways. However, starting this weekend I'll probably have some bandwidth to test the plugin. Is this one ( https://issues.jenkins.io/browse/JENKINS-73640?focusedId=451499&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-451499 ) still the latest version I should grab? I'll scan the whole thread for dependency installtion instructions, but I may come back with newbie questions, as I've only used plugins from the official released plugins list so far. Last but not least: thank a lot for picking this up and keeping the the gate open for new EC2 functionality, it is highly appreciated!

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: