This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from raphaelvrosa/master
Adds scaling and fuzzing (and support for Iroha)
- Loading branch information
Showing
82 changed files
with
16,764 additions
and
4,642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt update && apt install -y python3.8 python3-setuptools python3-pip make | ||
|
||
RUN python3.8 -m pip install \ | ||
"asyncio>=3.4.3" \ | ||
"protobuf>=3.11.0" \ | ||
"grpclib>=0.3.1" \ | ||
"grpcio-tools>=1.26.0" \ | ||
"PyYAML>=5.1.2" \ | ||
"networkx>=2.4" \ | ||
"psutil>=5.6.7" \ | ||
"docker<=4.1.0" \ | ||
"prompt_toolkit<=3.0.6" \ | ||
"paramiko<=2.6.0" \ | ||
"scp<=0.13.2" | ||
|
||
RUN mkdir -p /umbra | ||
|
||
COPY ./deps /umbra/deps | ||
COPY ./examples /umbra/examples | ||
COPY ./umbra /umbra/umbra | ||
COPY ./setup.py /umbra/ | ||
COPY ./Makefile /umbra/ | ||
COPY ./README.md /umbra/ | ||
|
||
WORKDIR /umbra | ||
|
||
RUN make install | ||
|
||
CMD [ "umbra-cli" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
.PHONY: clean-pyc clean-build | ||
.DEFAULT_GOAL := help | ||
|
||
TEST_PATH=./umbra/tests | ||
|
||
DEPS_FOLDER=./deps | ||
DEPS=deps.sh | ||
DEPS_FABRIC=deps_fabric.sh | ||
DEPS_IROHA=deps_iroha.sh | ||
|
||
AUX_FOLDER=./aux | ||
AUX_MONITOR=monitor.sh | ||
|
||
|
||
install-fabric: | ||
sh -c "cd $(DEPS_FOLDER) && ./$(DEPS_FABRIC) install && cd - " | ||
|
||
uninstall-fabric: | ||
sh -c "cd $(DEPS_FOLDER) && ./$(DEPS_FABRIC) uninstall && cd - " | ||
|
||
install-iroha: | ||
sh -c "cd $(DEPS_FOLDER) && ./$(DEPS_IROHA) install && cd - " | ||
|
||
uninstall-iroha: | ||
sh -c "cd $(DEPS_FOLDER) && ./$(DEPS_IROHA) uninstall && cd - " | ||
|
||
vagrant-requirements-virtualbox: | ||
sudo apt install -y vagrant | ||
|
||
sudo apt install -y virtualbox | ||
sudo apt-get install -y linux-headers-generic | ||
sudo dpkg-reconfigure virtualbox-dkms | ||
sudo dpkg-reconfigure virtualbox | ||
sudo modprobe vboxdrv | ||
sudo modprobe vboxnetflt | ||
|
||
vagrant-requirements-libvirt: | ||
sudo apt install -y vagrant | ||
sudo apt-get install -y qemu-kvm qemu-utils libvirt-daemon bridge-utils virt-manager libguestfs-tools virtinst rsync | ||
sudo apt-get install -y ruby-libvirt libvirt-dev | ||
vagrant plugin install vagrant-libvirt | ||
|
||
requirements: | ||
sudo apt update && sudo apt install -y git python3.8 python3-setuptools python3-pip | ||
mkdir -p /tmp/umbra | ||
mkdir -p /tmp/umbra/logs | ||
mkdir -p /tmp/umbra/source | ||
|
||
install-deps: | ||
sh -c "cd $(DEPS_FOLDER) && ./$(DEPS) install && cd - " | ||
|
||
uninstall-deps: | ||
sh -c "cd $(DEPS_FOLDER) && ./$(DEPS) uninstall && cd - " | ||
|
||
install: requirements | ||
sudo /usr/bin/python3.8 setup.py develop | ||
# sudo /usr/bin/python3.8 -m pip install . | ||
|
||
develop: requirements | ||
sudo /usr/bin/python3.8 setup.py develop | ||
|
||
uninstall: | ||
sudo /usr/bin/python3.8 -m pip uninstall -y umbra | ||
|
||
clean-pyc: | ||
sudo sh -c "find . -name '*.pyc' -exec rm --force {} + " | ||
sudo sh -c "find . -name '*.pyo' -exec rm --force {} + " | ||
sudo sh -c "find . -name '*~' -exec rm --force {} + " | ||
|
||
clean-build: | ||
sudo sh -c "rm --force --recursive build/" | ||
sudo sh -c "rm --force --recursive dist/" | ||
sudo sh -c "rm --force --recursive *.egg-info" | ||
|
||
clean: clean-build clean-pyc | ||
sudo rm -R /tmp/umbra | ||
|
||
isort: | ||
sh -c "isort --skip-glob=.tox --recursive . " | ||
|
||
lint: | ||
flake8 --exclude=.tox | ||
|
||
test: clean-pyc | ||
py.test --verbose --color=yes $(TEST_PATH) | ||
|
||
run: install | ||
umbra-cli | ||
|
||
docker-build: | ||
docker build \ | ||
--tag=umbra:latest . | ||
|
||
docker-run: docker-build | ||
docker run \ | ||
--detach=false \ | ||
--name=umbra \ | ||
umbra:latest umbra-cli | ||
|
||
vagrant-run-virtualbox: requirements-vagrant-virtualbox | ||
vagrant up --provider virtualbox | ||
|
||
vagrant-run-libvirt: vagrant-requirements-libvirt | ||
vagrant up --provider libvirt | ||
|
||
start-aux-monitor: | ||
sh -c "cd $(AUX_FOLDER) && ./$(AUX_MONITOR) start && cd - " | ||
|
||
stop-aux-monitor: | ||
sh -c "cd $(AUX_FOLDER) && ./$(AUX_MONITOR) stop && cd - " | ||
|
||
all: requirements install run | ||
|
||
|
||
|
||
help: | ||
@echo "" | ||
@echo " umbra makefile help" | ||
@echo " ---------------------------------------------------------" | ||
@echo "" | ||
@echo " requirements" | ||
@echo " Install umbra requirements (i.e., python3.8 python3-setuptools python3-pip)." | ||
@echo " vagrant-requirements-virtualbox" | ||
@echo " Install the requirements to build a virtual machine with umbra installed using virtualbox." | ||
@echo " vagrant-requirements-libvirt" | ||
@echo " Install the requirements to build a virtual machine with umbra installed using qemu-kvm." | ||
@echo " install-fabric" | ||
@echo " Install fabric dependencies (images, python SDK, golang)." | ||
@echo " uninstall-fabric" | ||
@echo " Remove fabric dependencies (images, python SDK, ...)." | ||
@echo " install-iroha" | ||
@echo " Install iroha dependencies (images, python SDK)." | ||
@echo " uninstall-iroha" | ||
@echo " Remove iroha dependencies (images, python SDK, ...)." | ||
@echo " install-deps" | ||
@echo " Install umbra-scenario dependencies (i.e., containernet)." | ||
@echo " uninstall-deps" | ||
@echo " Uninstall umbra-scenario dependencies (i.e., containernet)." | ||
@echo " develop" | ||
@echo " Run python3.8 setup.py develop." | ||
@echo " install" | ||
@echo " Setup with pip install . ." | ||
@echo " uninstall" | ||
@echo " Remove umbra with pip uninstall umbra." | ||
@echo " clean-pyc" | ||
@echo " Remove python artifacts." | ||
@echo " clean-build" | ||
@echo " Remove build artifacts." | ||
@echo " clean" | ||
@echo " Remove build and python artifacts (clean-build clean-pyc)." | ||
@echo " isort" | ||
@echo " Sort import statements." | ||
@echo " lint" | ||
@echo " Check style with flake8." | ||
@echo " test" | ||
@echo " Run py.test in umbra/tests folder" | ||
@echo " run" | ||
@echo " Run the umbra-cli on your local machine." | ||
@echo " docker-run" | ||
@echo " Build and run the umbra-cli in a Docker container." | ||
@echo " vagrant-run-virtualbox" | ||
@echo " Build and run a virtual machine with umbra installed using virtualbox." | ||
@echo " vagrant-run-libvirt" | ||
@echo " Build and run a virtual machine with umbra installed using qemu-kvm." | ||
@echo " start-aux-monitor" | ||
@echo " Create and start the aux containers for monitoring (influxdb and graphana)." | ||
@echo " stop-aux-monitor" | ||
@echo " Stop and remove the aux containers for monitoring (influxdb and graphana)." | ||
@echo "" | ||
@echo " ---------------------------------------------------------" | ||
@echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| | ||
|
||
config.ssh.insert_key = false | ||
|
||
config.vm.define "umbra_virtualbox" do |umbra_virtualbox| | ||
|
||
umbra_virtualbox.vm.box = "ubuntu/focal64" | ||
umbra_virtualbox.vm.network :private_network, ip: "192.168.56.101" | ||
umbra_virtualbox.vm.hostname = "umbra" | ||
|
||
umbra_virtualbox.vm.provider "virtualbox" do |vb| | ||
vb.name = "umbra" | ||
opts = ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
vb.customize opts | ||
vb.cpus = 2 | ||
vb.memory = "2048" | ||
end | ||
|
||
umbra_virtualbox.vm.synced_folder ".", "/home/umbra", mount_options: ["dmode=775"] | ||
umbra_virtualbox.vm.provision :shell, inline: "apt update && apt install -y make" | ||
umbra_virtualbox.vm.provision :shell, inline: "cd /home/umbra && make install" | ||
|
||
end | ||
|
||
|
||
config.vm.define "umbra_libvirt" do |umbra_libvirt| | ||
|
||
umbra_libvirt.vm.box = "generic/ubuntu2004" | ||
umbra_libvirt.vm.hostname = "umbra" | ||
|
||
umbra_libvirt.vm.provider "libvirt" do |libvirt| | ||
libvirt.cpus = 2 | ||
libvirt.memory = 2048 | ||
end | ||
|
||
umbra_libvirt.vm.network :private_network, ip: "192.168.121.101" | ||
|
||
|
||
umbra_libvirt.vm.synced_folder ".", "/home/umbra", mount_options: ["dmode=775"] | ||
umbra_libvirt.vm.provision :shell, inline: "apt update && apt install -y make" | ||
umbra_libvirt.vm.provision :shell, inline: "cd /home/umbra && make install" | ||
|
||
end | ||
|
||
end |
Oops, something went wrong.