Skip to content

Feature request: Snap packaging

Snap packaging

Proposer

  • Adam Israel

Type

Feature

Target MDG/TF

DevOps

Description

This feature would add support for additional packaging formats for each OSM component as well as the overall release.

Using snapcraft, a snapcraft.yaml would be written for each OSM component (RO, SO, UI, etc.). This file is similar to Debian packaging or a Dockerfile in that it describes how to build and install software. Additionally, these snaps are easier to create, faster to install, safer to run, and update automatically and transactionally so that the application is always current and functional. Snaps are supported by multiple distributions of Linux across several hardware architectures.

Tracks can be leveraged so that a user could install R3 and only receive updates to the R3 release even as new versions (R4, R5, etc) become available.

Snaps exist across multiple channels: stable, candidate, beta, and edge. These risk-based channels denote the stability of the software, making it easier for developers and integrators to test new builds before they're released for general availability.

The installation script can then install OSM and all of it's dependencies via snap, so the end user no longer needs to have build tools installed or wait through the compilation process. The download and installation of OSM takes minutes rather than hour(s).

Demo or definition of done

This is an example of a work-in-progress snapcraft.yaml for the SO component, producing a single snap binary that can then be installed repeatably.

name: osm-so
version: 'R3.0.0'
summary: Open Source Mano - Service Orchestrator
description: |
  This snap contains the Service Orchestrator (SO) component of the Open Source
  Mano Release 3.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
    launchpad:
        daemon: simple
        command: usr/rift/rift-shell -r -i usr/rift -a usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode
    rift-shell:
        command: usr/rift/rift-shell
parts:
    build-deps:
        plugin: riftio
        stage-packages:
            - rw.tools-container-tools
            - rw.tools-scripts
            - rw.toolchain-rwbase
            - rw.toolchain-rwtoolchain
            - rw.core.mgmt-mgmt
            - rw.core.util-util
            - rw.core.rwvx-rwvx
            - rw.core.rwvx-rwdts
            - rw.automation.core-rwauto
            - rw.core.rwvx-rwha-1.0
    so:
        after:
            - build-deps
        source: https://osm.etsi.org/gerrit/osm/SO.git
        source-type: git
        source-depth: 1
        source-tag: v1.0.5
        plugin: cmake
        build-packages:
            - rw.tools-scripts
            - rw.toolchain-rwbase
            - rw.toolchain-rwtoolchain
            - rw.core.mgmt-mgmt
            - rw.core.util-util
            - rw.core.rwvx-rwvx
            - rw.core.rwvx-rwdts
            - rw.automation.core-rwauto
            - rw.core.rwvx-rwha-1.0
        build: |
            export RIFT_BUILD=$SNAPCRAFT_STAGE/usr/rift
            export RIFT_PLATFORM=ub16
            export RIFT_SHELL=$RIFT_BUILD/rift-shell
            cmake /root/osm/snap/SO/parts/so/src -DCMAKE_INSTALL_PREFIX= -DCMAKE_MODULE_PATH=$SNAPCRAFT_STAGE/usr/rift/cmake/modules -DRIFT_SUBMODULE_NAME=$RIFT_BUILD
        configflags:
            - -DCMAKE_MODULE_PATH=$SNAPCRAFT_STAGE/usr/rift/cmake/modules