summaryrefslogtreecommitdiffstats
path: root/extras/snap/README.md
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2021-01-26 10:51:13 -0500
committerDave Barach <openvpp@barachs.net>2021-01-26 16:07:53 +0000
commit832a31652607244331f2acafbcda158b7577a919 (patch)
tree8999265413c1fa6cb41be3fab8d605fab0ee5d0a /extras/snap/README.md
parent86f1232ddee5b1751c6ff683892072111d0e2dee (diff)
misc: fix snap image build
Clean up snapcraft.yaml bit rot, switch to Ubuntu 20.04, add README.md Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2e0d3925cf43541e70b59083f8c91af539aa34e6
Diffstat (limited to 'extras/snap/README.md')
-rw-r--r--extras/snap/README.md83
1 files changed, 83 insertions, 0 deletions
diff --git a/extras/snap/README.md b/extras/snap/README.md
new file mode 100644
index 00000000000..9387184533d
--- /dev/null
+++ b/extras/snap/README.md
@@ -0,0 +1,83 @@
+General
+-------
+
+The external dependency package will not build in the snapcraft
+vm. The path of least resistance is to copy it to the root of the
+(original) workspace before running the prep script.
+
+Snapcraft has mount issues except under /home. Run the prep script and
+copy the entire directory (including the .tgz file) under
+/home/yourself.
+
+Run the prep script
+-------------------
+
+```
+ $ cd <vpp-workspace>/extras/snap
+ $ ./prep
+```
+
+Copy data to /home (if necessary)
+
+```
+ $ mkdir /home/xxx
+ $ cd <vpp-workspace>/extras/snap
+ $ cp * /home/xxx
+
+Set snapcraft environment variables
+-----------------------------------
+
+Minimum requirements:
+
+```
+ SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G
+ SNAPCRAFT_BUILD_ENVIRONMENT_DISK=32G
+```
+
+Optional:
+
+```
+ SNAPCRAFT_BUILD_ENVIRONMENT_CPU=8
+ SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=yes
+```
+
+Run snapcraft
+-------------
+
+With luck, simply running snapcraft will produce the snap
+
+```
+ $ <environment-variable-settings> snapcraft [--debug]
+```
+
+Rerunning snapcraft phases
+--------------------------
+
+Here's how to (re)run individual phases, to avoid starting from
+scratch N times in case of errors:
+
+```
+ snapcraft pull [<part-name>]
+ snapcraft build [<part-name>]
+ snapcraft stage [<part-name>]
+ snapcraft prime [<part-name>]
+ snapcraft snap or snapcraft
+```
+
+Restart without rebuilding VM
+-----------------------------
+
+To restart from scratch without rebuilding the VM:
+
+```
+ snapcraft clean vpp
+```
+
+Delete (all) snapcraft VMs
+--------------------------
+
+```
+ for vm in $(multipass list | awk '{print $1}' | grep ^snapcraft-); do
+ multipass delete $vm --purge
+ done
+```