How to upgrade the OSM Platform: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
(Replaces osm for opensourcemano in image tags to be consistent with REL5)
Line 52: Line 52:
  git clone https://osm.etsi.org/gerrit/osm/RO
  git clone https://osm.etsi.org/gerrit/osm/RO
  #you can then work in the cloned repo, apply patches with git pull, etc.
  #you can then work in the cloned repo, apply patches with git pull, etc.
  docker build RO -f RO/docker/Dockerfile-local -t osm/ro --no-cache
  docker build RO -f RO/docker/Dockerfile-local -t opensourcemano/ro --no-cache
  docker service update osm_ro --force
  docker service update osm_ro --force --image opensourcemano/ro
#Optionally, you can restart the whole stack
#docker stack rm osm
#docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm


For LCM:
For LCM:
  git clone https://osm.etsi.org/gerrit/osm/LCM
  git clone https://osm.etsi.org/gerrit/osm/LCM
  #you can then work in the cloned repo, apply patches with git pull, etc.
  #you can then work in the cloned repo, apply patches with git pull, etc.
  docker build LCM -f LCM/Dockerfile.local -t osm/lcm --no-cache
  docker build LCM -f LCM/Dockerfile.local -t opensourcemano/lcm --no-cache
  docker service update osm_lcm --force
  docker service update osm_lcm --force --image opensourcemano/lcm
#Optionally, you can restart the whole stack
#docker stack rm osm
#docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm


For MON and PM:
For MON:
  git clone https://osm.etsi.org/gerrit/osm/MON
  git clone https://osm.etsi.org/gerrit/osm/MON
  #you can then work in the cloned repo, apply patches with git pull, etc.
  #you can then work in the cloned repo, apply patches with git pull, etc.
  docker build MON -f MON/docker/Dockerfile -t osm/mon --no-cache
  docker build MON -f MON/docker/Dockerfile -t opensourcemano/mon --no-cache
  docker build MON/policy_module -f MON/policy_module/Dockerfile -t osm/pm --no-cache
docker service update osm_mon --force --image opensourcemano/mon
  docker service update osm_mon --force
 
docker service update osm_pm --force
For POL:
#Optionally, you can restart the whole stack
git clone https://osm.etsi.org/gerrit/osm/POL
#docker stack rm osm
#you can then work in the cloned repo, apply patches with git pull, etc.
#docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
  docker build MON -f MON/docker/Dockerfile -t opensourcemano/pol --no-cache
  docker service update osm_mon --force --image opensourcemano/pol


For NBI:
For NBI:
  git clone https://osm.etsi.org/gerrit/osm/NBI
  git clone https://osm.etsi.org/gerrit/osm/NBI
  #you can then work in the cloned repo, apply patches with git pull, etc.
  #you can then work in the cloned repo, apply patches with git pull, etc.
  docker build NBI -f NBI/Dockerfile.local -t osm/nbi --no-cache
  docker build NBI -f NBI/Dockerfile.local -t opensourcemano/nbi --no-cache
  docker service update osm_nbi --force
  docker service update osm_nbi --force --image opensourcemano/nbi
#Optionally, you can restart the whole stack
#docker stack rm osm
#docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm


For light UI:
For light UI:
  git clone https://osm.etsi.org/gerrit/osm/LW-UI
  git clone https://osm.etsi.org/gerrit/osm/LW-UI
  #you can then work in the cloned repo, apply patches with git pull, etc.
  #you can then work in the cloned repo, apply patches with git pull, etc.
  docker build LW-UI -t osm/light-ui -f LW-UI/Dockerfile --no-cache
  docker build LW-UI -f LW-UI/Dockerfile -t opensourcemano/light-ui --no-cache
  docker service update osm_light-ui --force
  docker service update osm_light-ui --force --image opensourcemano/light-ui
#Optionally, you can restart the whole stack
 
  #docker stack rm osm
Optionally, you can restart the whole stack:
  #docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
  docker stack rm osm && sleep 60
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

Revision as of 20:57, 5 December 2018

Upgrading the OSM platform

Due to the new architecture and dockerized components introduced from OSM Release FOUR, OSM platform upgrade is easier than ever. Upgrading to the latest minor version is as simple as running again the installer:

wget https://osm-download.etsi.org/ftp/osm-5.0-five/install_osm.sh
chmod +x install_osm.sh
./install_osm.sh

You will be asked if you want to proceed with the installation and configuration of LXD, juju, docker CE and the initialization of a local docker swarm, as pre-requirements. Please answer "y".

Then, some dialog messages related to LXD configuration will be shown. This is what you have to answer:

  • Do you want to configure the LXD bridge? Yes
  • Do you want to setup an IPv4 subnet? Yes
  • << Default values apply for next questions >>
  • Do you want to setup an IPv6 subnet? No

That's all. You will have the newest OSM version installed.

Upgrading only a specific component to use the latest stable version, the master branch or an old version (advanced users)

Upgrading a specific OSM component without upgrading the others accordingly may lead to potential inconsistencies. Unless you are really sure about what you are doing, please use this procedure with caution.

You can use options -b and -m in the installer:

./install_osm.sh --help
usage: ./install_osm.sh [OPTIONS]
Install OSM from binaries or source code (by default, from binaries)
 OPTIONS
...
    -b <refspec>:   install OSM from source code using a specific branch (master, v2.0, ...) or tag
                    -b master          (main dev branch)
                    -b v2.0            (v2.0 branch)
                    -b tags/v1.1.0     (a specific tag)
                    ...
    -m <MODULE>:    install OSM but only rebuild the specified docker images (RO, LCM, NBI, LW-UI, MON, KAFKA, MONGO, NONE)

For instance, to upgrade the RO to the latest stable version:

./install_osm.sh -m RO

Or to use master branch in LCM:

./install_osm.sh -m LCM -b master

Or to use an old version of MON:

./install_osm.sh -m MON -b tags/v5.0.2

Upgrading a specific component to use your own cloned repo (e.g. for developing purposes)

Upgrading a specific OSM component without upgrading the others accordingly may lead to potential inconsistencies. Unless you are really sure about what you are doing, please use this procedure with caution.

For RO (ro and ro-db):

docker pull mysql:5
git clone https://osm.etsi.org/gerrit/osm/RO
#you can then work in the cloned repo, apply patches with git pull, etc.
docker build RO -f RO/docker/Dockerfile-local -t opensourcemano/ro --no-cache
docker service update osm_ro --force --image opensourcemano/ro

For LCM:

git clone https://osm.etsi.org/gerrit/osm/LCM
#you can then work in the cloned repo, apply patches with git pull, etc.
docker build LCM -f LCM/Dockerfile.local -t opensourcemano/lcm --no-cache
docker service update osm_lcm --force --image opensourcemano/lcm

For MON:

git clone https://osm.etsi.org/gerrit/osm/MON
#you can then work in the cloned repo, apply patches with git pull, etc.
docker build MON -f MON/docker/Dockerfile -t opensourcemano/mon --no-cache
docker service update osm_mon --force --image opensourcemano/mon

For POL:

git clone https://osm.etsi.org/gerrit/osm/POL
#you can then work in the cloned repo, apply patches with git pull, etc.
docker build MON -f MON/docker/Dockerfile -t opensourcemano/pol --no-cache
docker service update osm_mon --force --image opensourcemano/pol

For NBI:

git clone https://osm.etsi.org/gerrit/osm/NBI
#you can then work in the cloned repo, apply patches with git pull, etc.
docker build NBI -f NBI/Dockerfile.local -t opensourcemano/nbi --no-cache
docker service update osm_nbi --force --image opensourcemano/nbi

For light UI:

git clone https://osm.etsi.org/gerrit/osm/LW-UI
#you can then work in the cloned repo, apply patches with git pull, etc.
docker build LW-UI -f LW-UI/Dockerfile -t opensourcemano/light-ui --no-cache
docker service update osm_light-ui --force --image opensourcemano/light-ui

Optionally, you can restart the whole stack:

docker stack rm osm && sleep 60
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm