Skip to content


robnagler edited this page Jun 19, 2019 · 16 revisions

Developing Sirepo

Sirepo is fully open source as are all its codes. We are happy to support you, just submit an issue if you have questions.

Sirepo runs on Linux. We use Vagrant and VirtualBox. You will need to install Vagrant/Virtualbox manually before doing anything below.

We deploy using Docker.

We rely heavily on a simple curl installer structure in our download repo. If you are not comfortable with curl installers, please feel free to follow the installer scripts mentioned below.

If you use a Mac, read on. Otherwise, skip to PC Install. We use Macs so they are the best supported.

Once installed, run the server.

Server-side Technologies

  • python programming language
  • Flask lightweight web server framework
  • OpenMPI parallel computing

Client-side Technologies

Mac Install

Once Vagrant is installed, run the vagrant-sirepo-dev installer on your Mac:

mkdir v
cd v
curl | vagrant_dev_no_nfs_src=1 bash -s vagrant-sirepo-dev
vagrant ssh

The directory must be named "v", which will be used as a basis for the hostname The rest of this page assumes is the hostname.

The vagrant_dev_no_nfs_src=1 turns off sharing ~/src between the host (Mac) and guest (VM). This depends on how you develop. If you would like to use an IDE like PyCharm, you might want to share ~/src with the VM. This way you can edit files locally on your Mac. In this case, you would use the command:

curl | bash -s vagrant-sirepo-dev

If you do this, you may want to have a symlink on your mac from /home/vagrant to /Users/<your-user> so that you can directly reference file names in error messages output by sirepo. Make sure /home on your Mac is chmod 755.

The host defaults to (ip You can also specify a different host as an argument to vagrant-sirepo-dev, e.g.

curl | bash -s vagrant-sirepo-dev

Next step: Single Server Execution.

PC Install

You can develop on Windows or Linux with Vagrant. You just have to run the install manually.

Linux Note: Always use the repos configured by and, and not the default that comes with your distro. We know for sure that Ubuntu's VirtualBox doesn't work properly.

Once you have installed VirtualBox and Vagrant, create a directory, and use this Vagrantfile:

# -*-ruby-*-
Vagrant.configure("2") do |config| = "fedora/27-cloud-base"
    config.vm.hostname = "" "private_network", ip: ""
    config.vm.provider "virtualbox" do |v|
        v.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 5000]
        v.customize ["setextradata", :id, "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled", "0"]
        # If you see network restart or performance issues, try this:
        # v.customize ["modifyvm", :id, "--nictype1", "virtio"]
        # Needed for compiling some the larger codes
        v.memory = 8192
        v.cpus = 4

    config.ssh.forward_x11 = false
    # Undo mapping of hostname to
    config.vm.provision "shell",
        inline: "sed -i '/*' /etc/hosts"

Then install the vbguest plugin:

> vagrant plugin install vagrant-vbguest

This will make sure your time on the machine stays up to date, and also allow you to mount directories from the host. Once the plugin is installed, run:

> vagrant up

Once booted:

> vagrant ssh

And inside the guest VM run the redhat-base installer:

$ curl | bash -s redhat-dev
$ exit

This sets up a lot of environment so logging out is a good idea, then login again and run the sirepo-dev installer:

$ vagrant ssh
$ curl | bash -s sirepo-dev
$ exit

This installs all the codes used by sirepo, and it's fully automatic so go have lunch, and it will be done. Make sure you exit, because you will need to refresh your login environment.

Next step: Single Server Execution.

Single Server Execution

Once installed by one of the methods above, you will have a sirepo development environment. To run sirepo locally, run:

$ cd ~/src/radiasoft/sirepo
$ sirepo service http

Vagrant sets up a private network. You can access the server at However, some networks block resolutions to private internet addresses so you may have to visit

Two Server Execution (runner_daemon)

The sirepo service http setup is used for basic application development, but we are migrating to requiring a runner_daemon for all workflows.

You need a py3 virtual environment:

$ bivio_pyenv_3
$ cd ~/src/radiasoft/sirepo
$ pip install -e .

Start the runner_daemon in py3 environment:

$ PYENV_VERSION=py3 SIREPO_FEATURE_CONFIG_RUNNER_DAEMON=1 pyenv exec sirepo runner start

Start sirepo with runner_daemon enabled (assumes py2 is active):


Codeless Server Execution

You can run Sirepo without any of the scientific codes it supports by running the server this way:

$ SIREPO_FEATURE_CONFIG_SIM_TYPES=myapp sirepo service http

This runs the demo app, which is available at the following link:

Full Stack Development (celery)

The sirepo service http setup is used for basic application development. However, if you want to test the full stack workflow, you'll need to start all the support processes and configure them.

If Docker is not installed, you will need to install Docker in your VM as follows:

vagrant ssh
radia_run redhat-docker
vagrant reload
vagrant ssh
radia_run redhat-docker
vagrant ssh

At this point, Docker will be setup.

Set up a few environment variables:


Then run each of the following commands in separate windows:

sirepo service rabbitmq
SIREPO_SERVER_JOB_QUEUE=Celery sirepo service uwsgi
sirepo service nginx_proxy
sirepo service flower

nginx will listen on port 8080 so you can browse Sirepo at The middle tier uwsgi server will start on port 8000.

The last process starts Flower, which allows you to monitor Celery. You can visit to see the workers, tasks, processes, queues, etc.

You can also visit RabbitMQ's Management Plugin on this URL:

Updating VM

As user vagrant:

radia_run sirepo-dev

If radia_run fails, run with debug:

radia_run debug sirepo-dev
You can’t perform that action at this time.