This document describes how to install TPA (Third Party App) via appmgr for NCS540 eXR (x86-64) code versions.
The same procedure can be applied on ASR9000, NCS5000, NCS5500 running eXR. The same can be achived in XR7.
The goal by the end of this article is guiding you on buiding a container image offline and build an rpm using the container image, installing the docker container and deploying iperf on top of that docker.
Contributed by Adan De la luz, CISCO TAC Engineer.
Before proceeding with the steps outlined in this article, ensure the following prerequisites are met:
If you have not installed yet, you must install: python, docker, git and import yaml.
Basic knowledge of working with Docker containers.
Access to the eXR device's command-line interface (CLI) with appropriate administrative privileges.
Familiarity with basic linux commands.
Knowledge of eXR (x86-64) devices and their configuration.
Understanding of python and yaml.
The information in this document is based on these software and hardware versions:
NCS-540 running 7.3.1 eXR code version.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
With the debut of the XR AppMgr in release 7.3.1, there are now expanded capabilities to activate and manage the lifecycle of third-party docker containers directly within the XR Control Plane.
Host(Hypervisor): This is the underlying 64-bit Operating system that acts as the hypervisor on top of which the XR LXC/VM and the Admin LXC/VM are spawned. For LXC based platforms, it provides the shared kernel for the system. It also runs the container/VM daemons like libvirt and docker to spawn the XR and Calvados instances or even user spawned LXC/Docker instances (on LXC based platforms).
Docker technology revolutionizes the world of software deployment and containerization. At its core, Docker simplifies application management by encapsulating applications and their dependencies into lightweight, portable containers.
These containers can run consistently across diverse environments, ensuring that applications behave predictably, regardless of the underlying infrastructure. Docker achieves this through the use of Docker images, which serve as templates for containers. These images are not only stackable and versioned but are also easily distributable and shareable. Github/ios-xr/xr-appmgr-build, This repository contains the source code for a docker image that can be built and run on IOS-XR to redirect the streaming of telemetry data to an active backup collector when a primary collector goes down for any reason. It will automatically reconfigure the router to send telemetry data back to the primary collector when it comes back up. It runs in the background as a docker container managed by the IOS-XR appmgr.
Step 2: Create a file "build.yaml" and add entries for your app.
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % touch build.yaml
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % ls
LICENSE Makefile README.md appmgr_build build.yaml clean.sh docker examples
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % cat > build.yaml
- name: "alpine"
release: "eXR_7.3.1" # Release should correspond to a file in release_configs dir
version: "0.1.0" # Application semantic version
- name: alpine # corresponds to the source name on the router
file: ./alpine.tar.gz # path from xr-appmgr-build root to image
- name: alpine-configs # the name of the directory for the app to mount in its docker run opts
copy_hostname: true # Copy router hostname into config dir (only useful for eXR platforms)
copy_ems_cert: false # Copy router ems certificate into config dir
"name" any name can be used here instead of alpine. This is just a name placeholder for the app. “copy_hostname” copies the router hostname into the app’s config dir, so that the container has access to the router hostname. This is typically used when the application connects to some external controller and needs to identify itself by the configured hostname. “copy_ems_cert” is required for the third party application to be able to connect to the router’s grpc server (if TLS is configured). source the source name is not derived from the RPM name, rather it is defined in the build.yaml. sources: - name: alpine # corresponds to the source name on the router file: ./alpine.tar.gz # Path from xr-appmgr-build root to image.
If you are using the example from Github, you do not need to modify "build.yaml" file, but in the script you will need to add the hostname of your device in case of running eXR.
Step 3: Create the container image .tar and package it as an rpm using the build tool.
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % docker run alpine
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
96526aa774ef: Pull complete
Status: Downloaded newer image for alpine:latest
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest 8ca4688f4f35 5 weeks ago 7.34MB
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % ls alpine.tar.gz
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % docker save alpine | gzip > alpine.tar.gz
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % ls
LICENSE README.md appmgr_build clean.sh examples
Makefile alpine.tar.gz build.yaml docker release_configs
adelaluz@ADELALUZ-M-D0ZV xr-appmgr-build % python3 ./appmgr_build -b build.yaml
Build version: a400af285be39110322fa885e8d9b1b028d547e5
Starting to build package: alpine
Building docker image arhashem/xr-centos...
docker build docker -f docker/Centos.Dockerfile -t arhashem/xr-centos
[+] Building 44.8s (8/8)
Done building package alpine
You can see the RPMs for XR7 and eXR have been created as follow: