diff --git a/10-osm-client-commands-reference.md b/10-osm-client-commands-reference.md index 28fb8971004840b2e44f66229bdc17290c6b14c9..fdc343d7bd93992a89e649b660ebb51c49c74706 100644 --- a/10-osm-client-commands-reference.md +++ b/10-osm-client-commands-reference.md @@ -142,64 +142,134 @@ Commands: wim-update updates a WIM account ``` -## Installing standalone OSM Client +## How to install standalone OSM client -OSM client is installed by default in the host where OSM is installed, but it can be also installed as a standalone client. +### How to install OSM Client in Ubuntu 20.04 (RECOMMENDED) -### Installing with debian package - -In order to install the OSM Client in your local Linux machine, you should follow this procedure: +OSM client is installed by default in the host where OSM is installed, but it can be also installed as a standalone client in an Ubuntu 20.04 system, following the procedure below: ```bash # Clean the previous repos that might exist sudo sed -i "/osm-download.etsi.org/d" /etc/apt/sources.list -wget -qO - https://osm-download.etsi.org/repository/osm/debian/ReleaseTWELVE/OSM%20ETSI%20Release%20Key.gpg | sudo apt-key add - + +# Install dependencies +sudo apt-get update +sudo apt-get install -y libcurl4-openssl-dev libssl-dev software-properties-common apt-transport-https +sudo apt-get install -y python3.8 python3-setuptools python3-dev python3-pip + +# Add OSM debian repo +curl -q -o OSM-ETSI-Release-key.gpg https://osm-download.etsi.org/repository/osm/debian/ReleaseTWELVE/OSM%20ETSI%20Release%20Key.gpg +sudo apt-key add OSM-ETSI-Release-key.gpg sudo add-apt-repository -y "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseTWELVE stable devops IM osmclient" sudo apt-get update -sudo apt-get install -y python3-pip -sudo -H python3 -m pip install -U pip -sudo -H python3 -m pip install python-magic pyangbind verboselogs -sudo apt-get install python3-osmclient + +# Install OSM IM and osmclient packages from deb repo +sudo apt-get install python3-osm-im python3-osmclient + +# Install osmclient and osm_im dependencies via pip +sudo -H python3 -m pip install -r /usr/lib/python3/dist-packages/osm_im/requirements.txt -r /usr/lib/python3/dist-packages/osmclient/requirements.txt + +# Install charm to be able to build OSM packages with charms +sudo snap install charm --classic ``` -### Installing from git repo +### How to install OSM Client in Ubuntu 20.04 via pip (ALTERNATIVE) ```bash -# 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 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 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 python3 -m pip install git+https://osm.etsi.org/gerrit/osm/osmclient@v8.0.0rc1 +# Install dependencies +sudo apt-get update +sudo apt-get install -y libcurl4-openssl-dev libssl-dev software-properties-common apt-transport-https +sudo apt-get install -y git wget make +sudo apt-get install -y python3.8 python3-setuptools python3-dev python3-pip + +# Upgrade pip to the latest version (with sudo, to install it globally for all users) +sudo -H python3 -m pip install -U pip + +# Decide which version to use (e.g., v12.0) +export OSM_CLIENT_VERSION=v12.0 + +# Install OSM IM and its dependencies via pip (installed with sudo, to install it globally for all users) +sudo -H python3 -m pip install -r "https://osm.etsi.org/gitweb/?p=osm/IM.git;a=blob_plain;f=requirements.txt;hb=${OSM_CLIENT_VERSION}" +sudo -H python3 -m pip install "git+https://osm.etsi.org/gerrit/osm/IM.git@${OSM_CLIENT_VERSION}#egg=osm-im" --upgrade + +# Clone osmclient repo and checkut the desired version +git clone https://osm.etsi.org/gerrit/osm/osmclient +git -C osmclient checkout ${OSM_CLIENT_VERSION} + +# Install osmclient using pip +sudo -H python3 -m pip install -r osmclient/requirements.txt +sudo -H python3 -m pip install ./osmclient + +# Install charm to be able to build OSM packages with charms +sudo snap install charm --classic ``` -### Installing from cloned repo (for developers) +### How to install OSM Client in RHEL 8.4 ```bash -# 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 pyangbind verboselogs -# Install OSM Information model -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. +# Install dependencies +sudo dnf upgrade -y +sudo dnf install -y libcurl-devel openssl-devel +sudo dnf install -y git wget make patch gcc +sudo dnf install -y python38 python38-devel + +# Upgrade pip to the latest version (with sudo, to install it globally for all users) +sudo -H python3 -m pip install -U pip + +# Decide which version to use (e.g., v12.0) +export OSM_CLIENT_VERSION=v12.0 + +# Install OSM IM and its dependencies via pip (installed with sudo, to install it globally for all users) +sudo -H python3 -m pip install -r "https://osm.etsi.org/gitweb/?p=osm/IM.git;a=blob_plain;f=requirements.txt;hb=${OSM_CLIENT_VERSION}" +sudo -H bash -c "PATH=$PATH:/usr/local/bin python3 -m pip install \"git+https://osm.etsi.org/gerrit/osm/IM.git@${OSM_CLIENT_VERSION}#egg=osm-im\" --upgrade" + +# Clone osmclient repo and checkut the desired version git clone https://osm.etsi.org/gerrit/osm/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 +git -C osmclient checkout ${OSM_CLIENT_VERSION} + +# Install osmclient using pip +sudo -H python3 -m pip install -r osmclient/requirements.txt +sudo -H python3 -m pip install ./osmclient + +# Install charm to be able to build OSM packages with charms +wget -O charm.sh "https://osm.etsi.org/gitweb/?p=osm/tests.git;a=blob;f=charm.sh;hb=${OSM_CLIENT_VERSION}" +sudo cp charm.sh /usr/sbin/charm +sudo chmod 755 /usr/sbin/charm + ``` -To uninstall, just: +### How to install OSM Client for developers in Ubuntu 20.04 ```bash -python3 -m pip uninstall osmclient +# Install dependencies +sudo apt-get update +sudo apt-get install -y libcurl4-openssl-dev libssl-dev software-properties-common apt-transport-https +sudo apt-get install -y git wget make +sudo apt-get install -y python3.8 python3-setuptools python3-dev python3-pip + +# Upgrade pip to the latest version (with sudo, to install it globally for all users) +sudo -H python3 -m pip install -U pip + +# Decide which version to use (e.g., v12.0) +export OSM_CLIENT_VERSION=v12.0 + +# Install OSM IM and its dependencies via pip (installed with sudo, to install it globally for all users) +sudo -H python3 -m pip install -r "https://osm.etsi.org/gitweb/?p=osm/IM.git;a=blob_plain;f=requirements.txt;hb=${OSM_CLIENT_VERSION}" +sudo -H python3 -m pip install "git+https://osm.etsi.org/gerrit/osm/IM.git@${OSM_CLIENT_VERSION}#egg=osm-im" --upgrade + +# Clone osmclient repo and checkut the desired version +git clone https://osm.etsi.org/gerrit/osm/osmclient +cd osmclient +git checkout ${OSM_CLIENT_VERSION} + +# Install osmclient directly from the repo for development purposes +python3 -m pip install --user -e osmclient -r osmclient/requirements.txt -r osmclient/requirements-dev.txt + +# Install charm to be able to build OSM packages with charm +sudo snap install charm --classic + +# Logout and login so that PATH can be updated. Executable osm will be found in /home/ubuntu/.local/bin +which osm ``` ## Getting help