• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • jenkins master: LTS 1.121.1
      gce plugin: 1.0.4
      packer: 1.2.4

      Hi! 

      I'm follow this guide for plugin: [https://cloud.google.com/solutions/using-jenkins-for-distributed-builds-on-compute-engine

      We have some automation for creating new google images with packer.

      We use packer json template parameter: "image_name": "<static-prefix>-timestamp".

      But we still need choose "Image name" from the list manually. 

      Could you please to add regex form for gce plugin "Image name" parameter?
      We can use pattern "^<some-prefix>-.*" and get the latest google image for slaves every time without manual operations.

       

          [JENKINS-52651] Support regex for "Image name" parameter

          Karol Lassak added a comment - - edited

          Better option would be to allow usage of families of images..

           

          Then you could just add family name for your image and it would choose last on for you..

          Karol Lassak added a comment - - edited Better option would be to allow usage of families of images..   Then you could just add family name for your image and it would choose last on for you..

          Karol Lassak added a comment -

          Family is better option..

          Karol Lassak added a comment - Family is better option..

          Rachel Yen added a comment -

          We have that now with templates. Will that suffice?

          Rachel Yen added a comment - We have that now with templates. Will that suffice?

          dmitrii dudin added a comment -

          I can't check because i got an error after update GCE plugin 1.0.7 -> 1.0.8
          ```
          WARNING: Error provisioning node
          com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
          {
          "code" : 400,
          "errors" : [

          { "domain" : "global", "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.", "reason" : "invalid" }

          ],
          "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed."
          }
          at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
          at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
          at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
          at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
          at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
          at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
          at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
          at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
          at com.google.jenkins.plugins.computeengine.client.ComputeClient.insertInstance(ComputeClient.java:345)
          at com.google.jenkins.plugins.computeengine.InstanceConfiguration.provision(InstanceConfiguration.java:287)
          at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.provision(ComputeEngineCloud.java:159)
          at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715)
          at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320)
          at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61)
          at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)
          at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
          at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          ```

          dmitrii dudin added a comment - I can't check because i got an error after update GCE plugin 1.0.7 -> 1.0.8 ``` WARNING: Error provisioning node com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.", "reason" : "invalid" } ], "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed." } at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) at com.google.jenkins.plugins.computeengine.client.ComputeClient.insertInstance(ComputeClient.java:345) at com.google.jenkins.plugins.computeengine.InstanceConfiguration.provision(InstanceConfiguration.java:287) at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.provision(ComputeEngineCloud.java:159) at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715) at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320) at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61) at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72) at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ```

          Rachel Yen added a comment -

          Were you trying to use a template? What exactly were you trying to do that created this error?

          Rachel Yen added a comment - Were you trying to use a template? What exactly were you trying to do that created this error?

          Rachel Yen added a comment -

          Closing as templates are fixed now and will address your issues.

           

          If you need to re-open, please see the following as we are migrating off JIRA:

          https://github.com/jenkinsci/google-compute-engine-plugin/issues

          Rachel Yen added a comment - Closing as templates are fixed now and will address your issues.   If you need to re-open, please see the following as we are migrating off JIRA: https://github.com/jenkinsci/google-compute-engine-plugin/issues

            zombiemoose Rachel Yen
            ramzol dmitrii dudin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: