How-to Guides
Connect a Slurm Cluster
On this page
When to use this: you have a Slurm cluster and want its GPU nodes to run gpuworks inference services without installing an agent on each node by hand.
Alibaba Cloud E-HPC clusters are connected from the cloud account; see Alibaba Cloud E-HPC. Before connecting you can have the platform (or the command's --check option) only check and change nothing, saying what it would do; see Check First, Then Apply.
What You Get
One cluster is one entry on the External platforms page, with one enrollment token. You run the connect command once, as root on the cluster's Slurm manager node (the one that runs slurmctld, called the manager node in E-HPC; not gpuworks' own management node). It writes a health check program (HealthCheckProgram) into slurm.conf. From then on slurmd on every GPU compute node runs it on the health check interval; it installs the agent on that node, the agent trades the entry's token for a node token of its own, and the node appears on the Compute nodes page like any other. GPU nodes added to the cluster later join by themselves; nothing is repeated.
Slurm still allocates the cards. Cards other jobs hold are shown as held outside the platform and are not scheduled. When a deployment needs cards, the agent submits a placeholder job to borrow them and gives them back to Slurm after the deployment stops. See ADR 0075 for the design.
Requirements
- Slurm allocates GPUs with GRES (the
Gresofscontrol show node <node>containsgpu), and the cards are NVIDIA. A node without an NVIDIA GPU (a CPU queue) gets no agent and does not appear on the platform. - The node has Docker (or another runtime the agent supports) and the NVIDIA Container Toolkit, as an ordinary node does.
- The node can reach the gpuworks server (the "Management node address" you give when connecting): the agent dials out, and downloads itself from this address. The connect command, the check command and Check and apply verify it: they ask
<address>/healthzwithcurlfrom the Slurm manager node and from each GPU node they can run a command on, and list each host that cannot reach it with why (the name does not resolve, the connection is refused or has no route, it timed out, a TLS error and so on); when this fails the command ends "needs attention". Do not use the temporary public address ofgpuworks expose(*.trycloudflare.com) as the address: it changes when the connector is rebuilt, and the nodes then lose the server; the form warns when what you typed is the platform's current temporary public address, and does not block it. - You can run the connect command once, as root, on the Slurm manager node (it edits
slurm.confand runsscontrol reconfigure). - The script directory (default
/opt/gpuworks-slurm) is the same path on every node and readable there: shared storage is the easy way. When it is not shared, the connect command copies the scripts, in parallel, to all the other nodessinfolists over the passwordless SSH of root on the Slurm manager node (usingclush, orpdsh/pdcp, when they exist); CPU nodes too, since the cluster's own health check runs throughcheck.shand must keep working there. When the script directory is not on shared storage, nodes that join the cluster later do not have these files, and the health check does not exist on them: run the connect command again after scaling out, or put the script directory on shared storage. - The account the agent runs as (root by default) can run
sbatch,squeue,scancelandscontrol. Where accounting enforces associations, that account needs one (sacctmgr show assoc user=root), or give the form an accounting account, or name an account with-Ain the sbatch arguments.
Connect an On-Premises Slurm Cluster
-
On the External platforms page click Add external platform at the upper right and choose Slurm cluster under External platforms; the Slurm cluster card in the Quick connect area (administrators only) opens the same dialog.
-
Enter a name and the Management node address (the gpuworks server address the compute nodes can reach). Open Advanced when you need to:
Field Default Description Run as rootThe account the agent runs as on every node (the systemd unit's User=). Fixed after creation. The account must already exist on every node; the install directory belongs to it. Ordinary accounts have known limits, see Run the agent as an ordinary account belowPlaceholder job account The agent's own account The account the placeholder jobs that borrow cards are charged to; squeueand accounting show it. An agent running as root submits withsbatch --uid=<account>; for an agent that is not root this field has no effect. Can be editedInstall directory /var/lib/gpuworksThe agent's install and state directory on every node; it should be on a local disk, because several nodes would share one agent state on shared storage. Fixed after creation Script directory /opt/gpuworks-slurmHolds the health check script and the token file, the same path on every node, preferably on shared storage. Fixed after creation sbatch arguments None Appended to every placeholder job, such as -p gpu -A research --qos=serving --time=7-0. Without-c/--cpus-per-taskit uses-c 1, without memory--mem=1G, without-p/--partitionthe partition the node is in, and without--requeueit adds--no-requeue(Slurm does not requeue a placeholder job after its node fails). Can be editedIdle return 60 seconds How long borrowed cards are kept after the last instance on them stops, before they go back to Slurm (1 to 86400 seconds). Can be edited Queue timeout 600 seconds A placeholder job that has waited this long in the Slurm queue without starting is cancelled and the deployment's start fails (30 to 86400 seconds). Can be edited The Management node address is also fixed after creation; to change it, delete the entry and create it again.
-
Click Connect. The dialog shows the connect command, which contains the token (administrators only; keep it like a password). Run it as root on the Slurm manager node:
curl -fsSL 'https://server.example/slurm/setup.sh?token=…' | sudo shThe command prints the result of each step and ends with
Done., or withFinished, but some steps above need your attention.(it finished, but something is left to do by hand, see below). It can be run again. Above the command the dialog also has a “Check command”, the same command with-s -- --check, which says what it would do and changes nothing; running it first is recommended, see Check First, Then Apply. -
Wait one to one and a half health check intervals (300 seconds by default; a cluster that already has a health check interval keeps it; a node waits a random time of up to half an interval, and at most 300 seconds, before it starts installing, so by default at most about seven and a half minutes). The GPU nodes appear one by one on the Compute nodes page, with this Slurm cluster in the Source column; filter by that source to see only its nodes.
What the Connect Command Does
On the Slurm manager node the command does these things in order and prints the result of each:
- Prechecks: it must be root,
scontrolmust exist, slurmctld must be reachable and report aClusterName, andslurm.confmust be readable. The script directory and every directory above it must be owned by root and writable by neither group nor others (a sticky public directory above it, such as/tmp, is fine; with a symbolic link on the path, the link must be root's too, and every directory it passes through and leads to counts): slurmd runscheck.shfrom it as root on every node, so an account that can change it has root on all of them. Otherwise the command refuses (script_dir_unsafe), naming the directory and what to do; a share exported with root squash shows as owned bynobodyand cannot be used either. A script directory that does not exist is made0755by the command; the command's own script directory from an earlier run, found too open and holding only root's plain files, is tightened (the check command only reports it); anything else in it (a directory, a link, a file others can write) gets it refused, since someone may have changed it while it was open.--uninstall-agentschecks the same way;--removeonly warns and removes as usual. Only owners and mode bits are checked: NFSv4, GPFS and Lustre ACLs are not visible, so with those make sure yourself that no other account can write there. It must also run on the machine that runs slurmctld:scontrol show configanswers on any machine that can reach the cluster, and on a compute node the command would edit the copy a configless slurmd keeps for itself (/run/slurm/…,conf-cache). So whenSLURM_CONFpoints at such a copy, or this machine has no slurmctld process and neither its host name nor its addresses are inSlurmctldHost, the command refuses and changes nothing. If not satisfied, it stops with the reason and changes nothing. - Writes the scripts: the health check script
check.shgoes into the script directory, and the token into atokenfile beside it (mode 0600, root only, read back to confirm).check.shitself is readable by anyone and holds no token. - Chains the existing health check: what the cluster runs now (taken from what slurmctld uses in
scontrol show configforHealthCheckProgram,HealthCheckNodeStateandHealthCheckInterval, not only from the text ofslurm.conf: a setting may be in a file pulled in withInclude, or the file may have been edited and not reloaded yet) is recorded in achainedfile in the script directory (the first line is the program, the second the originalHealthCheckNodeState) andcheck.shcalls it after itself, returning its exit code unchanged, so NHC and the like are not affected. Our block must install the agent in any state, so itsHealthCheckNodeStateisANY; the original program still runs only in the node states it asked for:check.shasksscontrolfor this node's state and matchesIDLE(an idle node, drained or not),NONDRAINED_IDLE(an idle node that is not drained),ALLOCandMIXEDby state as Slurm does, andANY, or nothing, in any state. Approximation: when the original hadCYCLEour block saysANY,CYCLE, so slurmctld still spreads the runs, but the state is judged bycheck.shwhen it runs, not at the moment Slurm itself would pick nodes by state; when this node's state cannot be read (scontrolcannot reach the Slurm manager node from the node) the original program runs as usual, as it did before ours stood in front of it.check.shnever drains a node and never fails by itself. Whenslurm.confhasIncludelines the command warns loudly:HealthCheck*settings in the included files cannot be seen or edited; whether the health check took effect is verified in step 6. - Distributes: when the script directory is on shared storage (nfs, lustre, gpfs, beegfs, cephfs, fuse and so on) nothing is copied; otherwise the scripts are copied in parallel to all the other nodes (with
sshat most 16 at a time and about 3 minutes in all; a node not started by then counts as failed, reasontime_cap) and each node is listed as succeeded or failed with the reason (unreachable,copyfailed,verifyfailed after copying,unsafe: another account could change the script directory or one above it on that node, checked as in step 1, and nothing is copied there, the token included). Root's login shell on the nodes must be POSIX sh compatible (bash, dash and so on; not csh or tcsh). For a failed node copycheck.sh(0755),token(0600) andchained(if present) by hand. When the directory is not shared the output also reminds you that nodes added later do not have the files and the command has to be run again. - Edits
slurm.conf: it first backs it up asslurm.conf.gpuworks-<time>.bak, then appends a block wrapped in# BEGIN gpuworksand# END gpuworksholdingHealthCheckProgram=<script dir>/check.sh,HealthCheckInterval(the existing interval, else 300 seconds; append-s -- --interval <seconds>to the command to set one) andHealthCheckNodeState=ANY(ANY,CYCLEwhen the original hadCYCLE). ExistingHealthCheck*lines are not deleted; they are commented out in place with a#gpuworks-original#prefix. The check script carries this interval: before installing the agent in the background on a node it waits a random time of up to half of it, so that the nodes of a cluster do not all ask the server and download the agent in the same second. scontrol reconfigureand verification: in a configless cluster (SlurmctldParameterscontainsenable_configless) the nodes fetch the new configuration themselves. In a cluster where every node has its ownslurm.conf, the command tells you to distribute the updatedslurm.confto the compute nodes the way you usually do, or the health check does not take effect there; the command then ends as "something is left to do by hand". After the reconfigure the command asks slurmctld once more whichHealthCheckProgramit runs; if that is not ourcheck.sh(for example because an included file overrides it) the command ends as "something is left to do by hand" and says what slurmctld actually runs.
Check First, Then Apply
The connect command edits slurm.conf, writes scripts and copies them to the nodes, so look at what it would do before it does. As for a Kubernetes entry, creating the entry and applying it are two things, and a check that changes nothing comes before applying:
-
For an on-premises cluster add
-s -- --checkto the command (the “Check command” in the dialog, visible to administrators only):curl -fsSL 'https://server.example/slurm/setup.sh?token=…' | sudo sh -s -- --checkIt writes no file, copies nothing, leaves
slurm.confalone and does notscontrol reconfigure(the only thing it creates is the temporary directory the precheck makes, which it removes when it ends); the one thing it asks, read-only, is whether the Slurm manager node and each GPU node (givenclush,pdshor passwordless SSH) can reach the server address's/healthz, with onestep=server_reachmarker per host and astep=server_reach_summary, and it ends "needs attention" when a host cannot. Add--no-node-reachto the command to ask the Slurm manager node only (which is what happens when the platform asks the nodes itself). The precheck runs as usual, so not being root or not being on the machine that runs slurmctld is refused the same way. Every fact is worked out by the same functions the connect command uses, so what the check reports is what the connect command then does: the paths of the check script and token file it would write, the existing health check program it would chain and its node states, the interval, the filesystem of the script directory (shared means nothing is copied, otherwise which nodes and which files), theHealthCheck*lines it would comment in place inslurm.conf(line, key, value), the block it would add, whether the cluster is configless, and whether an earlier armed agent uninstall would be undone. What the connect command warns about, anIncludefile, a program slurmctld runs thatslurm.confdoes not name, a cluster that is not configless, the check warns about too and ends “partial”. The machine-readable marker lines are those of the connect command (status=planin place ofstatus=ok, plusinstall_mode,distribute_planandconf_comment, endingstep=done mode=check); see the API reference.--checkcannot be combined with--removeor--uninstall-agents. -
For a cluster connected from a cloud account, “Check and apply” first has the Slurm manager node run the same check and lists the plan in a dialog (the
gres.conflines to add, how the script reaches the nodes, theslurm.confblock, the existing health check that is commented and chained, the nodes that would be resumed, whether the Slurm manager node and each GPU node can reach the server address, and the points that need attention); only your confirmation then really applies it, see Alibaba Cloud E-HPC.
How Nodes Join
slurmd runs check.sh when the node registers and every health check interval afterwards; after scontrol reconfigure it sometimes runs it at once, but not always (on E-HPC it was seen to wait for the next interval). It exits quickly and does not hold slurmd up:
- No NVIDIA GPU on the machine: it does nothing (CPU nodes are not enrolled).
- The agent service is already running: it does nothing.
- Otherwise it installs in the background, under a lock: it first waits a random time of up to half the health check interval (at most 300 seconds), then reads the token file, asks the server whether the token is still valid (a revoked one installs nothing), downloads the server's
install.shto a temporary file only root can write and hands it the token and the node name in the environment variablesGPUWORKS_SLURM_ENROLL_TOKENandGPUWORKS_SLURM_NODE; it installs the agent (a systemd service withUser=set to the chosen account) and enrolls with the token. When the download or the install fails the log says curl's or the installer's real exit status, and the next run tries again. The output goes to<install dir>/slurm-check.log(to/tmp/gpuworks-slurm-check.logwhen the install directory cannot be created; to/var/log/gpuworks-slurm-check.logwhen the agent runs as an account other than root, see below). - The node's Slurm name is the one slurmd was started with in
-N, else the short or full host namescontrolknows. Enrollment is idempotent per "entry + Slurm node name", so a reinstalled agent gets the same platform node back. The first node to enroll binds the token to this cluster'sClusterName; another Slurm cluster enrolling with it is refused, and so is a node name another entry of the same Slurm cluster held within the last 15 minutes; the agent stops and logs the reason. - When the token's directory is root-restricted shared storage (root squash), root on the node cannot read
tokenand the node installs nothing;slurm-check.logsayscannot read the enrollment token. Run the connect command again, or copytokento that node by hand with mode 0600.
For a revoked entry check.sh is told the token is revoked and installs no agent on new nodes; agents already installed keep running.
Run the Agent as an Ordinary Account
The Run as account can be an ordinary account (a service account such as gpusvc); placeholder jobs are then charged to it. Prepare: the account exists on every node, can submit jobs (give it an association where accounting enforces them, or use -A) and can use Docker. Compared with root there are these known limits:
- Docker access: add the account to the node's local docker group (
gpasswd -a gpusvc docker, effective after logging in again). In clusters whose accounts come from NIS or LDAP use the local docker group: a docker group of the same name in the directory service has a different gid from the group that owns the local/var/run/docker.sock, and adding to it does not open Docker; the agent then falls back to runveil. Without Docker access the agent uses runveil, with the requirements in Accelerator device permissions (non-root installation); for nodes without internet access import images as in Offline deployment. - Install directory: the default
/var/lib/gpuworksis created by the install and handed to the account; when you change it, it must be on local disk and writable by the account. - Root runs nothing from, and writes through nothing in, the agent's directory: the install directory belongs to this account, which can plant symbolic links or replace files in it, so the health check (running as root) neither runs a program from the install directory nor writes a fixed name in it: its log goes to
/var/log/gpuworks-slurm-check.log, which only root can write (/run, then/tmp, when that is not writable); uninstalling an agent does not rungpuworks-agent uninstallfrom the install directory butsystemctl disable --now, removes the unit file, runssystemctl daemon-reloadand removes the agent's identity files (identity.json,agent.lock,gpuworks-agent.pid, the configuration file; links are removed, never followed); downloaded models and the agent binary stay. - Card order: a configless node's configuration cache is readable by root only, so an agent that is not root cannot run
slurmd -Gitself. On every run (as root, whether or not the agent runs) the health check makes the output ofslurmd -Gin a temporary file only root can write and puts it in the install directory asslurm-gres-deviceswithinstall(replacing the name, never writing through it), and the agent reads it first. Without that file the agent lists Slurm's card positions in device number order (/dev/nvidiaN), withtaking Slurm's GPU positions in device minor orderin its log. The two agree whengres.confwritesFile=in device number order or usesAutoDetect=nvml; whenFile=is not in device number order and the file is missing, jobs are matched to the wrong cards, so run the agent as root on such nodes. Clusters whose nodes keep their ownslurm.confare not affected.
The Cluster Row
An on-premises cluster has a row of its own on the External platforms page; a cluster connected from a cloud account is in the cluster header under the account's expanded rows (see the E-HPC section). The actions are the same.
The nodes that join carry the system labels gpuworks.ai/slurm-cluster (the value is the cluster entry's UUID, shown as the entry's name, and a rename does not affect matching) and gpuworks.ai/slurm-node (the node's name in Slurm), matching Kubernetes nodes' gpuworks.ai/kubernetes-cluster and gpuworks.ai/kubernetes-node; they can be used to filter the Nodes page, in a deployment's node requirements, and in sync groups. A node whose agent was installed by hand and merely borrows cards from Slurm has neither label.
- Status: Not connected yet (no node has enrolled yet), Active, Not connected for long (10 minutes after creation and still no node enrolled, and the setup ran more than 10 minutes ago too: the health check reaches the nodes within one to one and a half intervals, so for 10 minutes after the setup ran the entry is not stalled and its detail says the nodes will join within one to one and a half health-check intervals; the Troubleshoot link beside it gives the commands to run on the Slurm manager node and on a GPU node, and the usual causes; for an entry the platform sets up itself, made from a cloud account's cluster, you need not log in to the Slurm manager node, so Troubleshoot points to Check and apply first and keeps only the command to run on a GPU node), Revoked. While no node has enrolled, the one line in the entry's detail says the reason the server worked out (and it replaces the general opening in Troubleshoot): the cloud's cluster has no compute nodes yet (read live from the
Nodesof E-HPCListClusters); the last check or apply found hosts that cannot reach the server address (and lists them); the setup just ran and the nodes are on their way (within 10 minutes); the setup ran more than 10 minutes ago and no node has contacted the server since; or the setup was not seen run. The last three are what the server saw itself (someone fetched the connect command's script, or the platform applied it; fetching the script with the check command does not count; a node that asked for the token's status or enrolled has contacted it), kept in server memory only and forgotten on restart, so none is claimed for an entry created before this server process started. - GPU nodes N, online M: every enrolled agent reports, every 10 minutes, the cluster's nodes with
sinfo -a(hidden partitions included); N is the number of those with agpuGRES and M the number of joined nodes whose agent is online (the number opens the Compute nodes page filtered to the cluster's nodes); with joined nodes whose agent is offline, "offline K" follows. Only agents report the list: while none is online nobody can update it, and N reads "GPU nodes N (list as of a time)", the time an agent was last seen. Right after a node joins the list may not have been refreshed yet, so N is never below M: every joined node has a GPU (agents are installed only on nodes with one), and N is the larger of the list and the number of joined nodes. Nodes without agpuGRES are kept by name only: they are not counted in N and need no agent. Only the latest list is kept, no history; the table is replaced only when the membership (node names, GPU counts) changed, a change of state or reason updates just the changed rows, at most once a minute per entry; before the first report only "M nodes joined" is shown. - GPU nodes without an agent: the nodes on the list that have no agent online, with the node name, the reason (never joined, or joined, agent offline) and the state Slurm gives (such as
drained,down), up to 100 nodes. An administrator can click Remove on a node that joined and whose agent is offline: only the platform's record of the node is deleted and the node taken off the list; the cluster is not changed. A node that is in fact still in the cluster joins again at its next health check, and the next report puts it back on the list. Usual causes: the script directory is not visible on the node (not shared storage and not copied there); the node cannot reach the Management node address; the node is drained or down in Slurm and the health check may not run on it. - Nodes leaving with the cluster: when a node's agent has been offline for 15 minutes and the node is not on the latest reported list of the cluster's nodes (a node without a GPU GRES, or in a hidden partition, is still on it and has not left), and two checks in a row (about 5 minutes apart) say so while the node has no instances, the platform deletes the node. While the list is empty (no agent has reported yet) no node is deleted. When the node scaled away was the last one with an agent, no agent can report a list without it: an entry connected from Alibaba Cloud E-HPC asks the cloud instead (E-HPC
ListNodes, only while the entry has a node offline for more than 15 minutes, once per entry per check), and a node the cloud no longer has is deleted the same way, after two checks in a row with no instances on it, and taken off the list; when the cloud's node list cannot be read nothing is deleted. A cluster connected on its own has no such source: use Remove above.
Edit, Revoke, Uninstall, Delete
Administrators have these in the row's Actions:
-
Edit: you can change the name, accounting account, sbatch arguments, idle return and queue timeout. Saving does nothing on the cluster; online agents pick the new settings up on their next report (10 minutes at most); placeholder jobs already submitted keep their account. Every other field is fixed after creation.
-
Copy setup command: gives the connect command again.
-
View script: opens the full connect script (what the Slurm manager node is served), which can be copied. The enrollment token in the script is shown as
REDACTED-ENROLLMENT-TOKEN; the commands above are what carry the real one. -
Revoke: the token is void and new nodes cannot connect; nodes already connected are not affected; the scripts for uninstalling stay available.
-
Uninstall: two steps, so that every node removes its own agent before the health check is taken out.
- On the Slurm manager node as root run
curl -fsSL '…' | sudo sh -s -- --uninstall-agents: it puts anuninstall-agentsmarker in the script directory (copied to the nodes as well when the directory is not shared), and on its next run each node'scheck.shrunsgpuworks-agent uninstall(see the CLI reference; for an agent running as another account see above: systemd removes it) and installs nothing. - After one health check interval run
… | sudo sh -s -- --remove: it removes the block fromslurm.conf, restores the commented-out originalHealthCheck*lines (the backup stays), runsscontrol reconfigure, and deletestokenanduninstall-agentsin the Slurm manager node's script directory (when the script directory is not shared, thetokencopies on the nodes are not deleted; delete them yourself if you want to). When there is no block of ours it does nothing.
The dialog gives both commands; for a cluster connected from a cloud account the platform runs them (two buttons; after the first the page counts down one health check interval, and the second can be clicked when it ends). Running only the second step does not remove agents: those installed keep running.
- On the Slurm manager node as root run
-
Delete: deletes only the cluster record here; it does not uninstall agents or touch
slurm.conf. It is refused while the cluster still has nodes (SLURM_CLUSTER_HAS_NODES). After the agents are uninstalled and the nodes are offline, ticking "Delete the cluster together with its N nodes" in the confirmation deletes them too; it cannot be done while a node's agent is online or a node has instances, and the confirmation says which. Deleting with the nodes revokes the entry first, then deletes the nodes, then the entry, so the health check cannot enroll a node again with the token the moment it is deleted; if a step after the revocation fails the entry stays revoked.
Alibaba Cloud E-HPC
The compute nodes of an E-HPC cluster (2.0, scheduled by Slurm) are ordinary ECS instances, and the cluster is connected under the cloud account; you do not log in to the Slurm manager node yourself:
- Add an Alibaba Cloud account as in Rent Cloud GPUs · Alibaba Cloud and sync the instances; the account's RAM permissions must include those listed under "Cloud account permissions" below.
- Expand the account. The account's E-HPC clusters are read from Alibaba Cloud (expanding the row shows the last listing at once while it is read again behind it, and the new one replaces it when it is in; after a sync the new read is waited for), one group per cluster, beside the account's managed Kubernetes clusters (ACK) and each read on its own: one failing does not affect the other. The platform first asks E-HPC in which regions it is offered and asks only those, each on its own E-HPC endpoint, so a cluster is listed once and its region is the one it really is in. A cluster with no GPU node yet, or one the account has not synced yet, is listed all the same and can be connected. The header has the cluster name and the scheduler version such as
Slurm 22.05.8, with the status on the right (Running, Creating, Initializing, Awaiting setup, Error, Stopped, Releasing and so on, told apart by colour: green for running, blue for creating and initializing, red for error, grey for the rest, said once, in the header); the group shows “label value” pairs: cluster ID, region, scheduler, and compute nodes (how many compute nodes the cloud lists in the cluster right now, creating and abnormal ones included, read live; the cloud does not say which have a GPU, so it is not called a GPU node count; when that count cannot be read the label is "GPU nodes" instead, the compute nodes with a GPU the last sync found); once connected the entry's facts follow (nodes joined, management node address, script directory, and so on). The cluster's compute nodes are scaled by its queue and are not listed one by one here (the Slurm manager node and login nodes have no GPU and are not listed either): nodes that joined are on the Compute Nodes page, and the number of “Nodes joined” opens a page listing just them. The header of a Slurm cluster has Connect; a cluster scheduled by something other than Slurm (PBS and so on) has none, and its group says only Slurm clusters can be connected for now; a Slurm cluster that is not running yet has none either, and its group says why and what happens next in one line (still being created: connect it once it runs; in error or stopped: deal with it or start it in the E-HPC console first; being released: it cannot be connected). When the cloud does not let the account list clusters that is no error, only an empty list with a quiet note: a key whose RAM policy lacksehpc:ListClustersgets the permission to allow named; an account that never activated E-HPC says “E-HPC is not activated for this account” with the code the cloud returned (activation is judged per region; regions where it is activated are listed as usual). When some regions fail to read (throttling, a RAM policy that does not allow that region, the network), the clusters of the other regions are listed as usual and a warning at the top names the regions that were not read and why, since clusters in them may be missing; only when every region fails is the list “cannot be read”, with the reason and Retry; an account without any E-HPC cluster says “This account has no E-HPC clusters”. - Click Connect to open the drawer: the name is filled in; enter the Management node address (the field warns when it is the platform's own temporary public address; use a stable one), and open Advanced if you need to (fields as above), and click Connect to create the entry. Creating and applying are two steps: once the entry exists the drawer offers Check and apply, and also gives the connect command and the check command if you prefer to run them on the Slurm manager node yourself.
- Click Check and apply (the buttons in the group header carry their names, and while no node has joined this one is the filled primary button; the entry's detail has the same button with one line saying the platform runs it on the cluster's Slurm manager node, and the connect commands are folded under "Run it by hand" until you need them): the platform first has the Slurm manager node run a check that changes nothing and lists the plan in a dialog, see below; only after you click Apply does it really run. When it is done the dialog lists the result of each step. The existing GPU nodes join within one to one and a half health check intervals (by default at most about seven and a half minutes); nodes the queue scales out later run the check when they register and usually join within a few minutes. After connecting, the header shows the status, the GPU node counts and the actions menu (edit, check and apply, copy setup command, view script, uninstall, revoke, delete).
- When an entry's cluster is no longer in the account (it was deleted, or the list could not be read this time) the entry is still listed as a group of its own, saying why, so it can be uninstalled, revoked, or deleted.
Check and apply is not hidden when it cannot be used but disabled, with the reason on hover (the server's code, operation_blocked): the entry was not made from a cloud account's cluster, the cloud account was deleted, the account's driver cannot run commands on the Slurm manager node, the account's cluster list does not have this cluster (check the account and its permissions, or sync), the cloud's cluster listing is still being read (cluster_listing_pending, checked again shortly), the cluster listing failed or is missing a region (cluster_listing_failed: check the account, its permissions and the cloud's status), the cluster is not Slurm, or the token is revoked (revoking refuses only applying; uninstalling still works).
What Check and Apply Does
Check first, apply second; both times the platform sends Cloud Assistant a script that runs as root on the Slurm manager node. The check (dry_run: true) reads the same things and writes nothing: no gres.conf line added, no file written, nothing copied, slurm.conf untouched, no reconfigure, no node resumed; it only reports what each of the three steps below would do, and the dialog lists it: the text of the gres.conf lines to append (and the nodes already covered, or that the cloud says have a card while Slurm gives them no gpu Gres), how the script reaches the nodes (nothing copied on shared storage, otherwise which nodes), the block to add to slurm.conf, the existing health check that is commented in place and chained, the nodes that would be resumed, whether the Slurm manager node and each GPU node can reach the server address (see below), and the points that need attention: an Include in slurm.conf, a program slurmctld runs that slurm.conf does not name, a cluster that is not configless, nodes with no gpu Gres, a host that cannot reach the server address (these make the apply end “partial”). A check that fails or is refused has the apply's reasons (see the codes below) and has no Apply button, only Check again. The apply is the second run, after you confirm. The script the platform sends runs as root on the Slurm manager node. Only one run at a time per Slurm manager node; the platform waits at most six and a half minutes. If the request is cut off because the client stopped waiting and you retry at once, the previous run may still be going on the Slurm manager node and the answer is "another setup is already running on the Slurm manager node" (SLURM_APPLY_FAILED, reason busy): wait a few minutes and retry rather than clicking again. It does, in order:
- Adds missing
gres.conflines: the nodes and their card counts are whatever Slurm on the Slurm manager node says, not what the account has synced: the script readsscontrol -o show node, and for each node whose configuredGres=hasgpu:N(typedgpu:a100:2and socket-suffixedgpu:2(S:0-1)are read too, several gpu entries add up; E-HPC sets it with--conf "Gres=gpu:N"when slurmd registers, so nodes with nogres.confline yet, nodes not synced yet and nodes not named<cluster ID>_<host>are all included) and thatgres.confhas no gpu line for, it appendsNodeName=<node> Name=gpu File=/dev/nvidia0to/etc/slurm/gres.conf(File=/dev/nvidia[0-N-1]for several cards, N being itsgpu:N). A node that already has a gpu line (Name=gpu, orAutoDetectother thanoff, whoseNodeNameexpression, anywhere in the line, covers it, or a general gpu line withoutNodeName) is never touched; lines of other resources and lines for other nodes do not count. Nodes the account's last sync lists with a card whoseGres=in Slurm has nogpuget no line (slurmd would refuse them) and are listed under "Known to Slurm without a gpu Gres, nothing added for" (a node the sync did not list gets no such hint, but the lines above are added all the same): give theirNodeNameline inslurm.confaGres=gpu:<count>. For nodes the queue scales out itself E-HPC writes the line (observed 2026-11); the initial nodes created with the cluster have none, which is why this step exists. Without the line slurmd registers the node without GPUs and Slurm drains it (Reasongres/gpu count reported lower than configured), and Slurm itself cannot run GPU jobs on it either. - Runs the setup: it downloads the connect script from a one-time URL and runs it, doing what "What the Connect Command Does" describes; E-HPC's
/optis the cluster's shared NAS, so the script directory is on shared storage and nothing is distributed. - Resumes held nodes: nodes Slurm holds for the missing GPUs (Reason beginning with the text above) get
scontrol update ... state=resume; an administrator's own drain stays.
Reaching the server address: both the check and the apply ask whether the Slurm manager node and each GPU compute node can reach the entry's server_url (/healthz). The connect script asks from the Slurm manager node itself; the platform asks each GPU compute node through Cloud Assistant: the node list comes from E-HPC ListNodes, only nodes with a card that are running are asked, at most 8 at a time and 90 seconds in all, while the Slurm manager node runs its script, so it does not lengthen the check. The result is listed per host in the dialog and in the apply result, for example "Compute node gpu000 cannot reach https://…: timed out"; nodes that could not be asked (not running, Cloud Assistant offline, the command did not finish) are listed apart and do not count as failed; when the compute nodes could not be listed (the key lacks ehpc:ListNodes) the reason is said. When a host cannot reach it the check and the apply end "needs attention"; the apply result has one more step, "Reach the server's address from the hosts", and its to-do list says to use an address they can reach and apply again; the entry's detail gives it as why there is no node yet.
When the Slurm manager node cannot even fetch the connect script (the check or the apply fails outright with SLURM_APPLY_FAILED, reason server_unreachable), the error names the management node address it could not reach and why (name resolution failed, connection refused or no route, timed out, TLS error, and so on): the nodes must be able to reach that address. When the cluster's VPC has no public egress, add a NAT gateway, or host gpuworks in the same VPC and enter its private address.
It can be run again (for example after scaling out). The result is "The cluster is set up", or "Set up, with something left to do by hand": the to-do list names nodes the script could not be copied to, nodes with no gpu Gres, nodes that were not resumed, and so on. On failure it shows the step that failed and the last lines the Slurm manager node printed.
One-time URL: the Cloud Assistant command holds only a one-time setup URL (/slurm/setup.sh?once=<random code>). The code lives in server memory only, is valid for ten minutes, works once when the Slurm manager node fetches it, is dropped when the apply ends unspent, and is lost when the server restarts (the apply itself is synchronous and is not affected). The cluster token appears only in the script body the Slurm manager node downloads, which writes it to the root-only token file, so the Cloud Assistant invocation record Alibaba Cloud keeps for 30 days holds no token. The two uninstall steps work the same way.
Cloud Account Permissions
| Permission | Purpose |
|---|---|
ehpc:ListClusters | Lists the account's E-HPC clusters region by region (name, scheduler, status); without it the E-HPC clusters cannot be read, the top of the list quietly says this permission has to be allowed (it is not an error), and existing entries are still listed on their own; when the key's policy allows only some regions, the clusters of the others are listed as usual and the regions not read are named in a warning. Omit if you have no E-HPC |
ehpc:ListRegions | Asks E-HPC in which regions it is offered and asks only those, which makes the listing faster and lists each cluster once. Without it the listing still works: every region of the account is asked instead, more slowly, and a region without E-HPC may show as not read. Omit if you have no E-HPC |
ehpc:GetCluster | Finds the Slurm manager node's instance ID; Check and apply and the uninstall the platform runs need it |
ehpc:ListNodes | Lists the cluster's compute nodes (instance ID, hostname, cards, state) to ask each whether it can reach the server address, and to tell whether an offline node was scaled away; without it the check and the apply go on and only leave the compute nodes unasked, saying why, and the last node scaled away has to be removed by hand |
ecs:DescribeCloudAssistantStatus, ecs:RunCommand, ecs:DescribeInvocationResults | Run the script on the Slurm manager node through Cloud Assistant and read the result, and ask each GPU compute node whether it can reach the server address; Cloud Assistant must be online on those nodes |
When a permission is missing the error names it (SLURM_APPLY_PERMISSION_MISSING); you can also run the connect command on the Slurm manager node yourself. The full permission list and the RAM policy are in Rent Cloud GPUs · Alibaba Cloud.
Why Check and apply cannot run (SLURM_APPLY_NOT_APPLICABLE): the entry was not created from a cloud account's cluster, the cloud account was deleted, the cluster in the cloud is not Slurm, the account's driver cannot run commands on the Slurm manager node, the entry is revoked, or the cluster has no synced node and is not in the account's E-HPC cluster list either (check the account's permissions, or sync it first), or that list is still being read (cluster_listing_pending) or failed or is missing a region (cluster_listing_failed; the cluster cannot then be said not to be in the account). These are the same codes as the reasons a disabled Check and apply shows in the list. The cluster's region and scheduler come from its nodes in the last sync and, when it has none, from the cloud's cluster listing: the server reads it in the background on its own (one read per account at a time, under its own timeout, whatever a page request is willing to wait) and caches it for 1 minute; a request waits at most 5 seconds and otherwise uses the last listing it has (up to 10 minutes old) or shows "still being read", and the next poll has the answer, so the button does not flicker between enabled and disabled. Replacing the account's key or deleting the account drops the cache.
When Check and apply cannot run, the entry details give the setup commands below the "No node has joined yet" line, folded under Setup commands until opened, to run yourself on the Slurm manager node.
Differences from an On-Premises Cluster
The queue scales the compute nodes, so the platform does not power, release or resize them (409 PROVIDER_INSTANCE_IN_HPC_CLUSTER), and an agent cannot be installed on one node alone: they all join through the cluster entry. As with the nodes of an ACK cluster, they are not in the account's instance list and are not counted in its instance count (the “Standalone instances” group and the number in the sync message count only the account's own instances); they show as part of the cluster's group.
| On-premises Slurm cluster | Alibaba Cloud E-HPC | |
|---|---|---|
| How to connect | External platforms → Add → Slurm cluster, run the connect command on the Slurm manager node (run the check command first to see what it does) | Connect in the header under the cloud account creates the entry, then Check and apply: it checks first and applies only after you confirm, no login to the Slurm manager node (you can also copy the command and run it yourself) |
| Script directory | Default /opt/gpuworks-slurm; the command distributes when not on shared storage | Same default, on the cluster's shared NAS, nothing to distribute |
| Install directory | Default /var/lib/gpuworks | Same; do not put it under /opt or /home: they are the shared NAS and all nodes would share one agent state |
| Model storage | Register a shared file system as a "Mounted shared directory" | Same; the cluster's NAS is mounted at /opt, and once a node has joined the entry details register it in one click, see Where models are stored |
| Slurm configuration | Depends on the cluster; distribute slurm.conf yourself when not configless | Configless: slurmd fetches its configuration from the Slurm manager node and takes effect after reconfigure |
| gres.conf | Maintained by the administrator | Initial nodes get lines from Check and apply; E-HPC writes them for scaled-out nodes |
| Partitions | Depends on the cluster | Each queue is a partition, and the default partition is comp; placeholder jobs automatically use the node's own partition (such as gpu), otherwise they queue forever with PartitionConfig |
| Accounting | Depends on the cluster | slurmdbd is on and only root has an association, but associations are not enforced: ordinary users can submit jobs without one |
| Adding and removing nodes | Maintained by the administrator | Nodes the queue scales out join by themselves; nodes a scale-in releases go offline on the platform first and are cleaned up automatically later |
Where Models Are Stored
By default the platform downloads models to the node's default storage (default). On a node installed through a cluster entry, default's directory on that node is models under the install directory (/var/lib/gpuworks/models by default, on the local disk), one copy per node: when a deployment moves to another node, or the queue adds a node, the model is fetched again. A Slurm cluster usually has a shared file system mounted at the same path on every node (NFS, Lustre, GPFS, BeeGFS, CephFS, the E-HPC NAS); register it as model storage and every node shares one copy:
For a cluster connected from Alibaba Cloud E-HPC, once a node has joined, the entry details have a line "The cluster's nodes share a NAS: register /opt/gpuworks-models as model storage…" and a Register as model storage button (for administrators): it opens Storage → Add storage with the type, directory, name and the nodes by the cluster's label filled in, so you save after the trial mount passes; once a node of this cluster has any enabled shared storage, the line is no longer shown. For other clusters register it with these steps:
- Make a model directory on the shared file system (such as
/share/models), readable and writable at the same path on every node; the agent runs as root by default, so an export with root squash needs write access opened for this directory. - Storage → Add storage, type Mounted shared directory, with this directory; for the nodes it applies to choose by label, label
gpuworks.ai/slurm-clusterwith this cluster entry as the value, so nodes the queue adds later carry the label and apply automatically. Trial mount first and save once it passes. - When deploying, choose this storage under Save to: after the first download the other nodes read the same copy, see Select storage for a deployment.
When the shared file system reads slower than a local disk (a capacity NAS, for example), the engine takes longer to load the model. When it is an NFS export, NFS with local cache is the alternative (mounted by the agent, needs the export address and an NFS client on the nodes): one copy of the model on shared storage, which each node copies to its local disk before reading, see Add NFS storage.
Register a directory on a shared file system as a Mounted shared directory, not as Local storage: a local storage is taken as one copy per node, so on a shared file system (such as E-HPC's /opt) several nodes download the same model into one directory, and deleting the model on one node deletes it for all. The storage page marks such a storage with an orange exclamation mark beside its name.
What You See While It Runs
- Cards held by other jobs: the node card shows
Slurm job <job id> (<user>)and the card is not scheduled. - A deployment borrowing cards: the placeholder job is named
gpuworks-hold-<instance UUID>, is visible insqueue, and is charged to the run-as account (or the accounting account, or the account of-A). While it queues the instance's progress showswaiting for Slurm job <job id>: <reason>, such asAssocGrpGRESwhen the quota is short. - Borrowed cards differ from the ones chosen when scheduling: Slurm gives cards by count only. The agent starts with the cards Slurm gave and the platform moves the instance to them. When the card model or memory differs, this start fails.
- The job is ended: when an administrator's
scancel, the time limit or preemption ends a placeholder job, the instances using its cards stop, with a message naming the job id and the state Slurm gave, and the platform reschedules them. - Agent restart: the agent finds its own placeholder jobs again by job name (only jobs that asked for its node: every agent of a cluster submits as the same account, and another node's jobs are left to that node's agent); running instances are not affected, and a job found after a restart is not returned as idle for 10 minutes, since the agent knows which cards are in use only once the server sends its instances again, while the containers keep running on those cards. The agent keeps the accounts it submitted placeholder jobs as in
slurm-submittersin its state directory, so after the entry's accounting account was changed, jobs under the earlier account are still recognised as its own after a restart (kept refreshed and returned on time) rather than read as other people's jobs holding cards for good. - Slurm does not start jobs on the node: when the node is drained, down, or registered without GPUs, placeholder jobs queue forever and a deployment fails only once the queue timeout is up. The agent reads the node's state on every report, and when it finds this the platform stops scheduling to that node (the node shows "Scheduling stopped" with reason
slurm_node_unavailable), and the Runtime section of the node details shows Slurm's own reason and the steps to recover by hand (the commands can be copied): for a node missinggres.confadd a line on the Slurm manager node, runscontrol reconfigure, thenscontrol update nodename=<node> state=resume; for a node an administrator drained, resume it after dealing with the reason; for a down node check slurmd first. When Slurm recovers the platform lifts it by itself; a scheduling stop an operator set by hand is not affected. For an E-HPC cluster Check and apply handles the missing lines in one go.
Limits
- Engine containers run outside the job: the job's CPU and memory are bookkeeping only; raise them in the entry's sbatch arguments as needed.
- One placeholder job per instance; the cards in a job are given back together.
- Only NVIDIA cards are recognized; a node without a GPU gets no agent.
- An agent installed on a Slurm node as an ordinary node, not through a cluster entry, still recognizes Slurm and borrows cards; its settings come from the environment variables
GPUWORKS_SLURM(auto,on,off),GPUWORKS_SLURM_NODE,GPUWORKS_SLURM_SBATCH_ARGS,GPUWORKS_SLURM_PENDING_TIMEOUTandGPUWORKS_SLURM_IDLE_RETURN. For an agent installed through a cluster entry the node name and the settings come from the entry and these variables have no effect (GPUWORKS_SLURM=offis the exception: it keeps the agent out of Slurm mode). - Not supported yet: clusters without root (the agent running inside a job), Slurm on Kubernetes (such as Slinky), cards other than NVIDIA, a quota precheck before submitting, and relaying by a job's remaining time limit.
Was this page helpful?