-
Notifications
You must be signed in to change notification settings - Fork 1
Development
To configure the initial master in Vagrant on a Mac or a Linux development environment:
mkdir ~/v3
cd ~/v3
radia_run vagrant-rsconf-devYou might also want to build-perl-rpms.sh or empty-rpm.sh.
Start the local rsconf development server on v3:
cd ~/v3
vssh
cd ~/src/radiasoft/rsconf
rsconf build
bash run/nginx/start.shOn the Mac run:
mkdir ~/v4
cd ~/v4
radia_run vagrant-rsconf-devThis will pull from the development server.
Once installed, you can just do:
cd ~/v4
vssh
sudo su -
rscThe alias rsc will use the $install_server set on the initial install.
However, if you need to re-install, run:
s=file:///home/vagrant/src/radiasoft/rsconf/run/srv
curl $s/index.html | install_server=$s bash -s rsconf.sh $(hostname -f) setup_devTo restart the local server:
cd ~/src/radiasoft/rsconf
bash run/nginx/start.shYou'll need to destroy manually.
Create a master, and then run this:
rsconf build
pykern test
cp -a ~/src/radiasoft/rsconf/tests/pkcli/build_work/2/srv/host/v4.radia.run ~/src/radiasoft/rsconf/run/srv/host
bash run/nginx/start.shThen create v4, which will use build_data/2.in configuration:
mkdir v4
cd v4
radia_run rsconf-vagrant-devWhen working on sirepo, it helps to have a local registry, which can be configured on the master, but you'll also need to:
sudo cat /root/.docker/config.json > ~/.docker/config.json
cd ~/src/radiasoft/sirepo
build_push= build_docker_registry=$(hostname -f):5000 radia_run container-build
docker push 'v3.radia.run:5000/radiasoft/sirepo:dev' | catTo rebuild all the beamsim and sirepo images:
export install_server=http://$(hostname -f):2916
cd ~/src/radiasoft/container-python2
radia_run container-build
vcd ~/src/radiasoft/download/installers/rpm-code
bash dev-setup.sh
bash dev-build-all.sh
cd ~/src/radiasoft/container-beamsim
radia_run container-build
# Make available for download to workers
docker tag radiasoft/beamsim:dev $(hostname -f):5000/radiasoft/beamsim:dev
docker push $(hostname -f):5000/radiasoft/beamsim:dev | cat
cd ~/src/radiasoft/container-sirepo
radia_run container-build
docker tag radiasoft/sirepo:dev $(hostname -f):5000/radiasoft/sirepo:dev
docker push $(hostname -f):5000/radiasoft/sirepo:dev | catOn workers, you'll need to do this manually:
docker pull v3.radia.run:5000/radiasoft/sirepo:devOR, you can configure the registry in run/db/000.yml by removing
the docker.io/ prefix from mpi_cluster.docker_image:
mpi_cluster:
docker_image: radiasoft/beamsim-jupyterFirst setup full stack with a local docker daemon and make sure it works. The following assumes localhost.localdomain is a valid host to use.
The docker runner requires some special setup. You should add this to your run/db/000.yml (not .jinja):
v.radia.run:
nfs_server:
exports:
/home/vagrant/src/radiasoft/sirepo/run/user: [ 10.10.10.0/24 ]
rsconf_db:
components: [ sirepo, nfs_server ]
sirepo:
docker_hosts: [ v4.radia.run, v5.radia.run ]For v4 and v5 (both):
nfs_client:
mounts:
v4.radia.run:
- /srv/sirepo/db/userOn v3 (master) as vagrant:
rsconf host init-docker-registry v.radia.run
rsconf build
sudo bash -l -c rsc
(cd run/srv/host/v.radia.run; tar cf - etc/exports.d root/.docker srv/sirepo/docker_tls etc/docker/certs.d etc/pki) > v.tar
scp v.tar v.radia.run:On v.radia.run as root:
dnf install -y nfs-utils
cd /
tar xpf ~vagrant/v.tar
cp -a /srv/sirepo/docker_tls /home/vagrant/src/radiasoft/sirepo/run
rm -rf /srv/sirepo
systemctl restart nfs-server
update-ca-trust
systemctl restart docker
sudo install -o vagrant -g vagrant -m 600 /root/.docker/config.json /home/vagrant/.dockerOn v4 and v5 as root:
rscOn v as vagrant:
docker pull v3.radia.run:5000/radiasoft/sirepo:dev
PYKERN_PKDEBUG_CONTROL=runner \
SIREPO_MPI_CORES=4 SIREPO_RUNNER_DOCKER_HOSTS=localhost.localdomain:v4.radia.run:v5.radia.run \
SIREPO_RUNNER_DOCKER_IMAGE=v3.radia.run:5000/radiasoft/sirepo:dev \
SIREPO_RUNNER_DOCKER_TLS_DIR=$PWD/run/docker_tls \
SIREPO_RUNNER_JOB_CLASS=Docker sirepo service httpWhen configured with RSConf, you will have files in /src/sirepo.
-
env- contains environment variables. You can add PYKERN_PKDEBUG_CONTROL=. to turn on all real-time tracing -
start- how container is run. You can add-v /srv/sirepo/sirepo:/home/vagrant/.pyenv/versions/py2/lib/python2.7/site-packages/sirepoto have a local copy of sirepo that is persistent outside the container to debug. You can make the copy by runningdocker exec -it sirepo bashandcp -a /home/vagrant/.pyenv/versions/py2/lib/python2.7/site-packages/sirepo /srv/sirepo. -
uswgi.ymlanduwsgi.pyare created fromsirepo/package_data/uwsgi.*.jinjaat container start so you need to modify those.
If you happen to need to port forward, use socat:
# add this line to /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --match multiport --dports https -j ACCEPT
# run this as root
socat TCP-LISTEN:443,fork,reuseaddr TCP:v4.radia.run:443You can also use ssh LocalForward
# ~/.ssh/config
Host <redacted>
HostName <redacted>
Port <redacted>
User <redacted>
LocalForward 8080 sirepo.v4.radia.run:443
To get this to work with nginx routing you will need to update your /etc/hosts on the machine where your browser is running
# /etc/hosts
127.0.0.1 localhost localhost.localdomain sirepo.v4.radia.run
Then visit https://sirepo.v4.radia.run:8080. You will get a warning in your browser about the certificates which are self-signed. Click accept.
If you see this:
Error getting v2 registry: Get https://v3.radia.run:5000/v2/: x509: certificate has expired or is not yet valid"Restart the docker daemon. It may be the certs were recreated, and the docker daemon caches them instead of reading them from disk.