User Tools

Site Tools


gnu_radio_docker_benchmark_example

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
Next revisionBoth sides next revision
gnu_radio_docker_benchmark_example [2022/12/13 11:44] – [Submitting the task] lcardosognu_radio_docker_benchmark_example [2023/08/29 16:36] – Rephase section on non interactive scenario cmorin
Line 8: Line 8:
 ## Create your docker image ## Create your docker image
  
-Using docker, we will enable on your laptop an environment suitable for CorteXlab with gnuradio and needed software. Your goal is to develop this image (with new software and files) so you can run your experiment. It will only modify the environment of the image and not your laptop. Then you will be able to save and deploy the new image on cortexlab, without having to re-install everything and dealing with software compatibility and versioning. +Using docker, we will enable on your laptop an environment suitable for CorteXlab with gnuradio and needed software. Your goal is to develop this image (with new software and files) so you can run your experiment. It will only modify the environment of the image and not your laptop. Then you will be able to save and deploy the new image on CorteXlab, without having to re-install everything and dealing with software compatibility and versioning. 
  
 Therefore, you can retrieve and run the following image. Therefore, you can retrieve and run the following image.
Line 102: Line 102:
   * ''image:'': This indicates which image to download from dockerhub and run on the node     * ''image:'': This indicates which image to download from dockerhub and run on the node  
   * ''command: /usr/sbin/sshd -p 2222 -D'': opens the container to a ssh connection. During the task, you will access the node through its container with ssh and launch the experiment yourself. This way you can view log in real time and relaunch the experiment with different parameters without having to create a new task   * ''command: /usr/sbin/sshd -p 2222 -D'': opens the container to a ssh connection. During the task, you will access the node through its container with ssh and launch the experiment yourself. This way you can view log in real time and relaunch the experiment with different parameters without having to create a new task
 +The same reasoning applies for node 16. 
  
 +This is the scenario at hand:
  
-We will use the ssh method for this examplebut know that you can also use the ''command'' option in a different way, by directly giving the parameters of you experience and not going through ssh. The idea is that when you're developing an experiment, you will go through trials and errors, parameter tweakingsand working interactively through ssh is the best option, When the experiment is running well and you want to reproduce it several times, on the other hand, it'best to automatize everything, so that you don't need to ssh to each node and run commands manually. It's also possible, for example, that you adjust interactively a receiver first, and when it's done, you run it automatically, and you keep the interactive sessions only for adjusting and tuning the emitter node(s).+  * **Node14** will behave as the **OFDM receiver** 
 +  * **Node16** will behave as the **OFDM transmitter** 
 + 
 +For more info on where these nodes are located inside the platform, please check the node position map at the home of this wiki. 
 + 
 +Assuming your account has been correctly createdyou can now copy the folder with the scenario file into the Airlock SSH front-end:  
 + 
 +<code> 
 +you@yourpc:~$ scp -P 2269 -v [-i path/to/your/key] [-r] path/to/local/file/my_task username@gw.cortexlab.fr:/cortexlab/homes/[YOUR CORTEXLAB USERNAME]/workspace/ 
 +</code> 
 + 
 + 
 +### Non interactive scenario (No SSH) 
 +The example of this tutorial demonstrates an ssh connection to the nodes. But know that you can also use the ''command'' option in a different way, by directly giving the parameters of your experience and not going through ssh. When developing an experiment (trials and errors, parameter tweaking, ...), working interactively through ssh is more practical. But when the experiment is running well and you want to reproduce it several times, it is best to automatize, so that you don't need to ssh to each node and run commands manually. It's also possible, for example, that you adjust interactively a receiver first, and when it's done, you run it automatically, and you keep the interactive sessions only for adjusting and tuning the emitter node(s)
 + 
 +In this situation, you might want to directly call the program to run on the nodes via the ''command'' option, with a scenario file looking like the following.
  
 <code> <code>
Line 111: Line 128:
     container:     container:
     - image: [DOCKER USERNAME]/[NEW IMAGE NAME]:latest     - image: [DOCKER USERNAME]/[NEW IMAGE NAME]:latest
-      command: ./benchmark_rx.py --antenna="TX/RX" --rx-gain=25 -v -W 2M -f 2.49G +      command: [PATH/TO]/benchmark_rx.py --antenna="TX/RX" --rx-gain=25 -v -W 2M -f 2.49G 
-      passive: true+    passive: true
  
   node16:   node16:
     container:     container:
     - image: [DOCKER USERNAME]/[NEW IMAGE NAME]:latest      - image: [DOCKER USERNAME]/[NEW IMAGE NAME]:latest 
-      command: ./benchmark_tx.py --antenna="TX/RX" --tx-amplitude=0.2 -v -W 2M -f 2.49G+      command: [PATH/TO]/benchmark_tx.py --antenna="TX/RX" --tx-amplitude=0.2 -v -W 2M -f 2.49G
 </code> </code>
  
Line 128: Line 145:
   * ''passive: true'': the node 4 will be passive, meaning it will stop when all active nodes are finished    * ''passive: true'': the node 4 will be passive, meaning it will stop when all active nodes are finished 
  
-Same reasoning follows for the section on node6. So this is the scenario at hand: 
  
-  * **Node14** behaves as the **OFDM receiver** +Note that, **the rest of this tutorial uses the ssh method**, not the one mentioned in the current section
-  * **Node16** behaves as the **OFDM transmitter** +Also note that the command must point to the file to be executed, either with a relative path, from the ''WORKDIR'' defined in your docker image (here it is ''/root''), or with an absolute path.
- +
-For more info on where these nodes are located inside the platformplease check the node position map at the home of this wiki+
- +
-Assuming your account has been correctly created, you can now copy the folder with the scenario file into the Airlock SSH front-end:  +
- +
-<code> +
-you@yourpc:~$ scp -P 2269 -v [-i path/to/your/key] [-r] path/to/local/file/my_task username@gw.cortexlab.fr:/cortexlab/homes/[YOUR CORTEXLAB USERNAME]/workspace/ +
-</code>+
  
 ## Access Airlock  ## Access Airlock 
Line 181: Line 189:
 First we need to reserve the CorteXlab room: First we need to reserve the CorteXlab room:
  
-<del><code> +I a new browser window open the [CorteXlab web app](http://xp.cortexlab.fr/app). It will open in your current reservation list if you have any.
-you@srvairlock:~/workspace$ oarsub -l nodes=BEST,walltime=0:30:00 -I +
-</code>+
  
-(If you're running your reservation in a container reservation)+{{ ::screenshot_2022-12-13_at_11.46.27.png?nolink&700 |}} 
-<code> + 
-you@srvairlock:~/workspace$ oarsub -t inner=<id of container> -{"network_address in ('mnode4.cortexlab.fr''mnode6.cortexlab.fr')"}/nodes=2,walltime=0:30:00 -I +Use the "Book the testbed" button in the lower left corner. 
-</code>+ 
 +You'll get to screen that looks like this: 
 + 
 +{{ ::screenshot_2022-12-13_at_11.50.28.png?nolink&700 |}} 
 + 
 +Now let's create the reservation! 
 + 
 +Under "Book the testbed" select the date of your reservation: 
 + 
 +{{ ::screenshot_2022-12-13_at_11.52.34.png?nolink&700 |}} 
 + 
 +And using the clock icon select the start time of your reservation by dragging the clock pointers: 
 + 
 +{{ ::screenshot_2022-12-13_at_11.53.07.png?nolink&100 |}} and {{ ::screenshot_2022-12-13_at_11.53.18.png?nolink&100 |}} 
 + 
 +Nowin the duration, select the end of your reservation the same way as above. 
 + 
 +Finally select the nodes in the map of CorteXlab by clicking on the ones required for your experiment such that their color changes to orangeSince we're using 14 and 16those are the ones to be selected: 
 + 
 +{{ ::screenshot_2022-12-13_at_12.39.54.png?nolink&700 |}} 
 + 
 +Finally click on the "Book the testbed" button. If your reservation works (no conflicting options were chosen), you should be brought back to the reservations page, and a new line highlighted in yellow will appear with the number of your reservation.
  
-(Be sure that no one else is using the same node as you) 
  
-This will run a 30 minute job and open a sub-shell in which you can run minus tasks. This sub-shell will be killed after 30 minutes, and if you leave the shell earlier, it will terminate the corresponding oar job. More documentation on oar can be found [[reserve|here]]. You can also monitor the current jobs in the [gantt web interface](http://xp.cortexlab.fr/drawgantt/).</del> 
  
-We then submit the minus task:+Back to the airlock terminal screen, we now can submit the minus task:
  
 <code> <code>
gnu_radio_docker_benchmark_example.txt · Last modified: 2024/03/08 15:59 by cmorin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki