This page discusses modification to the Artanis web server softare required for packaging an Artanis application. Guidelines for writing a Guix compatible Artanis application can be found here.
Artanis
GNU Artanis is a web server written in Guile (a scheme dialect). Artanis -the web server software - has been packaged for Guix. The packaging recipe can be found in …/gnu/packages/guile-xyz.scm. Artanis applications such as LIMS*Nucleus are not by default packageable by guix due to the presence of a writeable ../tmp directory in the application folder. Here is the partial directory structure of LIMS*Nucleus:
The directory ../limsn/limsn/tmp holds temporary files created while users are navigating the application. Since the Guix store is immutable, a temporary folder is not allowed and must be moved outside of the application. Artanis defines a variable ‘current-toplevel’ which, in the above example would be ../limsn/limsn. In the labsolns modified artanis all references to ‘current-toplevel’ are divided into two groups:
variable | description | |
---|---|---|
1 | current-toplevel | redirected to /tmp/limsn i.e. references that create a temporary file |
2 | immutable-toplevel | references that point to the original ‘current-toplevel’ i.e. references that do not create files and can reside in the immutable /gnu/store… directory |
Source Code Modifications
To allow for Guix packaging of Artanis applications the following modifications to the Artanis source code are introduced during packaging:
File | line | Modified source code |
---|---|---|
utils.scm | 279 | (if (immutable-toplevel) |
280 | (format #f “~a/pub/~a” (immutable-toplevel) path) | |
833 | (let* ((toplevel (immutable-toplevel)) | |
1309 | (immutable-toplevel) file))) | |
tpl/parser.scm | 40 | (format #f “~a/~a/~a” (immutable-toplevel) pub args)))) |
52 | (mfile (format #f “~a/~a/manifest.json” (immutable-toplevel) path)) | |
commands/work.scm | 77 | (let ((entry (string-append (immutable-toplevel) “/” *artanis-entry*))) |
126 | (add-to-load-path (immutable-toplevel)) | |
mvc/controller.scm | 45 | (immutable-toplevel) ’name method))) |
62 | (define toplevel (immutable-toplevel)) | |
webapi/restful.scm | 58 | (load (format #f “~a/app/api/~a.scm” (immutable-toplevel) s))) |
Recipe File Modifications
The above changes are introduced during the installation of Artanis. Recipe file additions are:
1 | ;;============START forguix mods========================================================================= |
Get the modified Artanis software
- Set up your system so that you can utilize the labsolns channel
- guix pull
- guix edit artanis (to see the recipe)
- guix package -i artanis (to install or upgrade to the modified Artanis)
Caution
Note that the Guix modified Artanis is labeled as v0.5.2 and so (Sept 2022) will “upgrade” your copy of Artanis.
Guix modified Artanis has been tested with LIMS*Nucleus. Modifications may have broken Artanis features that are not used by LIMS*Nucleus.