Giter Club home page Giter Club logo

Comments (9)

djgroen avatar djgroen commented on August 16, 2024

ID stored in env.fabsim_git_hash.
Will be stored in env.yml in the results directory of any job that has been run.

from fabsim3.

djgroen avatar djgroen commented on August 16, 2024

Regarding point 1, I fully appreciate that this one can be very ambiguous. I checked Diana's implementation for FabFlee, but this is not generally applicable, as it assumes there is an "active_conflict" directory that serves as an input preparation working directory.

So the difficult thing here is: what constitutes a "run" in FabSim? Here are a few ideas from my side:

  1. We cannot make a precise definition. Instead we should just store the last X (e.g., 100) FabSim commands in a a cache and keep that in a results directory.
  2. The user should define this using fab init and fab finalize functions, either on the command line or as part of some of the custom Python task functions. History buffer will have a maximum size which is very large (e.g., 10000).
  3. Pair the flushing of the logs with the "job" task function, as it is that function that will generate a new results directory. That way, the chain of commands from multiple jobs can be concatenated by aggregating the logs in the directory of each of these jobs.
  4. This is all silly, just store the whole bash history in the results directory, so that we also fish out users tampering manually with FabSim...

@raar1 @JamesSuter @mvassaux @cspgdds @velocirobbie which of these approaches would you favour?

from fabsim3.

raar1 avatar raar1 commented on August 16, 2024

I think that regardless of which high level method (1, 2 or 3) you choose, FabSim should always dump the whole bash history to the results dir anyway. If all else fails, you should be able to check that history to see what went wrong.

from fabsim3.

djgroen avatar djgroen commented on August 16, 2024

@raar1 There are certainly reasons not to dump the whole local bash history. For instance, it will get uploaded to the remote machine prior to execution, which can be problematic if the bash history contains sensitive data. In addition, if it does not get uploaded, then we will get mismatches in the curation of results, and can no longer guarantee that two instances of FabSim will be able to retrieve/obtain the same results directory from a user.

from fabsim3.

raar1 avatar raar1 commented on August 16, 2024

@djgroen Sure, I agree with that. I wasn't suggesting using the bash history as part of the reproducibility aspect, but rather just having it also available to help with debugging when something went wrong.

from fabsim3.

djgroen avatar djgroen commented on August 16, 2024

Rudimentary implementation of this has now been added, and command history will be in env.yml. Here is an example:

fabsim_command_history: "vim deploy/repast/fabRepast.py\nfab localhost repast_cold_mscale\n\
  fab localhost flee:flee_car\nfab localhost flee:flee_car\nfab localhost flee:flee_car\n\
  fab localhost cold\nsudo apt-get search fabric\nsudo apt-cache search fabric\nwhich\
  \ fab\ncat /usr/bin/fab\ncat /usr/bin/fab\nfab localhost flee:flee_ssudan\nls ~/fabflee\n\
  ls ~/fabflee/results/\nls ~/fabflee/scripts/\nvim ~/fabflee/scripts/flee_ssudan_localhost_16.sh\
  \ \nls -lart ~/fabflee/scripts/flee_ssudan_localhost_16.sh \nfab localhost flee:flee_ssudan,input_directory:config_files/flee_ssudan/input_csv,source_data_directory:config_files/flee_ssudan/source_data,simulation_period:604\n\
  fab localhost flee:flee_ssudan,input_directory=config_files/flee_ssudan/input_csv,source_data_directory=config_files/flee_ssudan/source_data=simulation_period:604\n\
  fab localhost flee:flee_ssudan,input_directory=config_files/flee_ssudan/input_csv,source_data_directory=config_files/flee_ssudan/source_data,simulation_period=604\n\
  vim fabFlee.py\nvim fabFlee.py\nvim fabFlee.py\nfab localhost flee:flee_ssudan,input_directory=config_files/flee_ssudan/input_csv,source_data_directory=config_files/flee_ssudan/source_data,simulation_period=604\n\
  vim fabFlee.py\nvim fabFlee.py\nvim fabflee.py \nfab localhost test_variability:flee_ssudan,simulation_period=10\n\
  vim fabflee.py \nfab localhost test_variability:flee_ssudan,simulation_period=10,replicas=5\n\
  vim fabflee.py \nfab localhost test_variability:flee_ssudan,simulation_period=10,replicas=5\n\
  vim fabflee.py \nfab localhost test_variability:flee_ssudan,simulation_period=10,replicas=5\n\
  vim fabflee.py \nfab localhost test_variability:flee_ssudan,simulation_period=10,replicas=5\n\
  vim fabflee.py \nfab archer cold\nfab localhost cold\nfab archer cold\nvim deploy/fab.py\n\
  fab archer\nfab help\nfab archer regression_test\nfab archer copy_regression_tests\n\
  fab archer regression_test\nfab archer unit_test\nfab archer help\nfab archer unit_test\n\
  fab archer unit_tests\nfab archer unit_test\ncd Codes/fabflee\nfab localhost test_variability:flee_ssudan,simulation_period=10\n\
  fab localhost test_variability:flee_ssudan,simulation_period=10\nvim /home/derek/Codes/FabFlee/deploy/flee/fabflee.py\n\
  fab localhost test_variability:flee_ssudan,simulation_period=10,replicas=5\nvim\
  \ fab.py\nvim fab.py\nvim fab.py\nfab localhost setup_fabric_keys\nvim fab.py\n\
  fab localhost setup_fabric_keys\nvim fab.py\nvim fab.py\nfab localhost setup_fabric_keys\n\
  vim fab.py\nfab localhost setup_fabric_keys\nvim fab.py\nfab localhost setup_fabric_keys\n\
  vim fab.py\nfab localhost setup_fabric_keys\nvim fab.py\nfab localhost setup_fabric_keys\n\
  vim fab.py\nvim fab.py\nfab localhost setup_fabric_keys\nvim fab.py\nvim ../fabfile.py\n\
  vim fab.py\nfab localhost setup_fabsim\nvim fab.py\nfab localhost setup_fabsim\n\
  vim fab.py\nvim fabfile.py\nvim fabfile.py\nvim fab.py\nvim fabfile.py\nfab localhost\
  \ lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  fab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nvim fab.py\nfab\
  \ localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nvim fab.py\nfab localhost\
  \ lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nvim fab.py\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  vim fab.poy\nvim fab.py\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  vim fab.py\nvim fab.py\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  fab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nfab archer unit_test\n\
  fab archer fetch_results\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  fab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nvim fab.py\nfab\
  \ localhost get_fabsim_git_hash\nvim fab.py\nfab localhost get_fabsim_git_hash\n\
  vim fab.py\nfab localhost get_fabsim_git_hash\nvim fab.py\nfab localhost get_fabsim_git_hash\n\
  vim fab.py\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nfab\
  \ localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  fab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nfab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\n\
  fab localhost lammps:lammps_lj_liquid,cores=1,wall_time=1:00:0\nfab archer hemelb_unittests\n\
  fab archer unit_test\nfab archer unit_test\nfab archer stat\nfab archer fetch_results\n\
  cd deploy/fab.py\nvim fab.py\nfab archer unit_test\nfab archer fetch_results\nvim\
  \ fab.py\nfab archer unit_test\nfab archer stat\nfab archer fetch_results\ncd fab.py\n\
  vim fab.py\nfab localhost get_fabsim_command_history\nvim fab.py\nfab localhost\
  \ get_fabsim_command_history\nvim fab.py\nfab localhost get_fabsim_command_history\n\
  vim fab.py\nfab localhost get_fabsim_command_history\nvim fab.py\nfab localhost\
  \ get_fabsim_command_history\nvim fab.py\nfab localhost get_fabsim_command_history\n\
  cat ~/.bash_history | grep \"fab \"\nvim fab.py"

Command used is 'history | grep "fab "'. This can also be tested manually using:

fab localhost get_fabsim_command_history

@raar1 @mvassaux Does this seem sufficiently useful and sensible to you to close this issue altogether?

from fabsim3.

djgroen avatar djgroen commented on August 16, 2024

Okay, assigning this to both of you now. Would like to see an "OK" here before I close the issue :).

(or comments suggesting changes ;))

from fabsim3.

mvassaux avatar mvassaux commented on August 16, 2024

Seems "OK" to me.

from fabsim3.

djgroen avatar djgroen commented on August 16, 2024

Okay. This functionality is now implemented. There were issues, but those are covered in #14 and will be fixed as part of that issue.

from fabsim3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.