Titanium-Silver is a python package for automating lab evalution using dockers.
This package requires:
Please verify docker's installation:
$ sudo docker run hello-world
Install Required Packages:
$ sudo pip3 install -r requirements.txt
Install Titanium-Silver:
$ sudo pip3 install -e . # PWD must be main folder with setup.py
Steps:
nvm
to install node
and npm
:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
source ~/.bashrc
nvm install node
cd <project_root>/frontend
npm install
<in one shell> $ npm run start
<in another shell> $ ./run.sh
Steps:
$ cd frontend/ && npm run build
$ cd server/flaskr/
$ ln -s ../../frontend/build/static static
$ ln -s ../../frontend/build/ templates
index.html
in frontend/build
. For each <script>
tag, add this: type="text/babel"
<link>
for manifest.json
favicon.ico
to load do this:
favicon.ico
to build/static
.href
of <link>
to : {{url_for("static",filename="./favicon.ico")}}
$ pytest # Very Intensive, Less verbose
$ # Recommended:
$ sudo pytest tests/test_basic.py
$ sudo pytest tests/test_basic_100.py
$ sudo pytest tests/test_basic_50.py
$ sudo pytest tests/test_server_simulation.py
Docker module usage:
usage: script.py [-h] [-n [NUM]] [-s [SLEEP]]
optional arguments:
-h, --help show this help message and exit
-n [NUM] Number of containers=(0,50]
-s [SLEEP] Sleep duration of client file
# or as package:
>>> from titanium_silver.docker_client import Docker_Client
>>> dcli = Docker_Client()
>>> t = dcli.spawn_process(name='prototype%d'%i, num=i, sleep=5000, path=os.getcwd()+'/tests/SC') # returns a thread with container
>>> t.result_queue.get().decode('utf-8') # Get result