[JIRA] (JENKINS-36544) Allow setting environment variables for dynamic ec2 slaves

13 views
Skip to first unread message

alexandre.bury@gmail.com (JIRA)

unread,
Jul 8, 2016, 1:55:02 PM7/8/16
to jenkinsc...@googlegroups.com
Alexandre Bury created an issue
 
Jenkins / New Feature JENKINS-36544
Allow setting environment variables for dynamic ec2 slaves
Issue Type: New Feature New Feature
Assignee: Francis Upton
Components: ec2-plugin
Created: 2016/Jul/08 5:54 PM
Priority: Minor Minor
Reporter: Alexandre Bury

The ec2 plugin can dynamically create EC2 slaves with the given configuration.
However, this configuration does not allow to specify environment variables to be used by the newly created nodes.

I could update each created node one by one, but it seems inefficient considering more could be created when the load requires it.

Adding an option in the ec2 plugin configuration with a list of environment variable for each slave configuration would be very useful.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

ryan.wallner@clusterhq.com (JIRA)

unread,
Sep 2, 2016, 12:57:01 PM9/2/16
to jenkinsc...@googlegroups.com

kyle@lodge.glasgownet.com (JIRA)

unread,
Oct 17, 2016, 11:49:01 AM10/17/16
to jenkinsc...@googlegroups.com

This would be a very useful feature to have, as we use custom AMIs for cross compilation that all rely on having a few environment variables set.

Things like chroots, java_home, etc are all impossible just now.

tlynchpin@gmail.com (JIRA)

unread,
Aug 14, 2019, 5:35:03 PM8/14/19
to jenkinsc...@googlegroups.com

Global envvars are unable to have different values depending on the node, for example some nodes FOO=foo and others FOO=bar.

 

Can 'init script' be used to set envvars?

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

michelzanini@gmail.com (JIRA)

unread,
Sep 4, 2019, 10:05:02 AM9/4/19
to jenkinsc...@googlegroups.com

This would be a good addition to the plugin.
I use the same AMI ID, but I create different nodes with different labels, to be able to set different box sizes for different jobs matching those labels.
For example, the same AMI ID is used, to create two t3.medium with "java" label to build Java apps, and two t3.small to build node apps with "node" label.
I would like to be able to set different environment variables for them, but they are the same AMI, which makes this hard.

If we could set different Node environment variables, already supported by Jenkins, but not supported by this plugin that would solve this issue nicely.

marco.andries@itextpdf.com (JIRA)

unread,
Sep 19, 2019, 9:14:03 AM9/19/19
to jenkinsc...@googlegroups.com

We would also benefit greatly by this.

We're blocked and asked the following question to reach a work around: https://stackoverflow.com/questions/58006452/issue-setting-jenkins-environment-variables-on-ec2-fleet

 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jhansche@meetme.com (JIRA)

unread,
Feb 10, 2020, 3:18:04 PM2/10/20
to jenkinsc...@googlegroups.com

It appears that this was implemented in https://github.com/jenkinsci/ec2-plugin/pull/382
However, I don't see a way to edit the properties in the AMI template, even though the config.jelly entry is supposed to be there. Am I missing something?

jhansche@meetme.com (JIRA)

unread,
Mar 9, 2020, 11:32:05 AM3/9/20
to jenkinsc...@googlegroups.com
Joe Hansche updated an issue
 
Change By: Joe Hansche
Attachment: Screen Shot 2020-03-09 at 11.29.38 AM.png
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

jhansche@meetme.com (JIRA)

unread,
Mar 9, 2020, 4:12:04 PM3/9/20
to jenkinsc...@googlegroups.com
Joe Hansche started work on New Feature JENKINS-36544
 
Change By: Joe Hansche
Status: Open In Progress

jhansche@meetme.com (JIRA)

unread,
Mar 9, 2020, 4:12:07 PM3/9/20
to jenkinsc...@googlegroups.com

jhansche@meetme.com (JIRA)

unread,
Mar 9, 2020, 4:12:07 PM3/9/20
to jenkinsc...@googlegroups.com
Joe Hansche assigned an issue to Joe Hansche
Change By: Joe Hansche
Assignee: Francis Upton Joe Hansche

jhansche@meetme.com (JIRA)

unread,
Mar 9, 2020, 4:15:02 PM3/9/20
to jenkinsc...@googlegroups.com
Joe Hansche commented on New Feature JENKINS-36544
 
Re: Allow setting environment variables for dynamic ec2 slaves

Turns out the original PR did resolve this, but only for Jenkins versions up to and including v2.204. As of 2.205, the Configure Clouds block moved to a new page, and that broke the Node Properties block.

New PR has been opened to address this, which should now work on versions before and after 2.205: https://github.com/jenkinsci/ec2-plugin/pull/440

Reply all
Reply to author
Forward
0 new messages