2 #Alternative to running python (as described below) on your machine, use the docker files.
3 1. Build docker container with ```docker build -t mrsim:latest .```
4 2. Run the container ```docker-compose up```
5 The behavior can be changed by argument to the python script in the docker-compose.yml
7 The simulator can be queried for statistics
8 localhost:2222/ctr_requests - return an integer of the number of get request to the event poll path
9 localhost:2222/ctr_responses - return an integer of the number of get responses to the event poll path
10 localhost:2222/ctr_unique_files - returns an integer or the number of unique files. A unique file is the combination of node+file_sequence_number
14 File names for 1MB, 5MB and 50MB files
15 Files in the format: <size-in-mb>MB_<sequence-number>.tar.gz Ex. for 5MB file with sequence number 12: 5MB_12.tar.gz
16 The sequence numbers are stepped so that all files have unique names
17 Missing files (files that are not expected to be found in the ftp server. Format: MissingFile_<sequence-number>.tar.gz
20 When the number of events are exhausted, empty replies are returned '[]'
22 TC100 - One ME, SFTP, 1 1MB file, 1 event
23 TC101 - One ME, SFTP, 1 5MB file, 1 event
24 TC102 - One ME, SFTP, 1 50MB file, 1 event
26 TC110 - One ME, SFTP, 1MB files, 1 file per event, 100 events, 1 event per poll.
27 TC111 - One ME, SFTP, 1MB files, 100 files per event, 100 events, 1 event per poll.
28 TC112 - One ME, SFTP, 5MB files, 100 files per event, 100 events, 1 event per poll.
29 TC113 - One ME, SFTP, 1MB files, 100 files per event, 100 events. All events in one poll.
32 TC120 - One ME, SFTP, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% of replies each: no response, empty message, slow response, 404-error, malformed json
33 TC121 - One ME, SFTP, 1MB files, 100 files per event, 100 events, 1 event per poll. 10% missing files
34 TC122 - One ME, SFTP, 1MB files, 100 files per event, 100 events. 1 event per poll. All files with identical name.
37 TC1000 - One ME, SFTP, 1MB files, 100 files per event, endless number of events, 1 event per poll
38 TC1001 - One ME, SFTP, 5MB files, 100 files per event, endless number of events, 1 event per poll
41 TC510 - 5 ME, SFTP, 1MB files, 1 file per event, 100 events, 1 event per poll.
44 TC200-TC202 same as TC100-TC102 but with FTPS
45 TC210-TC213 same as TC110-TC113 but with FTPS
46 TC2000-TC2001 same as TC1000-TC1001 but with FTPS
47 TC610 same as TC510 but with FTPS
52 1. ```sudo apt install python3-venv```
53 2. ```source .env/bin/activate/```
54 3. ```pip3 install "anypackage"``` #also include in source code
55 4. ```pip3 freeze | grep -v "pkg-resources" > requirements.txt``` #to create a req file
56 5. ```FLASK_APP=mr-sim.py flask run```
60 ```python3 mr-sim.py ```
62 6. Check/lint/format the code before commit/amed by ```autopep8 --in-place --aggressive --aggressive mr-sim.py```
65 ## User workflow on *NIX
68 When cloning/fetching from the repository first time:
70 2. `cd "..." ` #navigate to this folder
71 3. `source setup.sh ` #setting up virtualenv and install requirements
73 you'll get a sourced virtualenv shell here, check prompt
74 4. `(env) $ python3 mr-sim.py --help`
78 `(env) $ python3 mr-sim.py --tc1`
80 Every time you run the script, you'll need to step into the virtualenv by following step 3 first.
82 ## User workflow on Windows
84 When cloning/fetching from the repository first time:
87 2. then step into the folder
88 3. 'pip3 install virtualenv'
89 4. 'pip3 install virtualenvwrapper-win'
92 7. 'pip3 install -r requirements.txt' #this will install in the local environment then
93 8. 'python3 dfc-sim.py'
95 Every time you run the script, you'll need to step into the virtualenv by step 2+6.