zeus 3 years ago
parent
commit
eedf5b8e53
  1. 52
      Makefile
  2. 115
      README.md
  3. 7
      install/usr/share/swarmlab.io/sec/swarmlab-sec

52
Makefile

@ -0,0 +1,52 @@
DIR:=$(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
RHOST=
SHELL := /bin/bash
.PHONY: create help start stop list clean
help:
@echo "" ;
@echo "" ;
@echo "--------------" ;
@echo " SwarmLab.io " ;
@echo "--------------" ;
@echo "" ;
@echo " USAGE: make [COMMAND]" ;
@echo "" ;
@echo " Examples of [COMMAND] can be:" ;
@echo "" ;
@echo " create: create service " ;
@echo "" ;
@echo " start: start service " ;
@echo "" ;
@echo " stop: shutdown service" ;
@echo "" ;
@echo " clean: remove images in the system" ;
@echo "" ;
@echo " list: show running containers of instance" ;
@echo "" ;
@echo " help: show this message" ;
@echo "" ;
@echo "More info:" ;
@echo "http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab/docs/index.html" ;
@echo "" ;
@echo "" ;
create:
@./install/usr/share/swarmlab.io/sec/swarmlab-sec create 2>/dev/null ; true
start:
@./install/usr/share/swarmlab.io/sec/swarmlab-sec up 2>/dev/null ; true
list:
@./install/usr/share/swarmlab.io/sec/swarmlab-sec list 2>/dev/null ; true
stop:
@./install/usr/share/swarmlab.io/sec/swarmlab-sec down 2>/dev/null ; true
clean:
@./install/usr/share/swarmlab.io/sec/swarmlab-sec clean 2>/dev/null ; true

115
README.md

@ -1,18 +1,29 @@
# hybrid-NodeVuejs !
## LabInstance Node VueJS ## Swarmlab is a collection of services that aims to
> - provide teachers and professors with online remote tools to do their lessons
>
> - give students the opportunity to study real life examples in their chosen area of expertise
>
> - allow developers to fully test and debug their applications and provide POC’s
>
> - or you simply want to use a Application (in a microservices-based architecture)
>
> Swarmlab provides you with all the required tools, tools to teach work or try out demos in a completely virtual environment.
>
> More info: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab/docs/index.html
![alt text](images/swarmlab-network.png "") ![alt text](images/swarmlab-network.png "")
## LabInstance jupyter26
## Quickstart ## Quickstart
This is a quickstart guide of howto use this *LabInstance to deploy Vue js applications* This is a quickstart guide of howto use this *LabInstance*
### HowTo use it
### Default Configuration ### Default Configuration
@ -34,84 +45,54 @@ This is a quickstart guide of howto use this *LabInstance to deploy Vue js appli
> pass > pass
#### Find lab workers
> ifconfig
>
> nmap -sP 172.130.0.0/24
>
> or
>
> /home/docker/project/bin/swarmlab-nmap
#### connect to workers
```bash
ssh docker@[IP]
```
#### Create hosts file
```bash
/home/docker/project/bin/swarmlab-nmap > /home/docker/project/hosts
```
---
**NOTE:** copy files to all clients
```bash
while read -r line;
do
scp /home/docker/project/file docker@$line:/some_dir/file
done < /home/docker/project/hosts
```
---
### Vue CLI Documentation
https://cli.vuejs.org/guide/creating-a-project.html#vue-create
#### Creating a Project
```bash
vue create hello-world
```
#### Run it! ### RUN INSTANCE
```bash Swarmlab services can be run in different ways.
npm run serve
```
#### Open it! - You can run them **through the swarmlab hybrid environment** (http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs/swarmlab/docs/hybrid/start-microservices.html)
- or use them individually at will on the **command line of your system**
```bash
http://localhost:8080
```
:warning: Publishing Docker ports via -p
Using the -p (lower case) flag at runtime lets you publish a container’s specific port(s) to the Docker host. #### CLI
> git clone ...
>
> cd [DIRECTORY]
>
```bash #### help
docker exec -it -udocker -p [host-port]:[expose-port*] hybrid-nodevuejs_master_1 /bin/bash >
e.g. > make help
docker exec -it -udocker -p 8080:8080 hybrid-nodevuejs_master_1 /bin/bash >
^^^^^^^^^^^
```
#### create service
> >
> (*) this is the port found in the container menu. > make create
> >
> We would expect the port number do be next to the "Ports" field.
#### start service
>
> make start
> >
#### stop service
>
> make stop
>
#### list service
>
> make list
>
#### clean service
>
> make clean
>

7
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -94,6 +94,11 @@ REGISTRY_ADDR=localhost
REGISTRY_PORT=5000 REGISTRY_PORT=5000
IMAGE_NAME=$HYBRID_NETWORK IMAGE_NAME=$HYBRID_NETWORK
SSH_PORT= SSH_PORT=
R_PORT1=$(EPHEMERAL_PORT)
R_PORT2=$(EPHEMERAL_PORT)
R_PORT3=$(EPHEMERAL_PORT)
R_PORT4=$(EPHEMERAL_PORT)
R_PORT5=$(EPHEMERAL_PORT)
EOF EOF
fi fi
@ -326,7 +331,7 @@ Project is Ready
├── id_rsa ├── id_rsa
└── id_rsa.pub └── id_rsa.pub
Run: swarmlab-sec up size=5 Run: make start
or run swarmlab-sec help for USAGE or run swarmlab-sec help for USAGE

Loading…
Cancel
Save