From ec2c76e38f08881c6b19eb6ebd010d4e6ced85d8 Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Thu, 25 Jan 2018 20:38:50 +0100 Subject: [PATCH 1/8] Removed submodule taskgen --- .gitmodules | 3 --- Makefile | 27 +++++++++++++++++++++++++++ README.md | 23 ++++++++++++++++++++++- taskgen | 1 - 4 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 Makefile delete mode 160000 taskgen diff --git a/.gitmodules b/.gitmodules index 021a3cf..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "taskgen"] - path = taskgen - url = https://github.com/argos-research/taskgen diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f6571c8 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ + + + +# Only Ubuntu 16.04 and python 3.5 are supported by taskgen. +taskgen: + sudo apt-get update + sudo apt-get install python3 python3-pip + pip3 install --user -r ./taskgen/requirements.txt + + +# mongodb community edition +# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ + +mongodb: + # Import the public key used by the package management system. + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 + # Create a list file for MongoDB. + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list + sudo apt-get update + # Install the latest stable version of MongoDB + sudo apt-get install -y mongodb-org + +start_mongodb: + sudo service mongod start + +stop_mongodb: + sudo service mongod stop diff --git a/README.md b/README.md index b5cdaae..928da13 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,23 @@ # client-tools -Meta-Repository for client tools of the project + +Meta-Repository for client tools of the project. + + +## Installation + +Only Ubuntu 16.04 is supported. + +``` +git clone https://github.com/argos-research/client-tools.git +cd client-tools +git submodule init +git submodule update +make taskgen +``` + +Optionally install MongoDB: + +``` +make mongodb +make start_mongodb +``` diff --git a/taskgen b/taskgen deleted file mode 160000 index 3ebf174..0000000 --- a/taskgen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3ebf1742f3e84cae62e6b597662261065da71c7c From 25c3d62860c3a2b6f96db4477fa1fe0db94d0e6f Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Thu, 25 Jan 2018 20:40:24 +0100 Subject: [PATCH 2/8] pumbed taskgen to lastest version --- .gitmodules | 4 ++++ taskgen/README.md | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 taskgen/README.md diff --git a/.gitmodules b/.gitmodules index e69de29..e130835 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "taskgen"] + path = taskgen + url = https://github.com/argos-research/taskgen.git + branch = master diff --git a/taskgen/README.md b/taskgen/README.md new file mode 100644 index 0000000..1e9c4a3 --- /dev/null +++ b/taskgen/README.md @@ -0,0 +1,2 @@ +# taskgen +Task generator and distributor for deploying tasks From 1d5e6a778a8669359ee77ed174962dc931e0705d Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Thu, 25 Jan 2018 20:44:03 +0100 Subject: [PATCH 3/8] fixed submodule --- taskgen | 1 + taskgen/README.md | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 160000 taskgen delete mode 100644 taskgen/README.md diff --git a/taskgen b/taskgen new file mode 160000 index 0000000..d51eaf0 --- /dev/null +++ b/taskgen @@ -0,0 +1 @@ +Subproject commit d51eaf0555e8632fe228e48416c3b13fe8703e36 diff --git a/taskgen/README.md b/taskgen/README.md deleted file mode 100644 index 1e9c4a3..0000000 --- a/taskgen/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# taskgen -Task generator and distributor for deploying tasks From 14cff28bda0682af810f11d584d0a09180089216 Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Sat, 27 Jan 2018 12:06:19 +0100 Subject: [PATCH 4/8] project structure proposal --- Makefile | 29 ++++++----------------------- README.md | 42 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index f6571c8..2209e42 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,10 @@ +install-minimum: + $(MAKE) -C $(taskgen) install -# Only Ubuntu 16.04 and python 3.5 are supported by taskgen. -taskgen: - sudo apt-get update - sudo apt-get install python3 python3-pip - pip3 install --user -r ./taskgen/requirements.txt - -# mongodb community edition -# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ - -mongodb: - # Import the public key used by the package management system. - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 - # Create a list file for MongoDB. - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list - sudo apt-get update - # Install the latest stable version of MongoDB - sudo apt-get install -y mongodb-org - -start_mongodb: - sudo service mongod start - -stop_mongodb: - sudo service mongod stop +# EXAMPLE ml +#install-ml: +# install-minimum +# $(MAKE) -C $(ml) install diff --git a/README.md b/README.md index 928da13..ec888f5 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,42 @@ git clone https://github.com/argos-research/client-tools.git cd client-tools git submodule init git submodule update -make taskgen +make install-minimum ``` -Optionally install MongoDB: +## Contribution (Proposal) -``` -make mongodb -make start_mongodb -``` +1. Create a Repository in your Github Profile +2. `git clone https://github.com/YOUR_REPOSITORY` +3. `cd YOUR_REPOSITORY` + +*(Optionally)* If your project depends on `taskgen`: + +4. `git submodule add -b master https://github.com/argos-research/taskgen.git` + +You are done with your project and want to integrate it in `client-tools`? Make +sure, that: + +* there is a `Makefile` with `install`-command in your root folder. All + dependencies should be installed by calling `make install`. +* a `README.md` with an introduction to your project. + +If you are done with your project, ask your supervisor for a new repository in +`client-tools`. Finally create a pull-request from your repository to the new +repository. + + +## Structure (Proposal) + +- `client-tools` *(META-REPO)* ............ Meta repository for all client-side + tools of the ArgOS project. + - `taskgen` *(REPO)* ................... task-set generator and distributor + - `machine-learning-example` *(REPO)* .. bachelor thesis example about machine + learning + - `taskgen` *REPO* .................... depends on `taskgen` + - `README.md` + - `Makefile` .......................... installation instructions + - `main.py` ........................... example script + + - `another-project` + - ... From 4c46d27d85f374c00e8d770bdcdb23efded0644a Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Sat, 27 Jan 2018 12:08:53 +0100 Subject: [PATCH 5/8] fix --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ec888f5..56cddd8 100644 --- a/README.md +++ b/README.md @@ -39,15 +39,15 @@ repository. ## Structure (Proposal) -- `client-tools` *(META-REPO)* ............ Meta repository for all client-side +- `client-tools` *(META-REPO)* Meta repository for all client-side tools of the ArgOS project. - - `taskgen` *(REPO)* ................... task-set generator and distributor - - `machine-learning-example` *(REPO)* .. bachelor thesis example about machine + - `taskgen` *(REPO)* task-set generator and distributor + - `machine-learning-example` *(REPO)* bachelor thesis example about machine learning - - `taskgen` *REPO* .................... depends on `taskgen` + - `taskgen` *REPO* depends on `taskgen` - `README.md` - - `Makefile` .......................... installation instructions - - `main.py` ........................... example script + - `Makefile` installation instructions + - `main.py` example script - `another-project` - ... From 0130f2cd40a24b097361e7fd984c18d41dd835d9 Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Sat, 27 Jan 2018 12:23:22 +0100 Subject: [PATCH 6/8] new project structure proposal --- Makefile | 4 +-- README.md | 15 ++++++----- qemu-up.sh | 73 ----------------------------------------------------- taskgen-cli | 2 -- 4 files changed, 10 insertions(+), 84 deletions(-) delete mode 100755 qemu-up.sh delete mode 100755 taskgen-cli diff --git a/Makefile b/Makefile index 2209e42..a0d47db 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,6 @@ install-minimum: # EXAMPLE ml -#install-ml: +#install-machine-learning: # install-minimum -# $(MAKE) -C $(ml) install +# $(MAKE) -C $(machine-learning-example) install diff --git a/README.md b/README.md index 56cddd8..aff8cbf 100644 --- a/README.md +++ b/README.md @@ -39,15 +39,16 @@ repository. ## Structure (Proposal) -- `client-tools` *(META-REPO)* Meta repository for all client-side +- `client-tools` **(REPOSITORY)** Meta repository for all client-side tools of the ArgOS project. - - `taskgen` *(REPO)* task-set generator and distributor - - `machine-learning-example` *(REPO)* bachelor thesis example about machine + - `taskgen` **(REPOSITORY)** task-set generator and distributor + - `machine-learning-example` **(REPOSITORY)** bachelor thesis example about machine learning - - `taskgen` *REPO* depends on `taskgen` + - `taskgen` **REPOSITORY** depends on `taskgen` - `README.md` - - `Makefile` installation instructions - - `main.py` example script + - `Makefile` installation instructions + - `main.py` example script - - `another-project` + - `another-project` **REPOSITORY** - ... + diff --git a/qemu-up.sh b/qemu-up.sh deleted file mode 100755 index fef89f7..0000000 --- a/qemu-up.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# For more information read `taskgen/docs/qemu.md`. - -# CHOOSE A TAP DEVICE NAME -tap="$2" # tap + first parameter -# CHOOSE A BRIDGE -bridge="$1" -image="../build/genode-focnados_pbxa9/var/run/dom0-HW/image.elf" - -# taskgen.sessions.QemuSession write IP addresses for killing into this file -log="/tmp/taskgen_qemusession_ip_kill.log" - -# create tap device -ip tuntap add name $tap mode tap -brctl addif $bridge $tap -ip link set dev $tap up - -function cmd_del_tap { - # delete tap device - ip link set dev $tap down - brctl delif $bridge $tap - ip tuntap del $tap mode tap -} - - -pid=0 - -# this trap will clean up -function cmd_stop { - #kill qemu - kill -9 $pid - cmd_del_tap - exit -} - -trap 'cmd_stop' SIGINT ERR -while true; -do - # generate random MAC address - mac="$(hexdump -vn3 -e '/3 "52:54:00"' -e '/1 ":%02x"' -e '"\n"' /dev/urandom)" - - # start qemu in background - qemu-system-arm -net tap,ifname=$tap,script=no,downscript=no \ - -net nic,macaddr=$mac \ - -net nic,model=lan9118 \ - -nographic \ - -smp 2 \ - -m 1000 \ - -M realview-pbx-a9 \ - -kernel $image & - pid=$! - - # wait until file exists - until [ -f $log ] - do - sleep 1 - done - - # read file and kill own qemu instance if necessary - tail -f -n0 $log | while read kill_ip - do - kill_mac=$(arp -n | grep -w -i $kill_ip | awk '{print $3}') - echo "read $kill_ip $kill_mac" - - # compare the target MAC with our own MAC - if [ "$kill_mac" == "$mac" ]; then - kill -9 $pid - arp -d $mac - break - fi - done -done diff --git a/taskgen-cli b/taskgen-cli deleted file mode 100755 index 40d172c..0000000 --- a/taskgen-cli +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -python3.5 -m taskgen $@ From 6bcce3a321e4354f6cc8db91d6ad8574e29be22d Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Sat, 27 Jan 2018 13:40:28 +0100 Subject: [PATCH 7/8] fixed Makefile --- Makefile | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a0d47db..8ff24d7 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -install-minimum: - $(MAKE) -C $(taskgen) install +install-minimal: + $(MAKE) -C taskgen install # EXAMPLE ml #install-machine-learning: # install-minimum -# $(MAKE) -C $(machine-learning-example) install +# $(MAKE) -C machine-learning-example install diff --git a/README.md b/README.md index aff8cbf..44f8d2e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ git clone https://github.com/argos-research/client-tools.git cd client-tools git submodule init git submodule update -make install-minimum +make install-minimal ``` ## Contribution (Proposal) From 60ca337835ce92e3e43f8d5fbeb1edde0a7b2290 Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Sat, 27 Jan 2018 14:05:51 +0100 Subject: [PATCH 8/8] fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44f8d2e..0ab8f83 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ git submodule update make install-minimal ``` -## Contribution (Proposal) +## Contribution 1. Create a Repository in your Github Profile 2. `git clone https://github.com/YOUR_REPOSITORY` @@ -37,7 +37,7 @@ If you are done with your project, ask your supervisor for a new repository in repository. -## Structure (Proposal) +## Structure - `client-tools` **(REPOSITORY)** Meta repository for all client-side tools of the ArgOS project.