Skip to content

[Feature Request] Automatically init swarm #1286

@NiXTheDev

Description

@NiXTheDev

At the moment, the swarm functionality only manages the existing swarm of nodes, without the ability to create one

This feature request is essentially asking to add support to init the swarm
The current allegiance to a swarm can be seen via docker info command, here's an example from my machine:

...
Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Discovered Devices:
  cdi: docker.com/gpu=webgpu
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
...

As you can see, my machine is not in a swarm, indicated by Swarm: inactive

The workflow for creating a swarm should be simple:

  1. Periphery agent inits the swarm(docker swarm init) on one of the machines and sends the join command to be parsed to Core, or parses it locally and sends the data to Core
  2. Core then send the parsed data to other Periphery agents specified as managers in the swarm, and joins them in
  3. The Periphery agent that created the swarm then promotes the joined nodes to managers
  4. Users can onboard new nodes as necessary, by joining them with the join sub-command, those nodes, if they're not specified as managers in the UI, will not be promoted to managers and will instead stay normal worker nodes, if they are, they are likely already auto-onboarded by the flow
  5. If the swarm is updated in the UI, the process is re-triggered, however the swarm is not initialized again, instead, the nodes are promoted/demoted as needed and, if they're not yet in the swarm, joined in
  6. The UI will have to be updated to account for two ways a manager node can be removed in the UI, it can stay as a member of the swarm(i.e. it just gets demoted), or leave the swarm entirely, logout or trashcan button for complete leave and double down-arrow should convey the intents well enough

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions