Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ site/
*~

environments/*/julia-exfel-sysimage.so
applications/hhg-studio/hhg-studio.sif
52 changes: 52 additions & 0 deletions applications/hhg-studio/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Base image with workdir and apt (update/install) caching
FROM ubuntu AS base

WORKDIR /opt/hhg-studio

RUN <<EOT
rm -f /etc/apt/apt.conf.d/docker-clean
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
EOT

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update


# Stage for pulling the hhg-studio snap package and
# extracting the squashfs root
FROM base AS snap

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt install --no-install-recommends -y snapd squashfs-tools

RUN snap download hhg-studio

RUN unsquashfs hhg-studio_*.snap


FROM base

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt install -y --no-install-recommends qtbase5-dev libpng-dev libglib2.0-dev

COPY --from=snap /opt/hhg-studio/squashfs-root ./squashfs-root

# Define environment vars used by snap (launch.sh script)
#ENV WAYLAND_DISABLE=1
#ENV QT_DEBUG_PLUGINS=1
ENV SNAP_ARCH=amd64
ENV RUNTIME=/opt/hhg-studio/squashfs-root
ENV SNAP=/opt/hhg-studio/squashfs-root
ENV SNAP_USER_COMMON=/tmp/hhg-studio/common
ENV SNAP_USER_DATA=/tmp/hhg-studio/home

RUN <<EOT
cp /opt/hhg-studio/squashfs-root/usr/share/glib-2.0/schemas/* /usr/share/glib-2.0/schemas/.
glib-compile-schemas /usr/share/glib-2.0/schemas/
EOT

ENTRYPOINT ["/opt/hhg-studio/squashfs-root/bin/desktop-launch", "/opt/hhg-studio/squashfs-root/usr/local/bin/hhg-studio"]

11 changes: 11 additions & 0 deletions applications/hhg-studio/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: all image sif clean

all: sif

image:
podman build -t hhg-studio:latest .

sif: image
podman save hhg-studio:latest -o /tmp/hhg-studio.tar
singularity build hhg-studio.sif docker-archive:///tmp/hhg-studio.tar

13 changes: 13 additions & 0 deletions applications/hhg-studio/Modulefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%Module1.0

proc ModulesHelp { } {
puts stderr "Loads environment to run hhg-studio (via Singularity)."
}

module-whatis "Provides the 'hhg-studio' command which runs a Singularity image"

# See https://wiki.tcl-lang.org/page/file+normalize
set moddir [file dirname [file dirname [file normalize $ModulesCurrentModulefile/___]]]
set sif_path [file normalize [file join $moddir "hhg-studio.sif"]]

set-alias hhg-studio "singularity run $sif_path"
1 change: 1 addition & 0 deletions modules/hhg-studio