From 98a9dac4e7bccb6ad430f863fff3c358855ede9d Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Thu, 19 Dec 2019 11:18:00 +0100 Subject: [PATCH 1/2] 03-installing-osm.md: fix procedure to upgrade OSM when using K8s Signed-off-by: garciadeblas --- 03-installing-osm.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/03-installing-osm.md b/03-installing-osm.md index e33f6ed..e4955f8 100644 --- a/03-installing-osm.md +++ b/03-installing-osm.md @@ -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: -- GitLab From aa8a9ba945e75f549e7238c6c44f8ac630f070bc Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 20 Dec 2019 14:05:00 +0100 Subject: [PATCH 2/2] Updated installation procedure for osmclient Signed-off-by: garciadeblas --- 10-osm-client-commands-reference.md | 36 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/10-osm-client-commands-reference.md b/10-osm-client-commands-reference.md index 7afe76e..452b8f2 100644 --- a/10-osm-client-commands-reference.md +++ b/10-osm-client-commands-reference.md @@ -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 -- GitLab