Skip to main content
Version: 1.7.0

Packaging

TL;DR​

  1. Run fab release package on the host to create production packages inside the gateway VM
  2. Commit changes to build-magma.sh and magma.lockfile.ubuntu

Creating a production release package​

Run the fab command under lte/gateway/ on the host to create a Magma release. This runs the build-magma.sh script with the latest commit id with production compiler flags (RelWithDebInfo). It builds everything, identifies dependencies (assuming they're specified in the setup.py properly), and creates a Debian package in the magma-packages/ directory on dev VM.

If you want to bump the package version, this can be done inside build-magma.sh. The version number should be bumped when there is a minor or major feature or bug fix release. If you're just making a minor tweak (e.g., mistake in building the package), you can also increment the iteration number.

Creating a development package​

To create an AGW package with debug compiler flags (Debug), run fab dev package

Testing a release package before you push it​

You should always do this. In general, try your best not to release broken packages.

  1. Build the release like you normally would.
  2. Spin up a fresh prod VM or gateway machine and copy the magma_<version>.deb generated above.
  3. Run sudo apt-get install gdebi; sudo gdebi magma_<version>.deb
  4. A VM reload or gateway reboot will likely be required due to kernel upgrade.

This will simulate the exact steps that apt-get performs in production. After you've done this, your environment is identical to what you'll have if you had released your package and run apt-get install magma.

If you want to test upgrading versions, skip the part where you spin up a fresh prod VM, and instead set up a VM with whatever version you're trying to test upgrade from. For example, if you want to test upgrading from the currently released version N to the new version N+1, install magma v(N) on the prod VM, then install your pre-release package of magma v(N+1).

Building Python dependencies​

The pydep tool lets you build Python dependencies. By default, build-magma.sh figures out what Python packages we depend on, but it doesn't build those packages. You can manually build packages by running

./pydep finddep -b ../python/setup.py

This will figure out what Python dependencies aren't satisfied by released system packages and build those. You only need to do this when you've added a Python dependency that doesn't have a debian package already available that satisfies your constraints.

What is magma.lockfile?​

magma.lockfile is generated by pydep every time you run build-magma.sh and captures a specific set of Python packages that satisfy the Python dependencies of Magma. This lets us keep track of what we're actually using for each release. The lockfile has a distro-specific suffix. Ubuntu packaging, for example, uses magma.lockfile.ubuntu.