= Update

This page describes how to update Slurm-web to the latest version. It is
important to keep your installation up to date to benefit from the latest
features, improvements, and security patches.

The document provides a general procedure for updating the software and specific
steps for updating to latest major version.

== General Procedure

=== System packages

Depending on host Linux distribution, run this command to update Slurm-web
packages:

[tabs]
======
RHEL, CentOS, Rocky Linux, AlmaLinux OS and Fedora::
+
====

[source,console]
----
# dnf update
----
====

Debian and Ubuntu::
+
====
[source,console]
----
# apt update && apt upgrade
----
====

SLES and openSUSE::
+
====
[source,console]
----
# zypper update
----
====
======

Restart services:

[tabs]
======
Native service::
+
====
When using default native service:

[source,console]
----
# systemctl restart slurm-web-gateway.service slurm-web-agent.service
----
====

Production HTTP server::
+
====
When using xref:conf:wsgi/index.adoc[production HTTP server]:

[source,console]
----
# systemctl restart slurm-web-gateway-uwsgi.service slurm-web-agent-uwsgi.service
----
====
======

Check status:

[tabs]
======
Native service::
+
====
When using default native service:

[source,console]
----
# systemctl status slurm-web-gateway.service slurm-web-agent.service
----
====

Production HTTP server::
+
====
When using xref:conf:wsgi/index.adoc[production HTTP server]:

[source,console]
----
# systemctl status slurm-web-gateway-uwsgi.service slurm-web-agent-uwsgi.service
----
====
======

Services must be *active* and *running*.

=== Containers

Pull the latest Slurm-web images:

[tabs]
======
Docker::
+
====
[source,console]
----
$ docker pull ghcr.io/rackslab/slurm-web-agent:latest
$ docker pull ghcr.io/rackslab/slurm-web-gateway:latest
----
====

Podman::
+
====
[source,console]
----
$ podman pull ghcr.io/rackslab/slurm-web-agent:latest
$ podman pull ghcr.io/rackslab/slurm-web-gateway:latest
----
====
======

Pulling images does not update already running containers. Stop and remove the
current containers, then create them again with the same options used at
deployment, including the bind mounts and user options described in
xref:install/containers/index.adoc[the containers install reference].

[tabs]
======
Docker::
+
====
[source,console]
----
$ docker rm -f slurm-web-gateway slurm-web-agent
$ docker run -d --name slurm-web-agent [MOUNTS] \
    --user $(id -u slurm-web):$(id -g slurm-web) \
    ghcr.io/rackslab/slurm-web-agent:latest
$ docker run -d --name slurm-web-gateway [MOUNTS] \
    --user $(id -u slurm-web):$(id -g slurm-web) \
    ghcr.io/rackslab/slurm-web-gateway:latest
----
====

Podman::
+
====
[source,console]
----
$ podman rm -f slurm-web-gateway slurm-web-agent
$ podman run -d --name slurm-web-agent [MOUNTS] \
    --userns=keep-id --user $(id -u slurm-web):$(id -g slurm-web) \
    ghcr.io/rackslab/slurm-web-agent:latest
$ podman run -d --name slurm-web-gateway [MOUNTS] \
    --userns=keep-id --user $(id -u slurm-web):$(id -g slurm-web) \
    ghcr.io/rackslab/slurm-web-gateway:latest
----

With rootful Podman, omit `--userns=keep-id`.
====
======

Check status:

[tabs]
======
Docker::
+
====
[source,console]
----
$ docker ps --filter name=slurm-web-
----
====

Podman::
+
====
[source,console]
----
$ podman ps --filter name=slurm-web-
----
====
======

=== Compose

Pull the latest Slurm-web images:

[tabs]
======
Docker Compose::
+
====
[source,console]
----
$ docker compose pull
----
====

Podman Compose::
+
====
[source,console]
----
$ podman compose pull
----
====
======

Apply the updated images:

[tabs]
======
Docker Compose::
+
====
[source,console]
----
$ LOCAL_UID=$(id -u) LOCAL_GID=$(id -g) docker compose up -d
----
====

Podman Compose::
+
====
[source,console]
----
$ LOCAL_UID=$(id -u) LOCAL_GID=$(id -g) podman compose up -d
----
====
======

Check status:

[tabs]
======
Docker Compose::
+
====
[source,console]
----
$ docker compose ps
----
====

Podman Compose::
+
====
[source,console]
----
$ podman compose ps
----
====
======

Connect to Slurm-web web interface with your browser to check it is
up-and-running.

== Notes for Slurm-web 7

To update Slurm-web from version 6 to version 7, some manual additional steps
must be performed.

=== Package Repositories

To avoid impacting users with automatic upgrades, Slurm-web 7 packages are
published to a separate repository. Package repositories settings must be
updated to install this version.

==== DNF

NOTE: This procedure works on
https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux[RHEL],
https://www.centos.org/[CentOS],
https://rockylinux.org/[Rocky Linux] and
https://almalinux.org/[AlmaLinux OS].

Edit [.path]#`/etc/yum.repos.d/rackslab.repo`# to change repository from
_slurmweb-6_ to _slurmweb-7_:

[tabs]
======
RHEL 8::
+
====
[source,diff]
----
--- a/etc/yum.repos.d/rackslab.repo
+++ b/etc/yum.repos.d/rackslab.repo
@@ -4,8 +4,8 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab

-[rackslab-slurmweb-6]
-name=Rackslab slurmweb-6
-baseurl=https://pkgs.rackslab.io/rpm/el8/slurmweb-6/$basearch/
+[rackslab-slurmweb-7]
+name=Rackslab slurmweb-7
+baseurl=https://pkgs.rackslab.io/rpm/el8/slurmweb-7/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab
----
====

RHEL 9::
+
====
[source,diff]
----
--- a/etc/yum.repos.d/rackslab.repo
+++ b/etc/yum.repos.d/rackslab.repo
@@ -4,8 +4,8 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab

-[rackslab-slurmweb-6]
-name=Rackslab slurmweb-6
-baseurl=https://pkgs.rackslab.io/rpm/el9/slurmweb-6/$basearch/
+[rackslab-slurmweb-7]
+name=Rackslab slurmweb-7
+baseurl=https://pkgs.rackslab.io/rpm/el9/slurmweb-7/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab
----
====

RHEL 10::
+
====
[source,diff]
----
--- a/etc/yum.repos.d/rackslab.repo
+++ b/etc/yum.repos.d/rackslab.repo
@@ -4,8 +4,8 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab

-[rackslab-slurmweb-6]
-name=Rackslab slurmweb-6
-baseurl=https://pkgs.rackslab.io/rpm/el10/slurmweb-6/$basearch/
+[rackslab-slurmweb-7]
+name=Rackslab slurmweb-7
+baseurl=https://pkgs.rackslab.io/rpm/el10/slurmweb-7/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab
----
====

Fedora 43::
+
====
[source,diff]
----
--- a/etc/yum.repos.d/rackslab.repo
+++ b/etc/yum.repos.d/rackslab.repo
@@ -4,8 +4,8 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab

-[rackslab-slurmweb-6]
-name=Rackslab slurmweb-6
-baseurl=https://pkgs.rackslab.io/rpm/fc43/slurmweb-6/$basearch/
+[rackslab-slurmweb-7]
+name=Rackslab slurmweb-7
+baseurl=https://pkgs.rackslab.io/rpm/fc43/slurmweb-7/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab
----
====

Fedora 44::
+
====
[source,diff]
----
--- a/etc/yum.repos.d/rackslab.repo
+++ b/etc/yum.repos.d/rackslab.repo
@@ -4,8 +4,8 @@
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab

-[rackslab-slurmweb-6]
-name=Rackslab slurmweb-6
-baseurl=https://pkgs.rackslab.io/rpm/fc44/slurmweb-6/$basearch/
+[rackslab-slurmweb-7]
+name=Rackslab slurmweb-7
+baseurl=https://pkgs.rackslab.io/rpm/fc44/slurmweb-7/$basearch/
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rackslab
----
====
======

Run this command to update repositories and packages:

[source,console]
----
# dnf update
----

==== APT

NOTE: This procedure works https://debian.org/[Debian] and
https://ubuntu.com/[Ubuntu].

Edit [.path]#`/etc/apt/sources.list.d/rackslab.sources`# to change distribution
from _slurmweb-6_ to _slurmweb-7_:

[tabs]
======
Debian 13 _« trixie »_::
+
====
[source,diff]
----
--- a/etc/apt/sources.list.d/rackslab.sources
+++ b/etc/apt/sources.list.d/rackslab.sources
@@ -1,6 +1,6 @@
 Types: deb
 URIs: https://pkgs.rackslab.io/deb
 Suites: trixie
-Components: main slurmweb-6
+Components: main slurmweb-7
 Architectures: amd64
 Signed-By: /usr/share/keyrings/rackslab.gpg
----
====

Debian 14 _« forky »_::
+
====
[source,diff]
----
--- a/etc/apt/sources.list.d/rackslab.sources
+++ b/etc/apt/sources.list.d/rackslab.sources
@@ -1,6 +1,6 @@
 Types: deb
 URIs: https://pkgs.rackslab.io/deb
 Suites: forky
-Components: main slurmweb-6
+Components: main slurmweb-7
 Architectures: amd64
 Signed-By: /usr/share/keyrings/rackslab.gpg
----
====

Debian unstable _« sid »_::
+
====
[source,diff]
----
--- a/etc/apt/sources.list.d/rackslab.sources
+++ b/etc/apt/sources.list.d/rackslab.sources
@@ -1,6 +1,6 @@
 Types: deb
 URIs: https://pkgs.rackslab.io/deb
 Suites: sid
-Components: main slurmweb-6
+Components: main slurmweb-7
 Architectures: amd64
 Signed-By: /usr/share/keyrings/rackslab.gpg
----
====

Ubuntu 26.04 LTS::
+
====
[source,diff]
----
--- a/etc/apt/sources.list.d/rackslab.sources
+++ b/etc/apt/sources.list.d/rackslab.sources
@@ -1,6 +1,6 @@
 Types: deb
 URIs: https://pkgs.rackslab.io/deb
 Suites: ubuntu26.04
-Components: main slurmweb-6
+Components: main slurmweb-7
 Architectures: amd64
 Signed-By: /usr/share/keyrings/rackslab.gpg
----
====
======

Run this command to update repositories and packages:

[source,console]
----
# apt update && apt upgrade
----

==== Zypper

This procedure works on
https://www.suse.com/products/server/[SUSE Linux Entreprise Server (SLES)] and
https://www.opensuse.org/[openSUSE LEAP].

Rename file [.path]#`/etc/zypp/repos.d/rackslab-slurmweb-6.repo`# to
[.path]#`/etc/zypp/repos.d/rackslab-slurmweb-7.repo`# and edit its content to
change repository from _slurmweb-6_ to _slurmweb-7_:

[tabs]
======
SLES 15::
+
====
[source,diff]
----
--- /etc/zypp/repos.d/rackslab-slurmweb-6.repo
+++ /etc/zypp/repos.d/rackslab-slurmweb-7.repo
@@ -1,7 +1,7 @@
-[rackslab-slurmweb-6]
+[rackslab-slurmweb-7]
 enabled=1
 autorefresh=1
-baseurl=https://pkgs.rackslab.io/rpm/suse15/slurmweb-6/x86_64
+baseurl=https://pkgs.rackslab.io/rpm/suse15/slurmweb-7/x86_64
 type=rpm-md
 gpgcheck=1
 repo_gpgcheck=0
----
====

SLES 16::
+
====
[source,diff]
----
--- /etc/zypp/repos.d/rackslab-slurmweb-6.repo
+++ /etc/zypp/repos.d/rackslab-slurmweb-7.repo
@@ -1,7 +1,7 @@
-[rackslab-slurmweb-6]
+[rackslab-slurmweb-7]
 enabled=1
 autorefresh=1
-baseurl=https://pkgs.rackslab.io/rpm/suse16/slurmweb-6/x86_64
+baseurl=https://pkgs.rackslab.io/rpm/suse16/slurmweb-7/x86_64
 type=rpm-md
 gpgcheck=1
 repo_gpgcheck=0
----
====
======

Run this command to update repositories and packages:

[source,console]
----
# zypper update
----

=== Generate gateway session key

Slurm-web 7 requires a gateway session secret file to secure server-side login
state during authentication flows. Installations upgraded from version 6 do not
have this file. Generate it as root after upgrading packages and before
restarting the gateway:

include::conf:partial$commands/gen-session-key.adoc[]

NOTE: By default, the session secret key file is generated in
[.path]#`/var/lib/slurm-web/session.key`#. You can set `session_key` in the
`[service]` section of [.path]#`/etc/slurm-web/gateway.ini`# to use a custom
path.

See xref:usage:manpages/slurm-web-gen-session-key.adoc[`slurm-web gen-session-key`
command manpage] and xref:conf:auth/oidc.adoc[OIDC authentication] for more
details.

=== Authorization policy actions

Slurm-web 7 renames authorization policy actions from the legacy `view-*`
prefix to `<resource>-view`, consistent with actions such as `associations-view`
and `cache-view`.

If defined, the custom site policy in [.path]#`/etc/slurm-web/policy.ini`# must
be updated to use the new action names:

[cols="1,1"]
|===
|Deprecated legacy action |New action

|`view-stats` |`stats-view`
|`view-jobs` |`jobs-view`
|`view-nodes` |`nodes-view`
|`view-partitions` |`partitions-view`
|`view-qos` |`qos-view`
|`view-accounts` |`accounts-view`
|`view-reservations` |`reservations-view`
|===

For example, update a role definition from:

[source,ini]
----
[user]
actions=view-stats,view-jobs,view-nodes
----

to:

[source,ini]
----
[user]
actions=stats-view,jobs-view,nodes-view
----

Installations without a custom [.path]#`/etc/slurm-web/policy.ini`# file use the
updated vendor default policy and do not require this change.

NOTE: Deprecated legacy `view-*` action names remain accepted in custom
[.path]#`policy.ini`# files. They are automatically mapped to the new names at
load time, with a deprecation warning logged until the file is updated.

See xref:conf:policy.adoc[authorization policy configuration guide] for the full
list of actions and roles.

Then follow the xref:#_restart_services[restart services] and
xref:#_check_status[check status] steps in the general procedure above to
complete the upgrade.
