We build custom web apps in Go as kiosks for our customers, usually deployed on Kubuntu with Ansible for ease of configuration as a kiosk (hide desktop etc).
We’ve just become aware Ubuntu Core & Ubuntu Frame, which fits our use case much better. However, where our app works as a service normally, I am struggling to package it up as a snap - I’ve googled through the documentation, and am finding it sparse or limited, despite us being a pretty simple use case.
Our current service based app architecture is:
/opt/experience <- service binary (go)
/opt/ui-files/ <- bundled HTML/JS files served by service
/opt/config/ <- app configuration files
We use private repos for our apps (and some deps), which seems like a challenge for the go plugin to handle, so have bypassed that step for now in favour of keeping our original build process and resulting tar.gz which contains:
/experience/server <- service binary
/experience/ui-files/ <- bundled web app
with config files just in the root of the CI process to be copied
/config/
I can’t seem to get the basics working to start debugging the process. Current snapcraft file looks like:
name: kiosk-experience
base: core22
version: "test"
summary: A Summary
description: |
Interactive Kiosk
confinement: devmode
grade: stable
parts:
kiosk-experience:
source: ./ansible/files/experience/experience-release-v0.57.tar.gz
plugin: dump
# organize:
# experience/server: bin/server
apps:
kiosk-experience:
command: experience/server
plugs:
- network
Which results in som e lint warnings (for a future question…!):
Lint warnings:
- library: experience: missing dependency 'libMagickCore-6.Q16.so.6'. (https://snapcraft.io/docs/linters-library)
- library: experience: missing dependency 'libMagickWand-6.Q16.so.6'. (https://snapcraft.io/docs/linters-library)
- library: experience: missing dependency 'libasound.so.2'. (https://snapcraft.io/docs/linters-library)
But what seems more important:
Cannot pack snap file: Command '['snap', 'pack', '--filename', '1421-malibu_test_amd64.snap', '--compression', 'xz', PosixPath('/root/prime'), PosixPath('/root/project')]' returned non-zero exit status 1. (2023/07/05 07:48:18.418754 container.go:215: in snap "kiosk-experience": path "experience/server" does not exist
2023/07/05 07:48:18.418801 container.go:215: in snap "kiosk-experience": path "experience" does not exist
error: cannot pack "/root/prime": snap is unusable due to missing files)
Failed to execute pack in instance.
I’m keen to get my head around this process, or understand if this is not the right thing to be doing, but don’t seem to have found the right examples to learn from. The app needs to access webcam, USB and printers on the host device - all of which I think is possible. The snap needs to override the UI and server parts on new release, but leave the config alone in a place we can edit using ansible.
Any pointers would be great.