api: API trace improvements
[vpp.git] / extras / snap / README.md
1 VPP Snap Build   {#snap_doc}
2 --------------
3
4 General
5 -------
6
7 The external dependency package will not build in the snapcraft
8 vm. The path of least resistance is to copy it to the root of the
9 (original) workspace before running the prep script.
10
11 Snapcraft has mount issues except under /home. Run the prep script and
12 copy the entire directory (including the .tgz file) under
13 /home/yourself.
14
15 Run the prep script
16 -------------------
17
18 ```
19   $ cd <vpp-workspace>/extras/snap
20   $ ./prep
21 ```
22
23 Copy data to /home (if necessary)
24
25 ```
26   $ mkdir /home/xxx
27   $ cd <vpp-workspace>/extras/snap
28   $ cp * /home/xxx
29
30 Set snapcraft environment variables
31 -----------------------------------
32
33 Minimum requirements:
34
35 ```
36   SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G
37   SNAPCRAFT_BUILD_ENVIRONMENT_DISK=32G
38 ```
39
40 Optional:
41
42 ```
43   SNAPCRAFT_BUILD_ENVIRONMENT_CPU=8
44   SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=yes
45 ```
46
47 Run snapcraft
48 -------------
49
50 With luck, simply running snapcraft will produce the snap
51
52 ```
53   $ <environment-variable-settings> snapcraft [--debug]
54 ```
55
56 Rerunning snapcraft phases
57 --------------------------
58
59 Here's how to (re)run individual phases, to avoid starting from
60 scratch N times in case of errors:
61
62 ```
63   snapcraft pull [<part-name>]
64   snapcraft build [<part-name>]
65   snapcraft stage [<part-name>]
66   snapcraft prime [<part-name>]
67   snapcraft snap or snapcraft
68 ```
69
70 Restart without rebuilding VM
71 -----------------------------
72
73 To restart from scratch without rebuilding the VM:
74
75 ```
76   snapcraft clean vpp
77 ```
78
79 Delete (all) snapcraft VMs
80 --------------------------
81
82 ```
83   for vm in $(multipass list | awk '{print $1}' | grep ^snapcraft-); do
84         multipass delete $vm --purge
85   done
86 ```