Greetings Store Team
Could I please have the following auto-connections for my snap gambol
?
lxd
→ so gambol can connect to LXD via the unix socket located under /var/snap/lxd/commondot-gambol
→ personal-files write access to the directory $HOME/.gambol
gambol is a tool that the Ubuntu HPC team developed for running the end-to-end/integration tests we have for the distributed applications we work with. Most of our snaps require multiple services to run correctly - for example, the Slurm snap needs an LDAP server, NFS server, control, and compute service before you can even think about doing e2e tests - so we wrote gambol to help with orchestrating those tests. Also, we got tired of burning CI minutes, so we wanted something that runs the same on locally on our laptops first before running in GitHub CI runners.
You can audit the gambol source code here on GitHub
Why we need the lxd
connection
gambol is similar to GitHub Actions where jobs (we call them acts) are run inside isolated environments to prevent polluting the base environment of the runner. Instead of some fancy VM sauce, gambol will request a system container from LXD to run an act within. This is typically what a act would look like
nfs-server:
name: "Provision shared storage integration"
run-on: noble
keep-alive: true
input:
- host-path: testdata/sssd.conf
path: sssd.conf
- host-path: testdata/exports.conf
path: exports
scenes:
- name: "Install NFS server (nfs-kernel-server)"
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get install -y nfs-kernel-server sssd-ldap
- name: "Connect to IAM provider"
run: |
mv sssd.conf /etc/sssd
chmod 0600 /etc/sssd/sssd.conf
chown root:root /etc/sssd/sssd.conf
systemctl restart sssd
- name: "Start NFS server"
run: |
mkdir -p /home/researcher
chown researcher:researchers /home/researcher
mv exports /etc
exportfs -a
systemctl restart nfs-server
gambol communicates with LXD via its unix socket to manage instances used for running scenes (steps). The idea is that you can easily set up LXD on your local machine with lxd init --auto
and immediately start running integration tests for our artifacts.
Here’s an example of us using gambol test configless mode for our Slurm snap.
Why we need the dot-gambol
connection
gambol uses a bbolt database located under $HOME/.gambol
to cache artifacts between acts.
We have this caching functionality because even though acts run within isolated environment, we still need to exchange files/directories between instances. For example, Slurm requires that you exchange a key file between all the nodes in the cluster. After we provision the controller, we put the key file into the bbolt cache. Then, when any act instance needs that key file, the key file is pulled from the cache and injected into the instance for further processing.
Let me know if you have any questions, Store Team!