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

Added EXECUTOR_COUNT to environment variables #106

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

Conversation

ArturHarasimiuk
Copy link

It may be reasonable to check executor count of currently used master/slave agent. This PR exposes this as environment variable.

Copy link
Member

@dwnusbaum dwnusbaum left a comment

Choose a reason for hiding this comment

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

Seems reasonable, although I'm curious what your use case is. Is there a corresponding JENKINS issue?

@@ -100,6 +100,29 @@
r.assertLogContains("My number on a slave is 0", r.assertBuildStatusSuccess(p.scheduleBuild2(0)));
}

/**
* Verifies if EXECUTOR_COUNT environemn variable is set
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Verifies if EXECUTOR_COUNT environemn variable is set
* Verifies if EXECUTOR_COUNT environment variable is set

@ArturHarasimiuk
Copy link
Author

ArturHarasimiuk commented Jun 11, 2019

I don't have corresponding Jenkins JIRa, at least I didn't look for this.
Having agents with different HW configuration and different number of executors. My sample usages are:

  1. when monitoring ccache usage during build, it is not reliable with more than one executor because of concurrent accesses from parallel builds and race condition during ccache stats cleaning and read.
  2. tune behavior to reduce system load by reducing parallelism

Signed-off-by: Artur Harasimiuk <[email protected]>
@jglick
Copy link
Member

jglick commented Jun 11, 2019

EXECUTOR_NUMBER is defined in Jenkins core and implemented there for freestyle builds. I do not think Pipeline builds should have this feature unless it is also added for freestyle.

ArturHarasimiuk added a commit to ArturHarasimiuk/jenkins that referenced this pull request Jun 14, 2019
ArturHarasimiuk added a commit to ArturHarasimiuk/jenkins that referenced this pull request Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants