How to upgrade the OSM Platform: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
No edit summary
 
(27 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''THIS PAGE IS DEPRECATED'''. OSM User Guide has been moved to a new location: '''https://osm.etsi.org/docs/user-guide/'''
---
__TOC__
== Upgrading the OSM platform ==
== Upgrading the OSM platform ==
Due to the new architecture and dockerized components in OSM Release FOUR, OSM platform upgrade is easier than ever. Upgrading from v4.0.0 to the latest minor version is as simple as running again the installer:
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-4.0-four/install_osm.sh
  wget https://osm-download.etsi.org/ftp/osm-6.0-six/install_osm.sh
  chmod +x install_osm.sh
  chmod +x install_osm.sh
  ./install_osm.sh
  ./install_osm.sh
Line 16: Line 22:
That's all. You will have the newest OSM version installed.
That's all. You will have the newest OSM version installed.


== Upgrading a specific component to use the latest code in the repos ==
== Upgrading the OSM platform from docker images using the latest daily testing docker image or a specific tag ==
For the RO (ro and ro-db):
 
<span style="color:red">Upgrading to the latest daily docker image might lead to potential issues. Moreover, every new re-deployment of the stack will involve a download of a new docker daily image if it exists. Unless you are really sure about what you are doing, please use this procedure with caution.</span>
 
You can use option -t in the installer to specify a specific docker tag to be used by the installer.
 
To install the latest daily images:
./install_osm.sh -t releasesix-daily
 
To install a previous version e.g. v5.0.3:
./install_osm.sh -t v5.0.3
 
The previous commands will do the installation and deployment of the stack, but will not make it persistent after re-deployments of the stack (or reboots). In order to make it persistent, you will have to update the file "docker-compose.yaml". Below an example to update it to use releasesix-daily tag:
 
sudo sed -i "s/ro\:\${TAG\:-latest}/ro\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/lcm\:\${TAG\:-latest}/lcm\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/mon\:\${TAG\:-latest}/mon\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/pol\:\${TAG\:-latest}/pol\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/nbi\:\${TAG\:-latest}/nbi\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/light-ui\:\${TAG\:-latest}/light-ui\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/keystone\:\${TAG\:-latest}/keystone\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
docker stack rm osm && sleep 20
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
 
The osmclient will have to be updated independently. In order to use the latest "testing" osmclient, you will have to update the debian repo to use the testing repo, remove the previous debian package and install the one from the new repo as follows:
sudo apt-get remove python-osmclient
sudo add-apt-repository -r "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseSIX stable osmclient"
sudo add-apt-repository -y "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseSIX-daily testing osmclient"
sudo apt-get update
sudo apt-get install python-osmclient
dpkg -l |grep python-osmclient  #to check the installed version
 
== Upgrading a specific component to use your own cloned repo (e.g. for developing purposes) ==
 
<span style="color:red">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.</span>
 
<span style="color:red">The procedure below involves building manually some docker images. The developer environment might require updating manually the MTU of the docker default "bridge" network following the procedure in this link: https://docs.docker.com/network/bridge/</span>
 
For RO (ro and ro-db):
  docker pull mysql:5
  docker pull mysql:5
  git clone https://osm.etsi.org/gerrit/osm/RO
  git clone https://osm.etsi.org/gerrit/osm/RO
  docker build RO -f RO/docker/Dockerfile-local -t osm/ro --no-cache
#you can then work in the cloned repo, apply patches with git pull, etc.
  docker stack rm osm
  docker build RO -f RO/Dockerfile-local -t opensourcemano/ro:develop --no-cache
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
  docker service update osm_ro --force --image opensourcemano/ro:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/ro\:\${TAG\:-latest}/ro\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
  # 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
  docker build LCM -f LCM/Dockerfile.local -t osm/lcm --no-cache
#you can then work in the cloned repo, apply patches with git pull, etc.
  docker stack rm osm
  docker build LCM -f LCM/Dockerfile.local -t opensourcemano/lcm:develop --no-cache
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
  docker service update osm_lcm --force --image opensourcemano/lcm:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/lcm\:\${TAG\:-latest}/lcm\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
  # 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
  docker build MON -f MON/docker/Dockerfile -t osm/mon --no-cache
#you can then work in the cloned repo, apply patches with git pull, etc.
  docker build MON/policy_module -f MON/policy_module/Dockerfile -t osm/pm --no-cache
  docker build MON -f MON/docker/Dockerfile -t opensourcemano/mon:develop --no-cache
  docker stack rm osm
docker service update osm_mon --force --image opensourcemano/mon:develop
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/mon\:\${TAG\:-latest}/mon\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
 
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 POL -f POL/docker/Dockerfile -t opensourcemano/pol:develop --no-cache
  docker service update osm_pol --force --image opensourcemano/pol:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/pol\:\${TAG\:-latest}/pol\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
  # docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm


For NBI:
For NBI:
  git clone https://osm.etsi.org/gerrit/osm/NBI
  git clone https://osm.etsi.org/gerrit/osm/NBI
  docker build NBI -f NBI/Dockerfile.local -t osm/nbi --no-cache
#you can then work in the cloned repo, apply patches with git pull, etc.
  docker stack rm osm
  docker build NBI -f NBI/Dockerfile.local -t opensourcemano/nbi:develop --no-cache
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
  docker service update osm_nbi --force --image opensourcemano/nbi:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/nbi\:\${TAG\:-latest}/nbi\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
  # 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
  docker build LW-UI -t osm/light-ui -f LW-UI/Dockerfile --no-cache
#you can then work in the cloned repo, apply patches with git pull, etc.
  docker stack rm osm
  docker build LW-UI -f LW-UI/docker/Dockerfile -t opensourcemano/light-ui:develop --no-cache
  docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
docker service update osm_light-ui --force --image opensourcemano/light-ui:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/light-ui\:\${TAG\:-latest}/light-ui\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
  # docker stack rm osm && sleep 60
  # docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm
 
== (OLD, CURRENTLY NOT WORKING) Upgrading only a specific component from source code to use the master branch or an old version (advanced users) ==
 
<span style="color:red">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.</span>
 
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)
 
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

Latest revision as of 16:55, 17 February 2021

THIS PAGE IS DEPRECATED. OSM User Guide has been moved to a new location: https://osm.etsi.org/docs/user-guide/

---

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-6.0-six/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 the OSM platform from docker images using the latest daily testing docker image or a specific tag

Upgrading to the latest daily docker image might lead to potential issues. Moreover, every new re-deployment of the stack will involve a download of a new docker daily image if it exists. Unless you are really sure about what you are doing, please use this procedure with caution.

You can use option -t in the installer to specify a specific docker tag to be used by the installer.

To install the latest daily images:

./install_osm.sh -t releasesix-daily

To install a previous version e.g. v5.0.3:

./install_osm.sh -t v5.0.3

The previous commands will do the installation and deployment of the stack, but will not make it persistent after re-deployments of the stack (or reboots). In order to make it persistent, you will have to update the file "docker-compose.yaml". Below an example to update it to use releasesix-daily tag:

sudo sed -i "s/ro\:\${TAG\:-latest}/ro\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/lcm\:\${TAG\:-latest}/lcm\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/mon\:\${TAG\:-latest}/mon\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/pol\:\${TAG\:-latest}/pol\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/nbi\:\${TAG\:-latest}/nbi\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/light-ui\:\${TAG\:-latest}/light-ui\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
sudo sed -i "s/keystone\:\${TAG\:-latest}/keystone\:\${TAG\:-releasesix-daily}/" /etc/osm/docker/docker-compose.yaml
docker stack rm osm && sleep 20
docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

The osmclient will have to be updated independently. In order to use the latest "testing" osmclient, you will have to update the debian repo to use the testing repo, remove the previous debian package and install the one from the new repo as follows:

sudo apt-get remove python-osmclient
sudo add-apt-repository -r "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseSIX stable osmclient"
sudo add-apt-repository -y "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseSIX-daily testing osmclient"
sudo apt-get update
sudo apt-get install python-osmclient
dpkg -l |grep python-osmclient   #to check the installed version

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.

The procedure below involves building manually some docker images. The developer environment might require updating manually the MTU of the docker default "bridge" network following the procedure in this link: https://docs.docker.com/network/bridge/

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/Dockerfile-local -t opensourcemano/ro:develop --no-cache
docker service update osm_ro --force --image opensourcemano/ro:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/ro\:\${TAG\:-latest}/ro\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

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:develop --no-cache
docker service update osm_lcm --force --image opensourcemano/lcm:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/lcm\:\${TAG\:-latest}/lcm\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

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:develop --no-cache
docker service update osm_mon --force --image opensourcemano/mon:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/mon\:\${TAG\:-latest}/mon\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

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 POL -f POL/docker/Dockerfile -t opensourcemano/pol:develop --no-cache
docker service update osm_pol --force --image opensourcemano/pol:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/pol\:\${TAG\:-latest}/pol\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

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:develop --no-cache
docker service update osm_nbi --force --image opensourcemano/nbi:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/nbi\:\${TAG\:-latest}/nbi\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

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/docker/Dockerfile -t opensourcemano/light-ui:develop --no-cache
docker service update osm_light-ui --force --image opensourcemano/light-ui:develop
# In order to make this change persistent after reboots or restart of the docker stack
# you will have to update the file /etc/osm/docker/docker-compose.yaml to reflect the change
# in the docker image, for instance:
# sudo sed -i "s/light-ui\:\${TAG\:-latest}/light-ui\:\${TAG\:-develop}/" /etc/osm/docker/docker-compose.yaml
# docker stack rm osm && sleep 60
# docker stack deploy -c /etc/osm/docker/docker-compose.yaml osm

(OLD, CURRENTLY NOT WORKING) Upgrading only a specific component from source code to use 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)

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