Commit e7695634 authored by Francisco-Javier Ramon Salguero's avatar Francisco-Javier Ramon Salguero
Browse files

Merge branch 'upgrade_osm' into 'master'

Updated procedures to upgrade osm and to install osmclient

See merge request !20
parents 90c08a9c aa8a9ba9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -567,6 +567,8 @@ 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
kubectl -n osm patch deployment ro --patch '{"spec": {"template": {"spec": {"containers": [{"name": "ro", "image": "opensourcemano/ro:develop"}]}}}}'
kubectl -n osm scale deployment ro --replicas=0
kubectl -n osm scale deployment ro --replicas=1
# In order to make this change persistent after reboots,
# you will have to update the file /etc/osm/docker/osm_pods/ro.yaml to reflect the change
# in the docker image, for instance:
@@ -581,6 +583,8 @@ 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
kubectl -n osm patch deployment lcm --patch '{"spec": {"template": {"spec": {"containers": [{"name": "lcm", "image": "opensourcemano/lcm:develop"}]}}}}'
kubectl -n osm scale deployment lcm --replicas=0
kubectl -n osm scale deployment lcm --replicas=1
# In order to make this change persistent after reboots,
# you will have to update the file /etc/osm/docker/osm_pods/lcm.yaml to reflect the change
# in the docker image, for instance:
@@ -595,6 +599,8 @@ 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
kubectl -n osm patch deployment mon --patch '{"spec": {"template": {"spec": {"containers": [{"name": "mon", "image": "opensourcemano/mon:develop"}]}}}}'
kubectl -n osm scale deployment mon --replicas=0
kubectl -n osm scale deployment mon --replicas=1
# In order to make this change persistent after reboots,
# you will have to update the file /etc/osm/docker/osm_pods/mon.yaml to reflect the change
# in the docker image, for instance:
@@ -609,6 +615,8 @@ 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
kubectl -n osm patch deployment pol --patch '{"spec": {"template": {"spec": {"containers": [{"name": "pol", "image": "opensourcemano/pol:develop"}]}}}}'
kubectl -n osm scale deployment pol --replicas=0
kubectl -n osm scale deployment pol --replicas=1
# In order to make this change persistent after reboots,
# you will have to update the file /etc/osm/docker/osm_pods/pol.yaml to reflect the change
# in the docker image, for instance:
@@ -623,6 +631,8 @@ 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
kubectl -n osm patch deployment nbi --patch '{"spec": {"template": {"spec": {"containers": [{"name": "nbi", "image": "opensourcemano/nbi:develop"}]}}}}'
kubectl -n osm scale deployment nbi --replicas=0
kubectl -n osm scale deployment nbi --replicas=1
# In order to make this change persistent after reboots,
# you will have to update the file /etc/osm/docker/osm_pods/nbi.yaml to reflect the change
# in the docker image, for instance:
@@ -637,6 +647,8 @@ 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
kubectl -n osm patch deployment light-ui --patch '{"spec": {"template": {"spec": {"containers": [{"name": "light-ui", "image": "opensourcemano/light-ui:develop"}]}}}}'
kubectl -n osm scale deployment light-ui --replicas=0
kubectl -n osm scale deployment light-ui --replicas=1
# In order to make this change persistent after reboots,
# you will have to update the file /etc/osm/docker/osm_pods/light-ui.yaml to reflect the change
# in the docker image, for instance:
+21 −15
Original line number Diff line number Diff line
@@ -127,8 +127,6 @@ Commands:
  wim-update                 updates a WIM account
```

TODO:: To be updated to add newest options. Meanwhile you can run `osm --help` to obtain the latest command reference.

## Enable autocompletion

You can enable autocompletion in OSM client by creating a file osm-complete.sh in the following way:
@@ -149,33 +147,41 @@ Then you can add the following to your $HOME/.bashrc file:
### Installing from git repo

```bash
# Ubuntu pre-requirements
sudo apt install python3-pip libcurl4-gnutls-dev libgnutls-dev
# Ubuntu 18.04 pre-requirements
sudo apt-get install python3-pip libcurl4-gnutls-dev
# CentOS pre-requirements
# sudo yum install python3-pip libcurl-devel gnutls-devel
sudo -H pip install python3-magic
sudo -H python3 -m pip install python-magic
# Install OSM Information model
sudo -H pip3 install git+https://osm.etsi.org/gerrit/osm/IM --upgrade
sudo -H python3 -m pip install git+https://osm.etsi.org/gerrit/osm/IM --upgrade
# Install OSM client from the git repo.
# You can install the latest client from master branch in this way:
sudo -H pip3 install git+https://osm.etsi.org/gerrit/osm/osmclient
sudo -H python3 -m pip install git+https://osm.etsi.org/gerrit/osm/osmclient
# You could also install a specific tag/version in this way
sudo -H pip3 install git+https://osm.etsi.org/gerrit/osm/osmclient@v7.0.0rc1
sudo -H python3 -m pip install git+https://osm.etsi.org/gerrit/osm/osmclient@v7.0.0rc1
```

### Installing from cloned repo (for developers)

```bash
# Ubuntu pre-requirements
sudo apt install python3-pip libcurl4-gnutls-dev libgnutls-dev
# Make sure that
# sudo yum install python-pip libcurl-devel gnutls-devel
sudo -H pip install python3-magic
# Ubuntu 18.04 pre-requirements 
sudo apt-get install python3-pip libcurl4-openssl-dev libssl-dev
# Centos pre-requirements:
# sudo yum install python3-pip libcurl-devel gnutls-devel
sudo -H python3 -m pip install python-magic
# Install OSM Information model
sudo -H pip3 install git+https://osm.etsi.org/gerrit/osm/IM --upgrade
sudo -H python3 -m pip install git+https://osm.etsi.org/gerrit/osm/IM --upgrade
# Clone the osmclient repo and install OSM client from the git repo.
git clone https://osm.etsi.org/gerrit/osm/osmclient
sudo -H pip3 install osmclient
cd osmclient
python3 -m pip install --user -e .
# logout and login so that PATH can be updated. Executable osm will be found in /home/ubuntu/.local/bin
```

To uninstall, just:

```bash
python3 -m pip uninstall osmclient
```

## Using osmclient as a library to interact with OSM