Package name update

visualizer
Ken 2020-12-18 00:00:22 -05:00
parent 6fee0a1f8b
commit f18d3f3316
14 changed files with 66 additions and 66 deletions

10
.gitignore vendored
View File

@ -14,8 +14,8 @@ __pycache__/
/evio-tools.sh
/evio-tools
debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json
debian-package/edge-vpnio/opt/edge-vpnio/framework
debian-package/edge-vpnio/opt/edge-vpnio/modules
debian-package/edge-vpnio/opt/edge-vpnio/Controller.py
debian-package/edge-vpnio/opt/edge-vpnio/tincan
debian-package/evio/etc/opt/evio/config.json
debian-package/evio/opt/evio/framework
debian-package/evio/opt/evio/modules
debian-package/evio/opt/evio/Controller.py
debian-package/evio/opt/evio/tincan

View File

@ -3,20 +3,20 @@
The Debian package installs EdgeVPNio (evio) as a systemd service and is supported in Ubuntu 18.04 and Raspberry Pi Raspbian OS. Use the following procedure to create a new installer package.
1. Clone the `tools` repo and use `tools/debian-package` as your base directory.
2. Copy the `tincan` executable, and the contents of the `controller` folder into `edge-vpnio/opt/edge-vpnio`.
3. Copy `config.json`, the template or completed file, into `edge-vpnio/etc/opt/edge-vpnio`.
4. Execute `./deb-gen` to create the `edge-vpnio.deb` installer package.
2. Copy the `tincan` executable, and the contents of the `controller` folder into `evio/opt/evio`.
3. Copy `config.json`, the template or completed file, into `evio/etc/opt/evio`.
4. Execute `./deb-gen` to create the `evio.deb` installer package.
Installation creates the following files and directories:
1. `/opt/edge-vpnio/tincan`
2. `/opt/edge-vpnio/controller/`
3. `/etc/opt/edge-vpnio/config.json`
1. `/opt/evio/tincan`
2. `/opt/evio/controller/`
3. `/etc/opt/evio/config.json`
4. `/etc/systemd/system`
5. `/var/logs/edge-vpnio/tincan_log`
6. `/var/logs/edge-vpnio/ctrl.log`
5. `/var/logs/evio/tincan_log`
6. `/var/logs/evio/ctrl.log`
To install EdgeVPNio invoke `sudo apt install -y <path/to/installer>/edge-vpnio.deb`.
To install EdgeVPNio invoke `sudo apt install -y <path/to/installer>/evio.deb`.
After installation but before starting evio, complete `config.json` by adding the XMPP credentials, setting the IP address, and applying other configurations as needed.
Then start evio using `sudo systemctl start evio`.
Additionally, use `systemctl` to start/stop/restart/status evio.

View File

@ -10,8 +10,8 @@ PkgVer=$3
PkgArch=$2
OutDir=$1
cat <<! > edge-vpnio/DEBIAN/control
Package: edge-vpnio
cat <<! > evio/DEBIAN/control
Package: evio
Name: EdgeVPNio
Version : $PkgVer
Maintainer: <ip.over.p2p@gmail.com>
@ -23,8 +23,8 @@ Description: Virtualized Overlay Networks.
Tag: P2P Edge Overlay Networking
!
if [ $? -ne 0 ]; then
rm -f edge-vpnio/DEBIAN/control
rm -f evio/DEBIAN/control
exit 1
fi
dpkg-deb --build --root-owner-group edge-vpnio $OutDir
rm -f edge-vpnio/DEBIAN/control
dpkg-deb --build --root-owner-group evio $OutDir
rm -f evio/DEBIAN/control

View File

@ -1 +0,0 @@
/etc/opt/edge-vpnio/config.json

View File

@ -0,0 +1 @@
/etc/opt/evio/config.json

View File

@ -1,6 +1,6 @@
#!/bin/bash
cd /opt/edge-vpnio
cd /opt/evio
python3.8 -m venv venv
source venv/bin/activate
pip3 --no-cache-dir install wheel

View File

@ -2,9 +2,9 @@
systemctl -q is-active evio && systemctl -q stop evio || true
systemctl -q is-enabled evio && systemctl -q disable evio || true
rm -rf /opt/edge-vpnio/venv
if [ -d /opt/edge-vpnio/controller ]; then
for dir in $(find /opt/edge-vpnio/controller -type d -name __pycache__); do
rm -rf /opt/evio/venv
if [ -d /opt/evio/controller ]; then
for dir in $(find /opt/evio/controller -type d -name __pycache__); do
rm -rf "$dir"
done
fi

View File

@ -3,7 +3,7 @@ Description=EdgeVPNio service
[Service]
Type=oneshot
ExecStart=/opt/edge-vpnio/evio-start
ExecStart=/opt/evio/evio-start
RemainAfterExit=true
Restart=no
TimeoutStopSec=30

View File

@ -1,10 +1,10 @@
#! /bin/bash
evio_start() {
cd /opt/edge-vpnio
cd /opt/evio
./tincan &
source venv/bin/activate
python Controller.py -c /etc/opt/edge-vpnio/config.json &
python Controller.py -c /etc/opt/evio/config.json &
}
evio_start

View File

@ -1,7 +1,7 @@
FROM edgevpnio/evio-base:1.0
FROM edgevpnio/evio-base:1.1
WORKDIR /root/
COPY ./edge-vpnio.deb .
RUN apt-get install -y ./edge-vpnio.deb && rm -rf /var/lib/apt/lists/* && apt-get autoclean
COPY ./evio.deb .
RUN apt-get install -y ./evio.deb && rm -rf /var/lib/apt/lists/* && apt-get autoclean
CMD ["/sbin/init"]

View File

@ -1,9 +1,9 @@
#!/bin/bash
systemctl mask getty@tty1.service && \
mkdir -p /opt/edge-vpnio && \
cd /opt/edge-vpnio && \
python3 -m venv venv && \
mkdir -p /opt/evio && \
cd /opt/evio && \
python3.8 -m venv venv && \
source venv/bin/activate && \
pip3 --no-cache-dir install wheel psutil slixmpp requests simplejson ryu && \
deactivate

View File

@ -57,17 +57,17 @@ function make_debpak
{
wd=$(pwd)
# copy controller and tincan files to debpak directory
cp -r $WorkspaceRoot/EdgeVPNio/evio/controller/Controller.py $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/ && \
cp $WorkspaceRoot/EdgeVPNio/evio/controller/template-config.json $TOOLS_DIR/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
cp -r $WorkspaceRoot/EdgeVPNio/evio/controller/modules/ $WorkspaceRoot/EdgeVPNio/evio/controller/framework/ $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/ && \
chmod 0775 $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \
chmod 0664 $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \
chmod 0775 $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \
chmod 0664 $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \
chmod 0664 $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \
chmod 0664 $TOOLS_DIR/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
cp $EVIO_DIR/tincan/out/"$PLATFORM"/"$BUILD_TYPE"/tincan $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/ && \
chmod 0775 $TOOLS_DIR/debian-package/edge-vpnio/opt/edge-vpnio/tincan
cp -r $WorkspaceRoot/EdgeVPNio/evio/controller/Controller.py $TOOLS_DIR/debian-package/evio/opt/evio/ && \
cp $WorkspaceRoot/EdgeVPNio/evio/controller/template-config.json $TOOLS_DIR/debian-package/evio/etc/opt/evio/config.json && \
cp -r $WorkspaceRoot/EdgeVPNio/evio/controller/modules/ $WorkspaceRoot/EdgeVPNio/evio/controller/framework/ $TOOLS_DIR/debian-package/evio/opt/evio/ && \
chmod 0775 $TOOLS_DIR/debian-package/evio/opt/evio/framework/ && \
chmod 0664 $TOOLS_DIR/debian-package/evio/opt/evio/framework/* && \
chmod 0775 $TOOLS_DIR/debian-package/evio/opt/evio/modules/ && \
chmod 0664 $TOOLS_DIR/debian-package/evio/opt/evio/modules/* && \
chmod 0664 $TOOLS_DIR/debian-package/evio/opt/evio/Controller.py && \
chmod 0664 $TOOLS_DIR/debian-package/evio/etc/opt/evio/config.json && \
cp $EVIO_DIR/tincan/out/"$PLATFORM"/"$BUILD_TYPE"/tincan $TOOLS_DIR/debian-package/evio/opt/evio/ && \
chmod 0775 $TOOLS_DIR/debian-package/evio/opt/evio/tincan
if [ $? -ne 0 ]; then
exit 1
fi
@ -78,12 +78,12 @@ function make_debpak
exit 1
fi
# remove previously copied files
rm -rf edge-vpnio/opt/edge-vpnio/framework \
edge-vpnio/opt/edge-vpnio/modules \
edge-vpnio/opt/edge-vpnio/tincan \
edge-vpnio/opt/edge-vpnio/template-config.json \
edge-vpnio/opt/edge-vpnio/Controller.py \
edge-vpnio/etc/opt/edge-vpnio/config.json
rm -rf evio/opt/evio/framework \
evio/opt/evio/modules \
evio/opt/evio/tincan \
evio/opt/evio/template-config.json \
evio/opt/evio/Controller.py \
evio/etc/opt/evio/config.json
cd $wd
}
@ -115,12 +115,12 @@ function install_testbed_deps
function make_dkrimg
{
display_env
DPK_NAME=edge-vpnio_$VER"_"$ARCH.deb
DPK_NAME=evio_$VER"_"$ARCH.deb
echo docker image using $DPK_NAME
cp $OUT_DIR/$DPK_NAME $TOOLS_DIR/docker-image/edge-vpnio.deb && \
docker build -f $TOOLS_DIR/docker-image/evio-base.Dockerfile -t edgevpnio/evio-base:1.0 $TOOLS_DIR/docker-image && \
cp $OUT_DIR/$DPK_NAME $TOOLS_DIR/docker-image/evio.deb && \
docker build -f $TOOLS_DIR/docker-image/evio-base.Dockerfile -t edgevpnio/evio-base:1.1 $TOOLS_DIR/docker-image && \
docker build -f $TOOLS_DIR/docker-image/evio-node.Dockerfile -t edgevpnio/evio-node:"$VER" $TOOLS_DIR/docker-image
rm $TOOLS_DIR/docker-image/edge-vpnio.deb
rm $TOOLS_DIR/docker-image/evio.deb
}
function install_openfire
@ -155,11 +155,11 @@ function do_clean
#debian pak
cd $TOOLS_DIR/debian-package/ && \
rm -ri ./*.deb \
edge-vpnio/opt/edge-vpnio/framework \
edge-vpnio/opt/edge-vpnio/modules \
edge-vpnio/opt/edge-vpnio/tincan \
edge-vpnio/opt/edge-vpnio/template-config.json \
edge-vpnio/opt/edge-vpnio/Controller.py
evio/opt/evio/framework \
evio/opt/evio/modules \
evio/opt/evio/tincan \
evio/opt/evio/template-config.json \
evio/opt/evio/Controller.py
# docker-image
cd ..
rm -f docker-image/*.deb

View File

@ -1,6 +1,6 @@
#!/bin/bash
sudo apt install -y python3.8 python3.8-dev python3.8-venv python3-pip git
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 38
#sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 38
deactivate 2>/dev/null
python -m venv venv && \
source venv/bin/activate && \

View File

@ -17,12 +17,12 @@ import ipaddress
class Testbed():
__metaclass__ = ABCMeta
LAUNCH_WAIT = 60
LAUNCH_WAIT = 5
BATCH_SZ = 5
VIRT = NotImplemented
APT = spawn.find_executable("apt-get")
CONTAINER = NotImplemented
BF_VIRT_IMG = "edgevpnio/evio-node:20.7"
BF_VIRT_IMG = "edgevpnio/evio-node:20.12.0.45-dev"
def __init__(self, exp_dir=None):
parser = argparse.ArgumentParser(description="Configures and runs EdgeVPN Testbed")
@ -284,10 +284,10 @@ class DockerTestbed(Testbed):
if not os.path.isfile(cfg_file):
self.gen_config(instance, instance+1)
mount_cfg = "{0}:/etc/opt/edge-vpnio/config.json".format(cfg_file)
mount_log = "{0}/:/var/log/edge-vpnio/".format(log_dir)
#mount_data = "{0}/:/var/edge-vpnio/".format(self.data_dir)
mount_cert = "{0}/:/var/edge-vpnio/cert/".format(self.cert_dir)
mount_cfg = "{0}:/etc/opt/evio/config.json".format(cfg_file)
mount_log = "{0}/:/var/log/evio/".format(log_dir)
#mount_data = "{0}/:/var/evio/".format(self.data_dir)
mount_cert = "{0}/:/var/evio/cert/".format(self.cert_dir)
args = ["--rm", "--privileged"]
opts = "-d"
img = Testbed.BF_VIRT_IMG