IMUNES: how to export changes made to an experiment

These are two snippets I’ve written in BASH in the last few days to allow IMUNES users to export changes made to an experiment in runtime, on Linux. The former allows users to export changes, the latter allows them to load changes back to Docker containers. They will be improved day by day, so it’s recommended to consult this page to get an updated version of them, especially if you encounter problems.

The execution flow to use these scripts properly is:

  1. Draw a topology
  2. Run the experiment
  3. Make changes you want to make (e.g. configurations, your files, etc.)
  4. Use the first script to export those changes to your computer’s file system
  5. Stop the experiment
  6. Save the topology
  7. Close IMUNES

  1. Open IMUNES again
  2. Load the topology back
  3. Execute the experiment
  4. Use the second script to load your previously exported changes back
  5. Enjoy!

Notes:

  • Your Linux distribution needs to have the zenity package installed
  • Both scripts need to be executed with root privileges or by a user that is assigned to the docker group. Remember that if you run them with root privileges, the files created by them will be owned by root, so you could encounter permission problems.
  • You can use these scripts passing them as argument to the BASH interpeter.
    1
    # bash imunes-export.sh
    
    1
    # bash imunes-import.sh
    
  • You can either assign the executable flag to the scripts with
    1
    chmod +x imunes-export.sh ; chmod+x imunes-import.sh
    

    and call them directly writing

    1
    ./imunes-export.sh
    

    or

    1
    ./imunes-import.sh
    

    in the directory where they are placed.

  • Obviously you can put them (with the executable flag assigned) in a directory specified in the PATH environment variable (e.g. /usr/bin) to be able to call them from anywhere.

View scripts

You can report issues (and suggest corrections of course) using my own comment system or GitHub’s one.