Sirepo is fully open source as are all its codes. We are happy to support you, just submit an issue if you have questions.
We deploy using Docker.
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.
Once Vagrant is installed, run the vagrant-sirepo-dev installer on your Mac:
mkdir v cd v curl radia.run | 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
v.radia.run. The rest of this page assumes
v.radia.run is the hostname.
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
with the VM. This way you can edit files locally on your Mac. In this case,
you would use the command:
curl radia.run | bash -s vagrant-sirepo-dev
If you do this, you may want to have a symlink on your mac from
/Users/<your-user> so that you can directly
reference file names in error messages output by sirepo. Make sure
on your Mac is
The host defaults to
v.radia.run (ip 10.10.10.10). You can also
specify a different host as an argument to
curl radia.run | bash -s vagrant-sirepo-dev my-host.example.com
Next step: Single Server Execution.
You can develop on Windows or Linux with Vagrant. You just have to run the install manually.
Once you have installed VirtualBox and Vagrant, create a directory, and use this Vagrantfile:
# -*-ruby-*- Vagrant.configure("2") do |config| config.vm.box = "fedora/27-cloud-base" config.vm.hostname = "v.radia.run" config.vm.network "private_network", ip: "10.10.10.10" config.vm.provider "virtualbox" do |v| v.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 5000] # https://stackoverflow.com/a/36959857/3075806 v.customize ["setextradata", :id, "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled", "0"] # If you see network restart or performance issues, try this: # https://github.com/mitchellh/vagrant/issues/8373 # v.customize ["modifyvm", :id, "--nictype1", "virtio"] # # Needed for compiling some the larger codes v.memory = 8192 v.cpus = 4 end config.ssh.forward_x11 = false # https://stackoverflow.com/a/33137719/3075806 # Undo mapping of hostname to 127.0.0.1 config.vm.provision "shell", inline: "sed -i '/127.0.0.1.*v.radia.run/d' /etc/hosts" end
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
> vagrant ssh
And inside the guest VM run the redhat-base installer:
$ curl radia.run | 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 radia.run | 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 http://v.radia.run:8000. However, some networks block resolutions to private internet addresses so you may have to visit http://10.10.10.10:8000.
Two Server Execution (runner_daemon)
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):
$ SIREPO_FEATURE_CONFIG_RUNNER_DAEMON=1 sirepo service http
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: http://v.radia.run:8000/myapp.
Full Stack Development (celery)
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 logout vagrant reload vagrant ssh radia_run redhat-docker logout vagrant ssh
At this point, Docker will be setup.
Set up a few environment variables:
export PYKERN_PKDEBUG_REDIRECT_LOGGING=1 PYKERN_PKDEBUG_WANT_PID_TIME=1
Then run each of the following commands in separate windows:
sirepo service rabbitmq SIREPO_CELERY_TASKS_CELERYD_CONCURRENCY=2 SIREPO_MPI_CORES=4 sirepo service celery SIREPO_SERVER_JOB_QUEUE=Celery sirepo service uwsgi sirepo service nginx_proxy sirepo service flower
As user vagrant:
If radia_run fails, run with debug:
radia_run debug sirepo-dev