{ "cells": [ { "cell_type": "markdown", "id": "b46992a6-b75c-45d8-bacb-a8d54ea8de44", "metadata": { "tags": [] }, "source": [ "# One time setup for use in Grid'5000\n", "\n", "\n", "---\n", "\n", "- Website: https://discovery.gitlabpages.inria.fr/enoslib/index.html\n", "- Instant chat: https://framateam.org/enoslib\n", "- Source code: https://gitlab.inria.fr/discovery/enoslib\n", "\n", "---\n", "\n", "\n", "Prerequisites:\n", "\n", "- Connect to this Jupyter lab instance https://intranet.grid5000.fr/notebooks\n", " - Host the instance on the frontend or a node\n", "- Clone the enoslib tutorias source: `git clone https://gitlab.inria.fr/msimonin/enoslib-tutorials` somewhere in your home directory\n", "- Open this notebook at `enoslib-tutorials/`" ] }, { "cell_type": "markdown", "id": "9499ca23-b2c7-4b52-a5f2-6c661e8e3497", "metadata": {}, "source": [ "## Software dependencies\n", "\n", "First things first, you'll need EnOSlib library to go through this tutorial.\n", "- EnOSlib is installed by default, but might not be the latest version\n", "- If you want to install the latest version, follow the steps below" ] }, { "cell_type": "markdown", "id": "409c2084-6fd2-4db2-9084-470b07d5a9e7", "metadata": {}, "source": [ "## Installing the latest version of EnOSlib (might be wild :) )\n", "\n", "This installs EnOSlib from the latest version (+ some extra libs) in a virtual environment and install a new Jupyter kernel." ] }, { "cell_type": "code", "execution_count": null, "id": "f78e397c-52bd-4c78-94ef-eacc16170832", "metadata": { "tags": [] }, "outputs": [], "source": [ "%%bash\n", "\n", "virtualenv -p python3 my_venv\n", "source my_venv/bin/activate\n", "python3 -m pip install -U git+https://gitlab.inria.fr/discovery/enoslib\n", "python3 -m pip install matplotlib seaborn pandas scapy\n", "python3 -m pip install ipykernel\n", "python3 -m ipykernel install --user --name my_venv" ] }, { "cell_type": "markdown", "id": "7d60c757-118c-44e3-8374-051d2e2c2bcd", "metadata": {}, "source": [ "## Optional setup if jupyter is hosted on a node\n", "\n", "Regarding the access to the REST API, a node on G5k is considered to belong to the external world.\n", "So you need to set your credentials to be able to connect to the REST API.\n", "\n", "**Do this if your jupyter instance is hosted in a dedicated node**" ] }, { "cell_type": "code", "execution_count": null, "id": "7e31bc5c-86e2-4db1-a905-841d7d93e7b3", "metadata": {}, "outputs": [], "source": [ "from grid5000.cli import auth\n", "\n", "# CHANGE THE LOGIN!\n", "auth(\"msimonin\")" ] }, { "cell_type": "markdown", "id": "39a47440-449a-47df-acb5-0c3b760171be", "metadata": {}, "source": [ "# Checking the library\n", "\n", "The following must succeed after switching to the new kernel `my_venv`" ] }, { "cell_type": "code", "execution_count": null, "id": "c1f7a79e-9d32-44b1-a805-88cbdcea174c", "metadata": {}, "outputs": [], "source": [ "# This must not fail (restart the kernel after installing the library)\n", "import enoslib as en\n", "\n", "en.check()" ] } ], "metadata": { "kernelspec": { "display_name": "my_venv", "language": "python", "name": "my_venv" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.2" } }, "nbformat": 4, "nbformat_minor": 5 }