Files
ilkerandClaude Opus 5 f8a9d658e5 hpcod: the desktop opens
Six things were wrong, one behind the other, and every one of them let
the session get further before dying.

  The per-user server never restarted. "nginx_stage pun -s stop" prints a
  path and does nothing; the process serving my requests was 42 minutes
  old, so none of the configuration I was changing had any effect. Every
  conclusion drawn before finding this was drawn against a stale process.
  "nginx -u USER -s stop" actually stops it.

  The cluster config named its own cluster, so every sbatch passed
  --cluster, which Slurm can only resolve through slurmdbd. There is no
  accounting database here: "'c001' can't be reached now". The key is for
  federated Slurm. Removed, and the job queued and ran.

  TigerVNC is not TurboVNC. OnDemand's template runs "vncserver -log
  ... -noxstartup" and both are TurboVNC options; EL9's TigerVNC rejects
  -log outright. The container carries TurboVNC from the project's own
  release now, pinned.

  TurboVNC's vncserver is a Perl script and the container had no perl.
  It installed cleanly, sat on PATH, and died with "env: 'perl': No such
  file or directory". The build now runs perl -c against it.

  --bind /opt mounted the host's /opt over the container's own and hid
  /opt/TurboVNC, so vncserver was "command not found" inside an image
  that demonstrably contained it. Only /opt/apps is bound. --cleanenv
  also drops the image's PATH, so the wrapper states it.

  websockify_cmd defaults to /opt/websockify/run. With everything else
  fixed the session came all the way up - Xvnc running, XFCE started,
  connection details written - and stopped at "[websockify]: failed to
  launch!".

  And ood_portal.yml had no node_uri or rnode_uri, so Apache never
  created the proxy locations: the browser got 404 on the websocket for a
  session that was healthy from every other angle.

Verified end to end: connection.yml written with host c001-node1 display
1 websocket 15927, the sessions page offering noVNC, and a real WebSocket
handshake through the public name answering 101 Switching Protocols -
browser to control plane to Apache to websockify to Xvnc.

Two smaller things on the way. A YAML anchor shared between the basic and
vnc wrappers parsed fine and stopped the dashboard from starting at all,
so they are written out. And the cluster user now gets an SSH key of its
own at first boot rather than at image build - baked into the template it
would be one key shared by every cluster - which is what the portal's
terminal needs, and what MPI needs to start ranks over SSH.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 22:08:51 +02:00

73 lines
3.4 KiB
Docker

# An interactive desktop, as a container rather than as part of the node image.
#
# The compute nodes run their root filesystem from RAM: 870 MB of image in a
# 2.9 GB tmpfs on a 5.9 GB machine. Putting XFCE and a VNC server in there
# would cost every node several hundred megabytes of memory permanently,
# whether or not anybody ever opens a desktop. /opt is already shared from
# the head and Apptainer is already on the nodes, so a desktop that lives
# there costs nothing until it is used.
#
# Same base as the node image, so the libraries a user's job links against
# are the ones it was built with.
FROM rockylinux:9
# EPEL carries both the desktop and websockify; CRB carries what they build
# against.
RUN dnf install -y -q --nodocs epel-release \
&& dnf config-manager --set-enabled crb \
&& dnf makecache -q
# Deliberately not "@xfce". The group pulls a file manager, a browser, power
# management, printing and a screensaver - none of which mean anything in a
# batch job, and all of which are paid for in bytes and attack surface.
RUN dnf install -y -q --nodocs --setopt=install_weak_deps=False \
xfce4-session xfwm4 xfce4-panel xfdesktop xfce4-settings \
xfce4-terminal dbus-x11 \
python3-websockify \
xterm xorg-x11-fonts-misc xorg-x11-xauth \
procps-ng findutils which \
# TurboVNC's vncserver is a Perl script. Without this it installs
# cleanly, sits on PATH, and dies with "env: 'perl': No such file
# or directory" inside a job that has already queued and started.
perl \
&& dnf clean all -y \
&& rm -rf /var/cache/dnf /usr/share/doc /usr/share/man
# TurboVNC, not the distribution's TigerVNC.
#
# Not a preference: OnDemand's batch-connect template runs
# "vncserver -log ... -noxstartup", and both of those are TurboVNC
# options. EL9's TigerVNC rejects -log outright - the first session died
# with "Fatal server error: Unrecognized option: -log" after queueing,
# starting and getting as far as the X server.
#
# From the project's own release, pinned to a version, rather than a repo
# that can move under us.
# curl is not in the package list above: the base image ships
# curl-minimal, which provides the binary and conflicts with the full
# curl package.
ARG TURBOVNC_VERSION=3.1.1
RUN curl -fsSL -o /tmp/turbovnc.rpm \
"https://github.com/TurboVNC/turbovnc/releases/download/${TURBOVNC_VERSION}/turbovnc-${TURBOVNC_VERSION}.x86_64.rpm" \
&& dnf install -y -q --nodocs /tmp/turbovnc.rpm \
&& rm -f /tmp/turbovnc.rpm \
&& dnf clean all -y
ENV PATH="/opt/TurboVNC/bin:${PATH}"
# What Open OnDemand's batch-connect scripts look for. Failing here beats
# failing inside a job that has already queued, waited and started - which
# is exactly how the TigerVNC problem was found.
RUN command -v Xvnc && command -v vncserver && command -v websockify \
&& command -v xfce4-session && command -v xterm \
&& case "$(command -v vncserver)" in /opt/TurboVNC/*) ;; *) echo "vncserver is not TurboVNC's"; exit 1;; esac \
&& perl -c /opt/TurboVNC/bin/vncserver
# A session that starts nothing is indistinguishable from one that failed,
# so the default is a desktop rather than an empty root window.
RUN printf '%s\n' '#!/bin/sh' 'exec xfce4-session' > /usr/local/bin/hpcod-desktop \
&& chmod 0755 /usr/local/bin/hpcod-desktop
LABEL org.opencontainers.image.title="hpcod desktop" \
org.opencontainers.image.description="XFCE and TigerVNC for Open OnDemand interactive sessions"