Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59978

Need ability to score Swarm nodes based on connectivity and user interaction

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • swarm-plugin
    • None
    • Jenkins ver. 2.176.3
      on Ubuntu Bionic Beaver

      We have a number of Swarm instances running on Windows machines, and having some ability for the Master Jenkins server to score which agent to use based on details like:

      • Is the Agent connected to Ethernet or WiFi (score Ethernet as preferred)
      • Is the User Interface locked (primary user is not utilizing the machine)
      • Other metrics that may fluctuate ie
        • Load
        • Disk space available
        • On corporate LAN (not VPN)

          [JENKINS-59978] Need ability to score Swarm nodes based on connectivity and user interaction

          Basil Crow added a comment -

          At first glance this doesn't problem seem specific to Swarm agents. Regardless of how an agent is attached to the master (be it through SSH, Swarm, Azure Container Agents, etc.) there exists the problem of how to map a build to an agent. Jenkins traditionally offers labels for this purpose, which are fairly flexible but don't include the features you described above. Doing some preliminary searching I see some plugins that claim to offer generic load balancing support, but some of them haven't been updated in years and I haven't tried any of them personally. Ultimately this might be a better question for the users list. If nobody there can suggest an existing plugin that meets your needs, it might be possible to write your own plugin (perhaps based on one of the two I linked above) that does.

          Basil Crow added a comment - At first glance this doesn't problem seem specific to Swarm agents. Regardless of how an agent is attached to the master (be it through SSH, Swarm, Azure Container Agents, etc.) there exists the problem of how to map a build to an agent. Jenkins traditionally offers labels for this purpose, which are fairly flexible but don't include the features you described above. Doing some preliminary searching I see some plugins that claim to offer generic load balancing support, but some of them haven't been updated in years and I haven't tried any of them personally. Ultimately this might be a better question for the users list . If nobody there can suggest an existing plugin that meets your needs, it might be possible to write your own plugin (perhaps based on one of the two I linked above) that does.

          I'm also facing the problem to set a preference score for a Swarm slave. I typically use the Scoring Load Balancer plugin. See https://plugins.jenkins.io/scoring-load-balancer/. For me the score mainly depends on number of available cpu cores.

          But I do not have an idea how to combine Swarm with setting such a score. Maybe it is possible to do this using REST API but so far I have no idea how to do this? Has anybody implemented this and can give me a hint?

          Heiko Nardmann added a comment - I'm also facing the problem to set a preference score for a Swarm slave. I typically use the Scoring Load Balancer plugin. See https://plugins.jenkins.io/scoring-load-balancer/. For me the score mainly depends on number of available cpu cores. But I do not have an idea how to combine Swarm with setting such a score. Maybe it is possible to do this using REST API but so far I have no idea how to do this? Has anybody implemented this and can give me a hint?

            Unassigned Unassigned
            dgtlrift James Hanley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: