Skip to content

Commit 61e5d64

Browse files
KesterTanevanyeyeyecoder6583
authored
Copy in (#270)
* added in validation for input files and permissions while creating directory * removed unnecessary files * added thread pool for scp commands * added more in-depth print statements * reverted threading and added logging * reverted thread pool * remove dump * Small fixces * reverted threading * small fixes * stressTest.py working * Incorporated PDL correctness changes * Added some stabilization time * Changed stabilization * Added timeout using aws waiter * Syntax issues * Syntax issues and logging * readme updated * Fixed client region * Revert stop before * Revert sleep * Revert aws waiter * Update .gitignore * Clean dump * Quality improvements * Fix gitignore * Update .gitignore * fixed stressTest termination * updated .gitignore for security key * copy boto.cfg * docker installation and install ping * copy boto if exist * Removed detachVM argument * chnaged request obj * removed vmms in request obj * Added error handling if not found --------- Co-authored-by: evanyeyeye <[email protected]> Co-authored-by: Soma Narita <[email protected]>
1 parent 85803ca commit 61e5d64

File tree

16 files changed

+579
-189
lines changed

16 files changed

+579
-189
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
scripts/*.sh
77
# exclude
88
vmms/id_rsa*
9+
vmms/id_ed25519*
910
courselabs/*
1011
dockerTmp/*
12+
1113
# config
1214
config.py
1315

@@ -27,3 +29,10 @@ pip-selfcheck.json
2729

2830
# Backup files
2931
*.bak
32+
33+
# Redis
34+
*.rdb
35+
36+
# Tests
37+
tests/*
38+
!tests/*.py

Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,25 @@ RUN apt-get update && apt-get install -y \
3232
ca-certificates \
3333
lxc \
3434
iptables \
35+
iputils-ping \
3536
&& apt-get clean \
3637
&& rm -rf /var/lib/apt/lists/*
3738

3839
WORKDIR /opt/TangoService/Tango/
3940

40-
# Install Docker from Docker Inc. repositories.
41-
RUN curl -sSL https://get.docker.com/ -o get_docker.sh && sh get_docker.sh
41+
# Install Docker
42+
RUN set -eux; \
43+
apt-get update; \
44+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl gnupg; \
45+
install -m 0755 -d /etc/apt/keyrings; \
46+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc; \
47+
chmod a+r /etc/apt/keyrings/docker.asc; \
48+
. /etc/os-release; \
49+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu ${VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list; \
50+
apt-get update; \
51+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
52+
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin; \
53+
apt-get clean; rm -rf /var/lib/apt/lists/*
4254

4355
# Install the magic wrapper.
4456
ADD ./wrapdocker /usr/local/bin/wrapdocker
@@ -69,6 +81,7 @@ RUN mkdir -p /var/log/docker /var/log/supervisor
6981
# Move custom config file to proper location
7082
RUN cp /opt/TangoService/Tango/deployment/config/nginx.conf /etc/nginx/nginx.conf
7183
RUN cp /opt/TangoService/Tango/deployment/config/supervisord.conf /etc/supervisor/supervisord.conf
84+
RUN if [ -f /opt/TangoService/Tango/boto.cfg ]; then cp /opt/TangoService/Tango/boto.cfg ~/.boto; fi
7285

7386
# Reload new config scripts
7487
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

README.md

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<img src="images/autolab_banner.svg" width="380px" height="100px">
33
</a>
44

5-
Tango
6-
======
5+
# Tango
76

87
Tango is a standalone RESTful Web service that runs and manages jobs. A job is a set of files that must satisfy the following constraints:
98

@@ -16,13 +15,13 @@ Upon receiving a job, Tango will copy all of the job's input files into a VM, ru
1615

1716
A brief overview of the Tango respository:
1817

19-
* `tango.py` - Main tango server
20-
* `jobQueue.py` - Manages the job queue
21-
* `jobManager.py` - Assigns jobs to free VMs
22-
* `worker.py` - Shepherds a job through its execution
23-
* `preallocator.py` - Manages pools of VMs
24-
* `vmms/` - VMMS library implementations
25-
* `restful_tango/` - HTTP server layer on the main Tango
18+
- `tango.py` - Main tango server
19+
- `jobQueue.py` - Manages the job queue
20+
- `jobManager.py` - Assigns jobs to free VMs
21+
- `worker.py` - Shepherds a job through its execution
22+
- `preallocator.py` - Manages pools of VMs
23+
- `vmms/` - VMMS library implementations
24+
- `restful_tango/` - HTTP server layer on the main Tango
2625

2726
Tango was developed as a distributed grading system for [Autolab](https://github.com/autolab/Autolab) at Carnegie Mellon University and has been extensively used for autograding programming assignments in CMU courses.
2827

@@ -35,7 +34,63 @@ Please feel free to use Tango at your school/organization. If you run into any p
3534
3. [Read the documentation for the VMMS API](https://docs.autolabproject.com/tango-vmms/).
3635
4. [Test whether Tango is set up properly and can process jobs](https://docs.autolabproject.com/tango-cli/).
3736

37+
## Stress Testing Tango
38+
39+
To stress test Tango by running a large number of submissions, use `stressTest.py`. Currently, this is not a feature on the master branch. To use this feature, go on the `copy-in`.
40+
41+
### Setting up the testing directory
42+
43+
Create your testing directory by copying the  `sample_test` directory into the `my_tests` directory.
44+
45+
```
46+
cp -r sample_tests my_tests/<Test Name>
47+
```
48+
49+
A brief overview of the testing directory
50+
51+
- `input` - Directory to put your input files
52+
- `output` - Directory for the autograder output for each of the test submissions
53+
- `<Test Name>.yaml` - Yaml file to configure the stress test
54+
- `expected_output.txt` - Expected JSON output of the autograder
55+
- `summary.txt` - Summary of the autograder outputs
56+
- `log.txt` - Log of the submissions
57+
58+
First, rename the `sample_test.yaml` to be `<Test Name>.yaml`
59+
60+
```
61+
mv sample_test.yaml <Test Name>.yaml
62+
```
63+
64+
Next, update the Yaml file.
65+
66+
```yaml
67+
num_submissions: 5
68+
submission_delay: 0.1
69+
autograder_image: <Autograding Image>
70+
output_file: log.txt
71+
tango_port: 3001
72+
cli_path: <Path to Tango>/clients/tango-cli.py
73+
instance_type: <Instance Type>
74+
timeout: 180
75+
ec2: True
76+
expected_output: expected_output.txt
77+
stop_before:
78+
```
79+
80+
After creating the Yaml file, copy the `autograde-Makefile`, `autograde.tar` and the file to submit in the `input` directory.
81+
82+
### Running the stress test
83+
84+
```
85+
virtualenv env
86+
source env/bin/activate
87+
pip install -r requirements.txt
88+
cd <Path to Tango>/tests
89+
python3 stressTest.py --test_dir my_tests/<Test Name>
90+
```
91+
3892
## Python 2 Support
93+
3994
Tango now runs on Python 3. However, there is a legacy branch [master-python2](https://github.com/autolab/Tango/tree/master-python2) which is a snapshot of the last Python 2 Tango commit for legacy reasons. You are strongly encouraged to upgrade to the current Python 3 version of Tango if you are still on the Python 2 version, as future enhancements and bug fixes will be focused on the current master.
4095
4196
We will not be backporting new features from `master` to `master-python2`.

0 commit comments

Comments
 (0)