Rate This Document
Findability
Accuracy
Completeness
Readability

Adding Each Worker Node to the Jenkins Cluster

  • The Jenkins WebUI and configuration parameters may vary according to the version. The following contents are for references only. Configure credentials and worker nodes based on your actual Jenkins environment.
  • If credential management is unavailable in your Jenkins environment, install the Credentials Binding plugin before performing the following steps.

This section is for reference only.

Credential Settings

  1. Add a credential domain.
    Choose Manage Jenkins > Credentials in the navigation tree on the left. On the Credentials page that is displayed, click Add domain in the drop-down list of System.
    Figure 1 Adding a credential domain (1)
  2. Enter the domain name and description as required. The information helps identify and manage the domain. Click Create.
    Figure 2 Adding a credential domain (2)
  3. Return to the Credentials page. In the drop-down list of the credential domain, click Add credentials.
    Figure 3 Adding credentials

    Add the SSH credential of each AArch64 Jenkins worker node to the credential domain.

    1. In the Jenkins environment, generate a certificate for SSH password-free login to worker nodes. Set an SSH key passphrase as required.
      ssh-keygen -b 4096 -C "<Email address or another label>" -f ~/.ssh/id_ed25519_<Worker node IP address in *_*_*_* format> -t ed25519
    2. In the Jenkins environment, upload the public key of the generated certificate to the worker node. Enter the user name and password of the worker node as prompted.
      ssh-copy-id -i ~/.ssh/id_ed25519_<Worker node IP address in *_*_*_* format>.pub USER@<Worker node IP address>

      USER: user name used on the worker node.

    3. Delete all keys that belong to the specified host name from the known hosts file.
      ssh-keygen -R <Worker node IP address>
    4. Use the SSH key to connect to the worker node. If an SSH key passphrase is set, enter the passphrase as prompted.
      ssh -o IdentitiesOnly=yes -o PasswordAuthentication=no -i ~/.ssh/id_ed25519_<Worker node IP address in *_*_*_* format> -l USER -p 22 <Worker node IP address>
    5. View the SSH key.
      cat ~/.ssh/id_ed25519_<Worker node IP address in *_*_*_* format>
    Figure 4 SSH credential of the worker node
    • Description: Enter information about the current worker node.
    • Username: Enter the user name.
    • Key: Enter the private key of the target host to be connected using the SSH key.
    • Passphrase: If an SSH key passphrase is set, enter the passphrase.

    Set the items according to the actual situation.

Worker Node Settings

  1. Add a worker node. Choose Manage Jenkins > Nodes in the navigation tree on the left. On the Nodes page that is displayed, click +New Node in the upper right corner.
    Figure 5 Worker node settings (1)
  2. On the New node page, enter the node name, select the node type, and click Create.
    Figure 6 Worker node settings (2)

    Permanent Agent means that you add a plain, permanent agent to Jenkins.

  3. The Configure page is displayed. Set the configuration items of the worker node. For details, see Table 1.
    Figure 7 Worker node settings (3)
    Figure 8 Worker node settings (4)

    After the worker node is configured, check the node connection status. If the node fails to be connected, rectify the fault based on Failed to Connect to a Jenkins Worker Node.

    Table 1 Worker node configuration items

    Item

    Description

    Name

    Set it to the node name.

    Description

    Enter a description to facilitate management and identification.

    Example: aarch64node (IP address) (openeuler22.03)

    Number of executors

    The default value is 1.

    Remote root directory

    Remote working directory, which is automatically generated by Jenkins. You do not need to create it.

    Example: /home/JenkinsWorkspace/

    Labels

    Enter a label or multiple labels separated by spaces. The pipeline script selects a worker node by labels. The labels you enter must be the same as those in the Jenkins script.

    Example: kunpeng_scanner kunpeng_java_builder_jdk17 kunpeng_c_builder_gcc kunpeng_compatibility

    Usage

    Select the usage of the current worker node. The options are:

    • Use this node as much as possible
    • Only build jobs with label expression matching this node

    Launch method

    Select a launch method of the current worker node. The options are:

    • Docker variant of Launch agents via SSH with SSH key injection
    • Launch agent via execution of command on the controller
    • Launch agents via SSH
    • Launch agent via Java Web Start
    NOTE:

    By default, only Launch agent via execution of command on the controller is available. To use another launch method, install the corresponding plugin by referring to 4.

    Availability

    Select the availability of the worker node. The options are:

    • Keep this agent online as much as possible
    • Bring this agent online according to a schedule
    • Bring this agent online when in demand, and take offline when idle

    Node Properties

    Select node properties. The options are:

    • Disk Space Monitoring Thresholds
    • Environment variable
    • Tool Location