You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

223 lines
8.0 KiB

3 years ago
3 years ago
<img align="right" width="300" height="300" src="https://git.swarmlab.io:3000/zeus/swarmlab-hybrid/raw/branch/master/docs/images/hybrid-1.png">
3 years ago
# Swarmlab Hybrid
3 years ago
3 years ago
3 years ago
#### **Welcome to Swarmlab.io**
3 years ago
3 years ago
##### **On demand Labrooms**
##### **Ready-to-Use Virtual Labs one click away.**
3 years ago
3 years ago
3 years ago
3 years ago
### Table of contents
3 years ago
1. [Features](#introduction)
3 years ago
2. [System requirements ](#systemrequirements)
3 years ago
3. [Prerequisites](#prerequisites)
3 years ago
4. [Installation](#installation)
3 years ago
5. [More info](#moreinfo)
3 years ago
3 years ago
3 years ago
### <a name="introduction"></a>
3 years ago
## <b>Swarmlab Hybrid</b> is Swarmlabs younger, more tech savvy brother.
3 years ago
Swarmlab hybrid provides the user with the unique abillity to create Labrooms (or other applications) and share them as project images expanding the simple swarmlab Labrooms to full-blown systems. An all of that <b>using onlly the browser and the command line</b> of their system.
## Why?
Ever imagined having a normal lesson as you would in the University from the comfort of your livingroom?
Ever created a service that you would like to test on a real-world network?
Ever designed an Labroom/application you would like to distribute to your students/applications?
Swarmlab Hybrid comes to bridge the gap between tutor and student, the coder/developer of a service and the and user and at the same time meet the needs for a real-world testing environment.
With Hybrid we can now as part of the cloud work <b>independantly</b> but also stay <b>connected</b>.
The hybrid format allows us to utilize the power of Swarmlab itself but also combine it with the practiaclly unlimited computing of our own machines.
## How?
How does Swarmlab Hybrid differ from Swarmlab? Well...its Swarmlab...just....HYBRID!
Easy enough right? But what does that mean in practice?
Well for us it means a couple million more lines of code. For you it means a few more installation steps and the newfound access to YOUR OWN RESOURCES!
You will be connected to the Swarmlab Cloud (hence HYBRID) but you will be able to use your own storage(move files around, delete/copy etc),your own networking and computational power(cpu/graphics etc) and create a system exactly the way you need it.
This way you will be able to :
- <b>create</b> images for testing.
- <b>Run</b> them using docker.
- <b>Share</b> them for others to use and develop.
- Finally <b>browse the cloud</b> for shared images to <b>integrate</b> into your project and make it even better.
3 years ago
## Ready to run out-of-the-box
Normally the docker dataflow is as described in the following images:
<img align="center" src="https://git.swarmlab.io:3000/zeus/swarmlab-hybrid/raw/branch/master/docs/images/docker-build.png">
<img align="center" src="https://git.swarmlab.io:3000/zeus/swarmlab-hybrid/raw/branch/master/docs/images/docker-run.png">
3 years ago
3 years ago
To make the service easier to use we have created an ever-growing database of readilly accessible images you can choose from, thus making the first step optionall!
3 years ago
## Swarmlab vs Swarmlab Hybrid in a nutshell
### Swarmlab
- Ready to use, on demand virtual labs
- Optimized for both Students and Tutors
- Tutors bootstrap their labrooms using our tools
### Hybrid
- Create Labrooms/Applications
- Run and manage said rooms and application
- create once - scale up or down without rebuilding
- Connect multiple computers through a network.
- Move Labs between environments
3 years ago
- Create your own labs
3 years ago
- open source barebone -> <b>Share them with your friends</b>
3 years ago
3 years ago
3 years ago
### In any case students can:
- join the created labrooms according to their interrests
- run the evailable labs at will
- create their own rooms for exercising
3 years ago
## IMPORTANT
:exclamation: If you wish to use the service in Hybrid mode, that is if you want to share, download or perform other activites on the cloud you will need a <b>KEY</b>. Read installation instructions to learn how to do that.
3 years ago
3 years ago
Local usage of the service <b>doesnt</b> require one, you only need to log in to your account.
3 years ago
3 years ago
## System requirements<a name="systemrequirements"></a>
3 years ago
**Before** you create and configure a hybrid deployment using the swarmlab-agent client, your Local Machines need to meet certain requirements.
> If you don't meet those requirements, you won't be able to complete the steps within the swarmlab-agent client and you won't be able to configure a hybrid deployment between your Local Enviroment and Swarmlab Online Enviroment.
3 years ago
- A Linux Server (Virtual or Physical)
3 years ago
- You must have super user privileges (root/sudo)
3 years ago
- Docker Engine- Community version 18 or later is required.
- Docker Engine is supported on x86_64 (or amd64), armhf, and arm64 architectures.
- RAM
- Absolute minimum to run the daemon and some very light containers - 512MB
- Minimum for “comfortable” usage – 2GB
3 years ago
- CPU
3 years ago
- Minimum: 2
- Recommended 4+
3 years ago
- Disk Space
3 years ago
- 10 GB for internal requirements.
3 years ago
- The amount of additional disk space soloemnly depends on you intended use.
3 years ago
3 years ago
:warning: Since Docker uses hypervisor the host NEEDS TO HAVE VIRTUALIZATION ENABLED!
3 years ago
3 years ago
3 years ago
3 years ago
## Prerequisites<a name="prerequisites"></a>
3 years ago
3 years ago
* node version >15
3 years ago
3 years ago
```sh
curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
sudo apt-get install -y nodejs
```
* docker
3 years ago
3 years ago
```sh
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y docker-ce
3 years ago
sudo usermod -aG docker [USERNAME] # Please replace [USERNAME] with the user you want to run docker on
3 years ago
```
3 years ago
3 years ago
:information_source: for kali specifically please visit the following link to install docker.
3 years ago
https://linuxhint.com/install_docker_kali_linux/
3 years ago
* docker-compose
3 years ago
3 years ago
```sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
```
* pm2
3 years ago
3 years ago
```sh
sudo npm install -g pm2
```
* wireguard
3 years ago
3 years ago
```sh
sudo apt install wireguard jq
```
3 years ago
## Installation<a name="installation"></a>
3 years ago
### for *nix
3 years ago
3 years ago
- Clone the repo
3 years ago
3 years ago
```sh
3 years ago
git clone --recurse-submodules https://git.swarmlab.io:3000/zeus/swarmlab-hybrid.git
3 years ago
```
3 years ago
3 years ago
- Install it!
3 years ago
3 years ago
```sh
cd swarmlab-hybrid
3 years ago
./install.sh <-- run it without root privileges
3 years ago
```
3 years ago
3 years ago
- Open URL __http://localhost:3088__ in browser
3 years ago
- Get a Swarmlab account.
3 years ago
- Get a free API Key at **Settings->Enable the Swarmlab hybrid** Menu
3 years ago
3 years ago
3 years ago
### for windows or if you wish to keep the environment contained
You can find ready to run VM images <a href="https://uniwagr-my.sharepoint.com/:u:/g/personal/ice19390012_uniwa_gr/EbhjQIeiDeNFkfkSBWczRggBcJq2Pv6lAJs-NKkT4hXg-g?e=0VC0xa" target="_blank">here</a>.
3 years ago
3 years ago
And instructions on how to use them <a href="https://git.swarmlab.io:3000/zeus/swarmlab-hybrid/src/branch/master/docs/windows_use_vm.md">here</a>.
:information_source: Default password: swarmlab
3 years ago
3 years ago
PLEASE CHANGE PASSWORD IMEDIATELLY AFTER FIRST LAUNCH!!!
3 years ago
## First Run
:exclamation: No matter your distribution, upon installing you will HAVE to load settings before the first run!!
This will <b>initialize the configuration</b> using the <b>system defaults</b>.
3 years ago
3 years ago
Afterwards you can <b>add custom settings</b>, or keep using the defaults.
This action does <b>NOT</b> need to be repeated unless you wish to <b>reset the application</b>.
3 years ago
>
> Please navigate to the "Profile->Settings" menu and click on the "Load settings" button.
>
3 years ago
3 years ago
After doing this the application <b>MUST</b> be reastarted! To do that please run the restart script.
3 years ago
3 years ago
inside the root directory of the project run
3 years ago
3 years ago
```sh
3 years ago
./restart.sh
3 years ago
```
3 years ago
### More Info<a name="moreinfo"></a>
3 years ago
3 years ago
You can find our docs in **docs** Directory
3 years ago
3 years ago
The Swarmlab docs are in **AsciiDoc** (similar to markdown), **PDF** and **html** format
3 years ago
3 years ago
3 years ago
For real-time rendering in browser Asciidoc an add-on can be found here:
3 years ago
http://docs.swarmlab.io/SwarmLab-HowTos/labs/Howtos/doclive/asciidoc.adoc.html#_setup_live_preview_using_a_web_browser
3 years ago