User Tools

Site Tools


playground:playground

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
playground:playground [2022/10/24 10:35] christiandcplayground:playground [2022/10/24 11:05] (current) christiandc
Line 100: Line 100:
 ## Create your airlock scenario ## Create your airlock scenario
  
-We have now to create the scenario read by minus on the airlock. Create a .sh file and a .txt file. +We have now to create the scenario read by minus on the airlock. Create a .sh file and a .yaml file. 
-The .sh file wille execute the commands submitting thz task with minus. The .txt file is the scenario ypou will modifie to create your experiments.+The .sh file wille execute the commands submitting the task with minus. The .yaml file is the scenario ypou will modifie to create your experiments.
  
 +The file tree should look like that:
  
 <code> <code>
 +...
 +├── cortexbot
 +│   ├── generate.sh
 +│   ├── my_task
 +        ├──scenario.yaml
 +...
 +</code>
 +
 +Concerning the bash file :
 +
 +<code>
 +
 +#!/bin/bash
 +
 +# Creating the task
 +
 +echo "Tasks creation and submission"
 +
 +echo "Reading scenario my_task"
 +echo "Creating my_task.task"
 +
 +minus task create my_task
 +
 +echo "Submiting my_task.task"
 +
 +minus task submit my_task.task
 +
 +# Delete node folders and tasks
 +
 +rm -rf my_task.task
 +
 +echo "Wait for tasks to finish"
 +
 +loop=True
 +value=$(minus testbed status | grep "(none)" | wc -l)
 +while [ $loop = 'True' ]
 +do
 + if [ $value = '1' ]
 + then loop=False
 + else sleep 10 && echo "."
 + fi
 + value=$(minus testbed status | grep "(none)" | wc -l)
 +done
 +
 +echo "Tasks finished"
 +
 +</code>
 +
 +And the scenario file :
 +
 +
 +<code>
 +
 +# Example scenario description file
 +#
 +# All lines starting with "#" and empty lines are ignored
 +
 +
 +# Scenario textual description
 +#   simple string (a one liner)
 +description: Base scenario for TXid dataset generation
 +
 +# Experiment maximum duration
 +#   Time after which the experiment is forced to stop
 +#   integer (seconds)
 +
 +duration: 3600
 +
 +# Node list
 +#
 +#   format:
 +#
 +#   (machine):
 +#   entry (entry point script relative to the task root)
 +#   exit (exit point script relative to the task root. Use "none" for none)
 +
 +
 +#list of scheduler nodes= = [3, 4, 6, 7, 8, 9, 13, 14, 16, 17, 18, 23, 24, 25, 27, 28, 32, 33, 34, 35, 37] 
 +
 +
 +nodes:
 +
 +#scheduler node
 +
 +  node5:
 +    container:
 +      - image: <[DOCKER USERNAME]/[NEW IMAGE NAME]>:latest 
 +        command: bash -lc "python /root/gr-txid-master/examples/src/scheduler.py "
 +
 +
 +#emitter nodes corresponding to the scheduler list
 +
 +  node3:
 +    container:
 +      - image: thomasbeligne/cortexbot2:latest 
 +        command: bash -lc "/root/gr-txid-master/examples/src/emitter.py -T 0 -P 3580 -G 8 -R 0 -f 0"
 +
 +  node4:
 +    container:
 +      - image: thomasbeligne/cortexbot2:latest 
 +        command: bash -lc "/root/gr-txid-master/examples/src/emitter.py -T 1 -P 3580 -G 8 -R 0 -f 0"
 +
 +  node6:
 +    container:
 +      - image: thomasbeligne/cortexbot2:latest 
 +        command: bash -lc "/root/gr-txid-master/examples/src/emitter.py -T 2 -P 3580 -G 8 -R 0 -f 0"
 +
 +  node7:
 +    container:
 +      - image: thomasbeligne/cortexbot2:latest 
 +        command: bash -lc "/root/gr-txid-master/examples/src/emitter.py -T 3 -P 3580 -G 8 -R 0 -f 0"
 +
 +
 +  node8:
 +    container:
 +      - image: thomasbeligne/cortexbot2:latest 
 +        command: bash -lc "/root/gr-txid-master/examples/src/emitter.py -T 4 -P 3580 -G 8 -R 0 -f 0"  
 +
 +</code>
 +
 +
 +You can add as many nodes as you want, but be sure they are in the scheduler list on your docker file. In your scenario yu have to check the transmitter identifiacation -T <value>. The value has to correspond to the rank of the nodes in the scheduler list.
 +
 +Once you have created this folder, send it to airlock and connect to airlock using ssh : :
 +
 +
 +<code>
 +
 +you@yourpc:~$ scp -P 2269 -v -r /home/thomas/task1/gr_txid thomas@gw.cortexlab.fr:/cortexlab/homes/thomas/workspace/
 +
 +you@yourpc:~$ ssh -X -v username@gw.cortexlab.fr
 +
 +</code>
 +
 +Once your connected, give the rights to the bash file and book the testbed : 
 +
 +<code>
 +
 +you@srvairlock:~$ chmod +x ~/workspace/cortexbot/generateData.sh
 +you@srvairlock:~$ oarsub -l nodes=BEST,walltime=2:00:00 -r '2022-10-11 09:00:00'
 +
 +</code>
 +
 +The airlock config is now done. Let's now prepare the Turtlebot
 +
 +## Config the Turtlebot
 +
 +
 +## Launch the experiment
 +
 +The robot is moving in the Cortexlab and ready to recieve the Data. Go now on your airlock servor and launch the bash file :
 +
 +<code>
 +
 +thomas@srvairlock:~/workspace/cortexbot$ ~/workspace/experience/examples/generateData.sh
 +
 +</code>
 +
 +All the radios present in the scenario are succesivly sending packets to the robot. You can check thath everything is fine by doing : 
 +
 +<code>
 +username@srvairlock:~$ minus testbed status
 +</code>
 +
 +and abort the task
 +
 +<code>
 +username@srvairlock:~$ minus task abort <id_task>
 +</code>
 +
 +## Gathering the results
playground/playground.1666600504.txt.gz · Last modified: 2022/10/24 10:35 by christiandc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki