Skip to content

Commit 8ab3f90

Browse files
committed
add hhg-studio application
1 parent e6fed9e commit 8ab3f90

5 files changed

Lines changed: 78 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ site/
88
*~
99

1010
environments/*/julia-exfel-sysimage.so
11+
applications/hhg-studio/hhg-studio.sif

applications/hhg-studio/Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Base image with workdir and apt (update/install) caching
2+
FROM ubuntu AS base
3+
4+
WORKDIR /opt/hhg-studio
5+
6+
RUN <<EOT
7+
rm -f /etc/apt/apt.conf.d/docker-clean
8+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
9+
EOT
10+
11+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
12+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
13+
apt update
14+
15+
16+
# Stage for pulling the hhg-studio snap package and
17+
# extracting the squashfs root
18+
FROM base AS snap
19+
20+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
21+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
22+
apt update && apt install --no-install-recommends -y snapd squashfs-tools
23+
24+
RUN snap download hhg-studio
25+
26+
RUN unsquashfs hhg-studio_*.snap
27+
28+
29+
FROM base
30+
31+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
32+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
33+
apt update && apt install -y --no-install-recommends qtbase5-dev libpng-dev libglib2.0-dev
34+
35+
COPY --from=snap /opt/hhg-studio/squashfs-root ./squashfs-root
36+
37+
# Define environment vars used by snap (launch.sh script)
38+
#ENV WAYLAND_DISABLE=1
39+
#ENV QT_DEBUG_PLUGINS=1
40+
ENV SNAP_ARCH=amd64
41+
ENV RUNTIME=/opt/hhg-studio/squashfs-root
42+
ENV SNAP=/opt/hhg-studio/squashfs-root
43+
ENV SNAP_USER_COMMON=/tmp/hhg-studio/common
44+
ENV SNAP_USER_DATA=/tmp/hhg-studio/home
45+
46+
RUN <<EOT
47+
cp /opt/hhg-studio/squashfs-root/usr/share/glib-2.0/schemas/* /usr/share/glib-2.0/schemas/.
48+
glib-compile-schemas /usr/share/glib-2.0/schemas/
49+
EOT
50+
51+
ENTRYPOINT ["/opt/hhg-studio/squashfs-root/bin/desktop-launch", "/opt/hhg-studio/squashfs-root/usr/local/bin/hhg-studio"]
52+

applications/hhg-studio/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: all image sif clean
2+
3+
all: sif
4+
5+
image:
6+
podman build -t hhg-studio:latest .
7+
8+
sif: image
9+
podman save hhg-studio:latest -o /tmp/hhg-studio.tar
10+
singularity build hhg-studio.sif docker-archive:///tmp/hhg-studio.tar
11+

applications/hhg-studio/Modulefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#%Module1.0
2+
3+
proc ModulesHelp { } {
4+
puts stderr "Loads environment to run hhg-studio (via Singularity)."
5+
}
6+
7+
module-whatis "Provides the 'hhg-studio' command which runs a Singularity image"
8+
9+
# See https://wiki.tcl-lang.org/page/file+normalize
10+
set moddir [file dirname [file dirname [file normalize $ModulesCurrentModulefile/___]]]
11+
set sif_path [file normalize [file join $moddir "hhg-studio.sif"]]
12+
13+
set-alias hhg-studio "singularity run $sif_path"

modules/hhg-studio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../applications/hhg-studio/Modulefile

0 commit comments

Comments
 (0)