Skip to content

Intro 20260316

Rob Nagler edited this page Mar 17, 2026 · 10 revisions

Initialize Git (Slide 6)

Set up Git directory:

$ mkdir -p ~/src/slaclab
$ cd ~/src/slaclab
$ git clone git@github.com:slaclab/slicops.git # OR
  $ git clone https://github.com/slaclab/slicops
$ cd slicops
$ git checkout -b 209-<your-git-username> origin/209-participants-base
$ git push --set-upstream origin 209-<your-git-username>

Setup Environment (Slide 8)

Add this to your ~/.bashrc:

export SLICOPS_APPTAINER_SIF=/sdf/group/ad/org/lfd/hla/apptainer/slicops.sif

Then, verify it works:

$ source ~/.bashrc
$ echo $SLICOPS_APPTAINER_SIF

Make sure you are running your own conda environment:

$ type conda

First Time: Setup port forwarding (Slide 8)

This will initialze your conda environment, and output commands to add to your bashrc:

$ bash etc/run.sh sim

Control-C this process, add to the commands printed to your bashrc, and then logout of ssh. Then log back in with the your ports forwarded:

ssh -L <your-vue-port>:127.0.0.1:<your-vue-port> <your-slac-user>@dev-srv09.slac.stanford.edu

Start over starting all these processes.

Start Servers (Slide 8)

These need to be run in three shell windows.

$ bash etc/run.sh sim
$ bash etc/run.sh vue
$ bash etc/run.sh api

Adding a Button (Slide 9)

Make sure you are still on your branch

$ git branch
* 209-<your-git-username>
  209-partipants-base
  main

Make sure your directory is at the repo root

cd ~/src/slaclab/slicops
ls -d .git

Copy the template to your branch

git show 20260316-t-09:slicops/sliclet/hello.py > slicops/sliclet/hello.py

First unit test (slide 13)

Commit your previous changes and push them

Verify you environment

test -d .git && git branch
git commit -am 'intro slide 9: added a button'
git push

Copy the template

git show 20260316-t-13:tests/sliclet/hello_test.py > tests/sliclet/hello_test.py

To run the test, run this command:

conda activate slicops
EPICS_CA_AUTO_ADDR_LIST=NO \
    EPICS_CA_ADDR_LIST=127.0.0.1:$(( $SLICOPS_BASE_PORT + 3 )) \
    pykern test tests/sliclet/hello_test.py

This is not how we run tests normally. $(( $SLICOPS_BASE_PORT + 3 )) adds three to your port so that it talks to your sim detector process. You'll learn more about testing tomorrow, and we'll show how we mock EPICS to avoid this extra config.

Clone this wiki locally