From 077179bc1649777870cb8fc6f99bbc5be99385be Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 7 Oct 2020 15:22:04 -0400 Subject: [PATCH 1/3] Remove unnecessary files --- ev-tools.sh | 1 - setup | 193 ---------------------------------------------------- 2 files changed, 194 deletions(-) delete mode 120000 ev-tools.sh delete mode 100755 setup diff --git a/ev-tools.sh b/ev-tools.sh deleted file mode 120000 index 752a9c2..0000000 --- a/ev-tools.sh +++ /dev/null @@ -1 +0,0 @@ -./scripts/evtool-v20.7.2 \ No newline at end of file diff --git a/setup b/setup deleted file mode 100755 index a2060e0..0000000 --- a/setup +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/bash - -EVIO=https://github.com/EdgeVPNio/evio.git -EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git -PY=python3.8 - -function install_build_tools -{ - sudo bash -c " - apt-get update -y && \ - apt-get install -y git \ - make clang libc++-dev libssl-dev $PY" -} - -function pull_src -{ - wd=$(pwd) - cd .. - #stat evio dir clone or pull - git clone $EVIO - cd evio/tincan/external - # - git clone -b ubuntu-x64 --single-branch https://github.com/ipop-project/3rd-Party-Libs.git - cd $wd -} - -function make_tincan -{ - wd=$(pwd) - cd ../evio/tincan/trunk/build - make clean; make - cd $wd -} - -function make_debpak -{ - wd=$(pwd) - cp ../evio/controller/Controller.py debian-package/edge-vpnio/opt/edge-vpnio/ && \ - mkdir -p debian-package/edge-vpnio/etc/opt/edge-vpnio/ - cp ../evio/controller/template-config.json debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \ - cp -r ../evio/controller/modules/ ../evio/controller/framework/ debian-package/edge-vpnio/opt/edge-vpnio/ && \ - chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \ - chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \ - chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \ - chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \ - chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \ - chmod 0664 debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \ - cp ../evio/tincan/trunk/out/release/x86_64/tincan debian-package/edge-vpnio/opt/edge-vpnio/ && \ - chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/tincan && \ - cd debian-package/ && \ - ./deb-gen && \ - 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 - cd $wd -} - -function install_testbed_deps -{ - sudo bash -c " - apt-get update -y && \ - apt-get install -y openvswitch-switch \ - $PY python3-pip python3-venv python3-dev \ - apt-transport-https \ - ca-certificates \ - curl git \ - software-properties-common && \ - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ - add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable\" && \ - apt-cache policy docker-ce && \ - apt-get install -y containerd.io \ - docker-ce-cli \ - docker-ce && \ - groupadd -f docker && \ - usermod -a -G docker $USER \ - " - echo "You must logout and relogin for docker group membership to take effect." -} - -function make_venv -{ - wd=$(pwd) - cd testbed && \ - $PY -m venv venv && \ - source venv/bin/activate && \ - pip3 install simplejson - cd $wd -} - -function make_dkrimg -{ - mv debian-package/edge-vpnio_20.7_amd64.deb docker-image/ && \ - docker build -f ./docker-image/evio-base.Dockerfile -t edgevpnio/evio-base:1.0 ./docker-image && \ - docker build -f ./docker-image/evio-node.Dockerfile -t edgevpnio/evio-node:20.7.3 ./docker-image - -} - -function install_openfire -{ - docker run --name openfire -d \ - -p 9090:9090 -p 5222:5222 \ - -p 5269:5269 -p 5223:5223 \ - -p 7443:7443 -p 7777:7777 \ - -p 7070:7070 -p 5229:5229 \ - -p 5275:5275 \ - edgevpnio/openfire_edgevpn_demo -} - -function install_portal -{ - #Todo: visualizer not yet available - git clone https://github.com/edgevpnio/portal.git - cd portal/setup - ./setup.sh - chown -R $USER /users/$USER/ -} - -function do_clean -{ - # tincan - wd=$(pwd) - cd ../evio/tincan/trunk/build - make clean; - cd $wd - #debian pak - cd debian-package/ && \ - rm -ri ./edge-vpnio_20.7_amd64.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 && \ - cd $wd - # docker-image - rm -f docker-image/edge-vpnio_20.7_amd64.deb - docker rmi edgevpnio/evio-base:1.0 edgevpnio/evio-node:20.7 - docker rmi $(docker images -q --filter "dangling=true") - # testbed - cd testbed - rm -rf config log cert venv - cd $wd -} - -function do_full_setup -{ - install_build_tools - pull_src - make_tincan - make_debpak - make_dkrimg - make_testbed_prereqs - make_venv -} - -case $1 in - deps) - install_build_tools - ;; - src) - pull_src - ;; - tincan) - make_tincan - ;; - debpak) - make_debpak - ;; - dkrimg) - make_dkrimg - ;; - testbed) - install_testbed_deps - ;; - venv) - make_venv - ;; - xmpp) - install_openfire - ;; - clean) - do_clean - ;; - all) - do_full_setup - ;; - *) - echo "no match on input -> $1" - ;; -esac From cacdbe4bee02899767612d12c88c70788384bd4e Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 7 Oct 2020 17:00:49 -0400 Subject: [PATCH 2/3] Miscl tools updates --- .gitignore | 6 ++++-- README.md | 35 ++++++++++++++++++++++++++++++++++- evt-tools.py | 2 +- setup-evt.sh | 4 ++-- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index e71dcb4..b1b8f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ testbed/log *.deb .vscode/ - +venv/ +__init__.py __pycache__/ -*.py[cod] \ No newline at end of file +*.py[cod] +ev-tools.sh \ No newline at end of file diff --git a/README.md b/README.md index 2512172..c207f48 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,41 @@ Run the command to view all options: evt -h ``` ``` +usage: evt-tools.py [-h] [--sync] [--clean] [--deps] [--src] [--debpak] [--testbed] [--venv] [--xmpp] [--build_docker] [--build_webrtc] [--build_webrtc_release] + [--build_webrtc_raspberry_debug] [--build_webrtc_raspberry_release] [--build_tincan] [--build_tincan_release] [--build_tincan_raspberry_debug] + [--build_tincan_raspberry_release] [--all] + +A collection of all the tools which can be used to deploy EdgeVPN + +optional arguments: + -h, --help show this help message and exit + --sync Syncs the tools repo with the correct version of the tools script.You need to clone the evio repository a directory above for this to work. + --clean Cleans the code from all the locations to prepare for a fresh installation. + --deps Installs system-wide the necessary build tools. + --src Clones EVIO repo. + --debpak Generates the Debian package. + --testbed Installs required dependencies for a testbed. + --venv Setup the virtual environment. + --xmpp Install openfire server. + --build_docker Builds the docker image if you have already built the debian package. + --build_webrtc Clones and builds the webrtc libraries for ubuntu and returns a debug build. + --build_webrtc_release + Clones and builds the webrtc libraries for ubuntu and returns a release build. + --build_webrtc_raspberry_debug + Clones and builds the webrtc libraries for raspberry and returns a debug build. + --build_webrtc_raspberry_release + Clones and builds the webrtc libraries for raspberry and returns a release build. + --build_tincan Builds the tincan debug executable for ubuntu. It assumes you have the webrtc libraries already cloned or built + --build_tincan_release + Builds the tincan release executable for ubuntu. It assumes you have the webrtc libraries already cloned or built + --build_tincan_raspberry_debug + Builds the tincan debug executable for raspberry. It assumes you have the webrtc libraries already cloned or built + --build_tincan_raspberry_release + Builds the tincan release executable for raspberry. It assumes you have the webrtc libraries already cloned or built + --all Setup the whole environment. +``` +``` evt --sync ``` - ## TO DO Move to one output folder. Run sync before any command. diff --git a/evt-tools.py b/evt-tools.py index 1dbfc74..15d1d6d 100644 --- a/evt-tools.py +++ b/evt-tools.py @@ -15,7 +15,7 @@ class EvtTools: parser.add_argument("--clean", action="store_true", default=False, dest="clean", help="Cleans the code from all the locations to prepare for a fresh installation.") parser.add_argument("--deps", action="store_true", default=False, dest="deps", - help="Installs the required build tools.") + help="Installs system-wide the necessary build tools.") parser.add_argument("--src", action="store_true", default=False, dest="src", help="Clones EVIO repo.") parser.add_argument("--debpak", action="store_true", default=False, dest="debpak", diff --git a/setup-evt.sh b/setup-evt.sh index 652d031..8affb0d 100755 --- a/setup-evt.sh +++ b/setup-evt.sh @@ -1,7 +1,7 @@ #!/bin/bash deactivate 2>/dev/null -python -m venv myenv && \ -source myenv/bin/activate && \ +python -m venv venv && \ +source venv/bin/activate && \ export PATH="$PATH:." && \ chmod 775 ./evt && \ pip3 install gitpython simplejson From 2247fe71236fb06d8751748252f2049fdc77b923 Mon Sep 17 00:00:00 2001 From: Ken Date: Fri, 9 Oct 2020 18:25:11 -0400 Subject: [PATCH 3/3] Reload limits via sysctl --- scripts/update-limits.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 scripts/update-limits.sh diff --git a/scripts/update-limits.sh b/scripts/update-limits.sh old mode 100644 new mode 100755 index c1a8e2b..0bded68 --- a/scripts/update-limits.sh +++ b/scripts/update-limits.sh @@ -28,4 +28,4 @@ select yn in "Yes" "No"; do No ) exit;; esac done -reboot \ No newline at end of file +sysctl -p