Synology DSM7 SPK for Nomad

November 24, 2021
programming hosting sysadmin

I’ve recently been interested in experimenting with Hashicorp’s Nomad for deploying/running apps as an alternative to the the somewhat convoluted combination of Docker + ansible I currently use. Since I primarily use a Synology NAS for running Dockerized apps, my first hurdle was coming up with a way to somewhat sanely install the nomad server/client on a Synology. I found nomad-spk that was promising, but wasn’t compatible with the latest major version of the Synology OS (aka DSM7). Inspired by that repo, I’ve started nomad-spk-dsm7. It’s very rough at this point and could use more work to be more user friendly (e.g., provide an initial config file, proper daemon start/stop support, etc), but it has worked well enough for me to get started with a simple self-hosted continuous deployment (CD) pipeline (details to hopefully follow)

For future reference, these Synology synopkg-specific env vars are available during SPK install since they may be useful when crafting things like installer scripts:

SYNOPKG_DSM_ARCH
SYNOPKG_DSM_LANGUAGE
SYNOPKG_DSM_VERSION_BUILD
SYNOPKG_DSM_VERSION_MAJOR
SYNOPKG_DSM_VERSION_MINOR
SYNOPKG_PKGDEST_VOL
SYNOPKG_PKGINST_TEMP_DIR
SYNOPKG_PKGNAME
SYNOPKG_PKGVER
SYNOPKG_PKG_PROGRESS_PATH
SYNOPKG_PKG_STATUS
SYNOPKG_TEMP_LOGFILE
SYNOPKG_TEMP_REPLACE_FOLDER
SYNOPKG_TEMP_SPKFILE
SYNOPKG_USERNAME

Vars with example values:

SYNOPKG_DSM_ARCH=apollolake
SYNOPKG_DSM_LANGUAGE=enu
SYNOPKG_DSM_VERSION_BUILD=42218
SYNOPKG_DSM_VERSION_MAJOR=7
SYNOPKG_DSM_VERSION_MINOR=0
SYNOPKG_PKGDEST_VOL=/volume1
SYNOPKG_PKGINST_TEMP_DIR=/volume1/@tmp/pkginstall/extract.OLTqzu/package
SYNOPKG_PKGNAME=nomad
SYNOPKG_PKGVER=1.2.0-0000
SYNOPKG_PKG_PROGRESS_PATH=/tmp/install_progress_nomad
SYNOPKG_PKG_STATUS=INSTALL
SYNOPKG_TEMP_LOGFILE=/tmp/synopkgmgr.log-nomad
SYNOPKG_TEMP_REPLACE_FOLDER=/volume1/@tmp/synopkg.tmp/nomad
SYNOPKG_TEMP_SPKFILE=/var/services/homes/USER/nomad.spk
SYNOPKG_USERNAME=