Sign inSign up

oboberg/opsim4

By oboberg

Updated over 8 years ago

A set of images to run version 4 of the Operations Simulator. (OpSim)

Image
2

673

oboberg/opsim4 repository overview

Latest tag (dd-mm-yy)

  • oboberg/opsim4:081217
  • oboberg/opsim4:stackpy2-081217

Previous tags

  • oboberg/opsim4:061117
    • oboberg/opsim4:stackpy2-061117

LSST Stack images

Each opsimv4 tag is built on top of an LSST stack image that was built on the same day. The tags for these images are listed below the opsim4 tags (e.g opsim4:stackpy2-081217). The stack is installed in these images using the newsinall.sh method. For clarity, here are the commands used:

newinstall.sh -b -2
source loadLSST.bash
eups distrib install sims_utils -t sims
eups distrib install sims_survey_fields -t sims
eups distrib install pex_config -t sims

Note: This is NOT a full install of the LSST software stack, and the resulting image will be using python 2.

The OS in these images is centos:7.

Prerequisites

  • Docker must already be installed on your local machine.
  • This image is also set up to run assuming you have downloaded the Sky Brightness model data to your local machine. Instructions for how to do this can be found at this page.
    • This is a large amount of data (~ 65GB)
    • Make sure you follow the instructions at the page mentioned above and use the -o option.
    • Below shows an example of how this can be done, but please still look at the documentation page.
 mkdir ~/gitdir
 cd gitdir
 git clone https://github.com/lsst/sims_skybrightness_pre
 cd sims_skybrightness_pre
 cd data
./data_down.sh -o

Note: You will need the full path to the location of this data when you run the Docker container. On a Mac this would be something like /Users/my_user_name/gitdir/sims_skybrightness_pre/data.

  • Once you have downloaded that data you are ready to run a Docker container.

Starting the opsim4 container.

Before starting the container, there are a couple of additional local directories you will want to create.

  • A local directory where you would like the output of opsim to be saved (run_dir)

    • For this example we will define run_dir as the following:

    /Users/my_user_name/opsimv4_data/run_dir

  • A local directory where you would like to store opsim configuration files (config_dir)

    • For this example we will define config_dir as the following:

    /Users/my_user_name/opsimv4_data/config_dir

  • You will need to know the local directory where the sims sky brightness data are store.

    • For this example we use the directory described above.

    /Users/my_user_name/gitdir/sims_skybrightness_pre/data

  • You will want to know the current IP address of your local machine.

    • One way this can be found is with ifconfig | grep inet
  • You will also want to choose a hostname that will be used by opsim inside the container to keep track of various runs and databases. This is typically set to the name of your local machine.

OPSIM_HOSTNAME = my_clever_computer_name

The command to start the container

This is to be run through the terminal on your local machine.
docker run -it --name my_container_name \
           -v /Users/my_user_name/opsimv4_data/run_dir:/home/opsim/run_local \
           -v /Users/my_user_name/opsimv4_data/config_dir:/home/opsim/other-configs \
           -v /Users/my_user_name/gitdir/sims_skybrightness_pre/data:/home/opsim/sky_brightness_data \
           -v /Users/my_user_name/gitdir/sims_skybrightness_pre/data:/home/opsim/repos/sims_skybrightness_pre/data \
           -v $HOME/.config:/home/opsim/.config \
           -e OPSIM_HOSTNAME=my_clever_computer_name \
           -e DISPLAY=your_ip_adress:0 \
           oboberg/opsim4:081217

There is a lot going on in this command but see the documentation here for another example of what each line is doing. Below is a very brief explanation of the options are doing.

  • The -v options are mounting a local directory (the one before the colon) into the container at the path that is given after the colon.

  • The -e options are setting environment variables that will be used inside the container.

  • docker run -it is saying start the container in an interactive mode.

  • --name is allowing you to name the container.

  • The last line is telling Docker what image to use to run the container.

After you have run the command above in your local terminal, you will be inside the container and have access to its command line. Your prompt should now look something like the following:

[opsim@e422f290a607 ~]$

Setting up the environment

These commands are run inside the container.
  • Run an ls command and to make sure you see the following:
[opsim@e422f290a607 ~]$ ls
dds  other-configs  repos  run_local  sky_brightness_data  stack  startup.sh
  • Now run the following commands in this order
    • cd repos/sims_skybrightness_pre/
    • setup sims_skybrightness_pre git
    • scons
    • cd ~/repos/ts_astrosky_model
    • setup ts_astrosky_model git
    • scons
    • cd ~
    • setup ts_scheduler
    • setup sims_ocs
    • mkdir ~/run_local/output
    • manage_db --save-dir=$HOME/run_local/output

    Note: This last command is setting up a database to track the simulations you will run. This sessions database will be saved in /home/opsim/run_local/output and have a name that is set by what you used as OPSIM_HOSTNAME when running the command to start the container. In the example used this would be my_clever_compter_name_session.db. See this page for more information.

  • cd run_local
  • At this point everything is set up to run a simulation. I suggest trying the following command to run a default simulation only last 1 night.
[opsim@e422f290a607 run_local] $ opsim4 --frac-duration=0.003 --scheduler-timeout=600 -c "test one day simaultion" -v
  • For more information about using opsim please see this [documentation](https://lsst- sims.github.io/sims_ocs/usage.html).

Note: when using the docker container you do NOT have to use the drun command as shown in those documentation pages.

Tag summary

Content type

Image

Digest

Size

1.3 GB

Last updated

over 8 years ago

docker pull oboberg/opsim4:stackpy3-180529