Boards name instead of agent name

Hi Guys,

I’m new with Jenkins, and I want to run jobs dedicated to embedded boards.
Question: Is it possible to make the name of connected board appears instead of Agent1 or Agent2?

1 Like

Yes, you can change the names of your agents. How do you create the agents?

When you are using the UI then you can edit an agent using https://[jenkins-url]/manage/computer/[agent-id]/configure

1 Like

Precisely, I want to view all boards connected into a slave machine USB port, and I want them to appear automatically.
Still Possible?

Hello @Dali and welcome to this community.

As a reminder, the term “slave” to refer to an agent has been deprecated since 2016. Please refer to On Jenkins Terminology Updates for more details. We request you update your post.

Your use case looks really interesting to me. So your boards are not agents or nodes, they are just connected through USB to one of your agents.
To me, that’s not possible out of the box (but I am a newbie, so don’t trust me :wink: ).
There are quite a few Jenkins plugins that show information about the agents, so you may try your luck this way… Or you could get inspired by one of these plugins and craft your own to attain your goal.
My $0.02.

1 Like

I agree with @poddingue that there isn’t an “out of the box” way to display all the boards connected to the USB ports of a Jenkins agent. Jenkins doesn’t know how the boards are connected so it doesn’t know how to identify those boards.

Label per board

Jenkins has the concept of labels. Jenkins agents can be assigned multiple labels. You might represent each board with a different label. You could then write a plugin that performs whatever program calls are needed to identify the boards attached to the USB ports on an agent and assign a label for each board connected to the computer. The platform labeler plugin uses that technique to automatically assign labels to agents based on the operating system name and version. The same techniques could be used in your “USB port labeler” plugin.

Agent per board

Another alternative might be to create a Jenkins agent for each board attached to the computer. You could write a script that runs on the agent computer and creates a new Jenkins swarm agent for each board that it finds attached to the computer. The host computer will need enough memory and processor capacity to run an agent per board, but it provides a one to one mapping between boards attached to the USB ports and Jenkins agents.


These are great suggestions, I can’t wait to see what you’re about to build @Dali :partying_face:

1 Like

I’m really grateful @MarkEWaite for your detailed response, by your experience how much time it takes for a newbie person to create this kind of plugins ?

1 Like

I don’t have a reasonable guess for the time to create that type of plugin. Since it would be very similar to the platform labeler plugin (call a different program, use the results to assign labels to agents in roughly the same way), I would expect it to not take too long. The platformlabeler plugin has about 900 non-comment source statements in the production code and about 1500 non-comment source statements in test code.

If it were me, I’d first try the “agent per board” approach as a test, because that can be done with a Python, Ruby, or Powershell script to launch the swarm plugin. If “agent per board” works well enough for your needs, then you’re done. If the prototype with “agent per board” is not good enough, then consider creating a plugin.