# Magma AGW installation ###### tags: `vargant` `Python` [TOC] --- ![image](https://hackmd.io/_uploads/H12SFEFyA.png) ![image](https://hackmd.io/_uploads/H1iKY4Fk0.png) ## Step 1: Install the following tools To install the tools you requested, here are the steps to install Docker and Docker Compose, VirtualBox, and Vagrant: ### 1. Docker and Docker Compose: #### Docker: 1. **Prerequisites**: Ensure you are using a Linux distribution supported by Docker. Open a terminal and run: ```bash sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common ``` 2. **Add Docker's Official GPG Key**: ```bash curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ``` 3. **Add Docker Repository**: ```bash sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ``` 4. **Install Docker**: ```bash sudo apt update sudo apt install docker-ce ``` 5. **Verify Docker Installation**: ```bash sudo docker --version ``` #### Docker Compose: 1. **Download Docker Compose Binary**: install the latest version ```bash sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose ``` 2. **Make Binary Executable**: ```bash sudo chmod +x /usr/local/bin/docker-compose ``` 3. **Verify Docker Compose Installation**: ```bash docker-compose --version ``` ### 2. VirtualBox: 1. **Add VirtualBox Repository**: ```bash sudo add-apt-repository "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" ``` 2. **Add Oracle's GPG Key**: ```bash wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - ``` 3. **Install VirtualBox**: ```bash sudo apt update sudo apt install virtualbox-6.1 ``` ### 3. Vagrant: 1. **Download Debian Package (.deb)**: Visit the [Vagrant download page](https://www.vagrantup.com/downloads) and download the Debian (.deb) version of Vagrant. 2. **Install Debian Package**: Replace `<PACKAGE-NAME>` with the name of the Debian package file you downloaded. ```bash sudo dpkg -i <PACKAGE-NAME> ``` 3. **Resolve OpenSSL Issue (Optional)**: If you encounter issues with OpenSSL after installation, follow the instructions in the discussion mentioned in your request. 4. **Verify Vagrant Installation**: ```bash vagrant --version ``` By following these steps, you should successfully install Docker, Docker Compose, VirtualBox, and Vagrant on your Ubuntu system. Make sure to check the specific versions of these tools and adjust them according to your needs. --- ## Step 2: Install golang version 18. Install golang version 18. Download the tar file. ``` wget https://linuxfoundation.jfrog.io/artifactory/magma-blob/go1.18.3.linux-amd64.tar.gz ``` Extract the archive you downloaded into /usr/local, creating a Go tree in /usr/local/go. ``` sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz ``` Add /usr/local/go/bin to the PATH environment variable. ``` export PATH=$PATH:/usr/local/go/bin ``` Verify that you've installed Go by opening a command prompt and typing the following command ``` go version ``` You should expect something like this ``` go version go1.18.3 linux/amd64 ``` --- ## Step 3: Install pyenv You can install `pyenv` on Ubuntu 18.04 by following these steps: #### 1. Prepare Dependencies: Before installing `pyenv`, make sure your system has all the necessary dependencies. Run the following command to ensure you have the required packages: ```bash sudo apt update sudo apt install -y curl git gcc make zlib1g-dev libbz2-dev libssl-dev libreadline-dev libsqlite3-dev ``` #### 2. Download and Install `pyenv`: 1. **Download `pyenv` from GitHub**: Use `git` to clone the `pyenv` repository into the `~/.pyenv` directory: ```bash git clone https://github.com/pyenv/pyenv.git ~/.pyenv ``` 2. **Add `pyenv` to PATH**: Edit your `.bashrc` or `.bash_profile` file in your home directory, and add the following lines to the end of the file: ```bash echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc ``` Then, run the `source` command to update the current shell settings: ```bash source ~/.bashrc ``` #### 3. Verify `pyenv` Installation: To verify that `pyenv` has been installed correctly, run the command: ```bash pyenv --version ``` If the installation is successful, you will see the installed version of `pyenv`. #### 4. Use `pyenv` to Install Python: Once `pyenv` is installed, you can use it to install and manage Python versions. For example: - To see a list of available Python versions for installation: ```bash pyenv install --list ``` - To install a specific Python version (e.g., Python 3.9.7): ```bash pyenv install 3.9.7 ``` - To set a Python version to be used globally: ```bash pyenv global 3.9.7 ``` This will set Python 3.9.7 as the default Python version on your system. Now, you have successfully installed `pyenv` and are ready to manage your Python installations with ease. --- ## Step 4:Install pip3 and its dependencies. The warning message you received indicates that `pip` is being invoked by an old script wrapper, which may cause issues in the future. You are advised to fix this issue. You can avoid this problem by calling `pip` using the `-m pip` option by running Python directly, rather than running `pip` directly. For example: ```bash python -m pip install --upgrade pip ``` or if you're using Python 3: ```bash python3 -m pip install --upgrade pip ``` This will ensure that you are using the latest version of `pip` and avoid issues with old script wrappers. After you have updated `pip`, you can check the new version by running the command: ```bash pip --version ``` or ```bash pip3 --version ``` Depending on the Python version you are using. Make sure the displayed version is the new one after the update succeeds. ![image](https://hackmd.io/_uploads/H1XbKxgkC.png) 2. After pip3 is installed, you can install the dependencies you mentioned by running the following command: ```bash pip3 install ansible fabric3 jsonpickle requests PyYAML ``` This command will download and install Ansible, Fabric3, jsonpickle, requests, and PyYAML along with their dependencies if they are not already installed on your system. ![image](https://hackmd.io/_uploads/HkThOxlyR.png) The warning message indicates that the script `fab` has been installed in the directory `/home/zyzy/.local/bin`, which is not included in your system's PATH environment variable. To resolve this issue, you have a couple of options: 1. **Add the directory to your PATH**: You can add the directory `/home/zyzy/.local/bin` to your PATH so that the `fab` script can be executed from any location. You can do this by adding the following line to your shell configuration file (e.g., `.bashrc` or `.bash_profile`): ```bash export PATH="$HOME/.local/bin:$PATH" ``` After adding this line, remember to either restart your shell session or run `source ~/.bashrc` (or `source ~/.bash_profile`) to apply the changes. 2. **Use the `--no-warn-script-location` option**: If you prefer to suppress the warning message, you can use the `--no-warn-script-location` option when installing the package. For example: ```bash pip3 install --no-warn-script-location fabric3 ``` This will install the package without displaying the warning message about the script location. Choose the option that best fits your preferences and needs. ![image](https://hackmd.io/_uploads/ryE_9eeJ0.png) --- ## Step 5:Install vagrant necessary plugin. ``` vagrant plugin install vagrant-vbguest vagrant-disksize vagrant-reload ``` ![image](https://hackmd.io/_uploads/rkz9OlgkA.png) ## Step 6:Install magma-dev ``` vagrant plugin install vagrant-vbguest vagrant-disksize vagrant-reload ``` ## Step 7: install magma-test ``` vagrant up magma_test && vagrant ssh magma_test ``` ![image](https://hackmd.io/_uploads/SkWykMK1A.png) ``` cd lte/gateway/python && make ``` ![image](https://hackmd.io/_uploads/r1BvJzYy0.png) ``` disable-tcp-checksumming ``` ![image](https://hackmd.io/_uploads/B174yMFyC.png) ## Step 8: install magma-trfserver ``` vagrant up magma_trfserver && vagrant ssh magma_trfserver ``` ![image](https://hackmd.io/_uploads/r1YgC-YJA.png) ![image](https://hackmd.io/_uploads/SJMCpbt1R.png) ``` disable-tcp-checksumming && trfgen-server ``` ![image](https://hackmd.io/_uploads/H1ZFa-KkR.png) ## Reference * https://wiki.lfnetworking.org/download/attachments/65538379/Wavelabs_Magma_LFN_Dev_Conference_FutureFeatures.pdf?version=1&modificationDate=1641832934000&api=v2 * https://magma.github.io/magma/docs/lte/s1ap_tests * https://chat.openai.com/share/11717670-e50f-4b2e-846d-78e02bd95ef7 * https://hackmd.io/@raflihadiana/vnfprogress