Skip to content

Configuring the Jenkins Controller's Node default configurations

TerrenceMcGuinness-NOAA edited this page Oct 1, 2024 · 2 revisions

Inform the Jenkins administrator to ensure that the necessary environment variables and paths are set up correctly on the Jenkins agent nodes. This can be done by configuring the environment directly in the Jenkins agent configuration or by using a global environment script that is sourced by the Jenkins agent.

Method 1: Configure Environment Variables in Jenkins Agent Configuration

  1. Go to Jenkins Web Interface:

    • Open the Jenkins web interface.
  2. Navigate to the Node Configuration:

    • Go to Manage Jenkins > Manage Nodes and Clouds.
    • Select the node you want to configure.
  3. Configure Node Properties:

    • Click on Configure for the selected node.
    • In the Node Properties section, check the Environment Variables option.
    • Add the necessary environment variables, such as MODULE_GWSETUP_PATH.

Method 2: Use a Global Environment Script

  1. Create a Global Environment Script:

    • Create a script that sets up the necessary environment variables and paths. For example, create a script named setup_environment.sh:
      #!/bin/bash
      export MODULE_GWSETUP_PATH="$HOMEgfs/modulefiles"
      module use "${MODULE_GWSETUP_PATH}"
      module load "module_gwsetup.gaea"
  2. Ensure the Script is Sourced by Jenkins Agent:

    • Inform the Jenkins administrator to source this script in the shell initialization files (e.g., .bashrc, .bash_profile, or .profile) on the Jenkins agent nodes. For example, add the following line to .bashrc:
      source /path/to/setup_environment.sh

Method 3: Use Jenkins Global Tool Configuration

  1. Go to Jenkins Web Interface:

    • Open the Jenkins web interface.
  2. Navigate to Global Tool Configuration:

    • Go to Manage Jenkins > Global Tool Configuration.
  3. Add a Custom Tool:

    • Add a custom tool that sets up the necessary environment. For example, you can add a custom tool named ModuleSetup and specify the installation script or command to set up the environment.

Informing the Jenkins Administrator

You can inform the Jenkins administrator by providing clear instructions on what needs to be done. Here is an example message you can send:


Subject: Environment Setup for Jenkins Agent Nodes

Hi [Jenkins Administrator],

To ensure that the Jenkins agent nodes have access to the necessary utilities for our CI pipeline, please set up the following environment variables and paths on the agent nodes:

  1. Environment Variables:

    • MODULE_GWSETUP_PATH: Set this variable to the path where the module_gwsetup utility is located.
  2. Module Setup:

    • Ensure that the module_gwsetup utility is loaded in the environment. You can do this by adding the following lines to the shell initialization files (e.g., .bashrc, .bash_profile, or .profile) on the agent nodes:
      export MODULE_GWSETUP_PATH="/path/to/module_gwsetup"
      module use "${MODULE_GWSETUP_PATH}"
      module load "module_gwsetup.gaea"

Alternatively, you can create a global environment script and source it in the shell initialization files. Here is an example script (setup_environment.sh):

#!/bin/bash
export MODULE_GWSETUP_PATH="/path/to/module_gwsetup"
module use "${MODULE_GWSETUP_PATH}"
module load "module_gwsetup.gaea"

Please ensure that this script is sourced in the shell initialization files:

source /path/to/setup_environment.sh

Thank you for your assistance.

Best regards,
[Your Name]


By following these methods, you can ensure that the necessary environment is set up on the Jenkins agent nodes without relying on the launch_java_agent.sh script.