Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add EPICS/caproto IOC and other things #4

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .ci/drop-in.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
print(f"Loading {__file__}")

from pprint import pprint

for dev in [
qepro,
ultra1,
ultra2,
dds1,
dds1_p1,
dds1_p2,
dds2,
dds2_p1,
dds2_p2,
LED,
deuterium,
halogen,
UV_shutter,
]:
pprint(dev.read())
27 changes: 27 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
fail-fast: false
env:
TZ: America/New_York
EPICS_CA_ADDR_LIST: 127.0.0.1
EPICS_CA_AUTO_ADDR_LIST: NO
MPLBACKEND: Qt5Agg
OPHYD_TIMEOUT: 60

defaults:
run:
Expand Down Expand Up @@ -55,6 +59,10 @@ jobs:
- name: Start MongoDB
uses: supercharge/[email protected]

- name: Start Kafka and Zookeeper
run: |
docker-compose -f configs/bitnami-kafka-docker-compose.yml up -d

- name: Set up Python ${{ matrix.python-version }} with conda
uses: conda-incubator/setup-miniconda@v2
with:
Expand Down Expand Up @@ -93,6 +101,18 @@ jobs:
run: |
set -vxeuo pipefail
conda activate ~/env

# Start caproto "black-hole" IOC:

echo -e "\n" | caproto-spoof-beamline &

# Solve a missing "caRepeater" binary (same reason as in
# https://github.com/bluesky/tutorial/blob/master/binder/postBuild#L8):
ln -sv caproto-repeater ${CONDA_PREFIX}/bin/caRepeater

# Check the docker containers with Kafka is still running:
docker-compose -f configs/bitnami-kafka-docker-compose.yml ps -a

# This is what IPython does internally to load the startup files:
command="
import os
Expand All @@ -110,3 +130,10 @@ jobs:
ip.parent._exec_file(f)"

ipython --profile=test -c "$command"

- name: Check docker-compose logs
run: |
set -vxeuo pipefail

# Check the docker logs after the testing
docker-compose -f configs/bitnami-kafka-docker-compose.yml logs
99 changes: 0 additions & 99 deletions bundle-plan/32-bundle-plan.py
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @cheng-hung this file should be deleted.

This file was deleted.

20 changes: 20 additions & 0 deletions configs/bitnami-kafka-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3"
services:
zookeeper:
image: 'docker.io/bitnami/zookeeper:latest'
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: 'docker.io/bitnami/kafka:latest'
ports:
- '9092:9092'
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
depends_on:
- zookeeper
1 change: 1 addition & 0 deletions startup/10-QEPro.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,3 +548,4 @@ def export_from_scan(self, uid, csv_path, sample_type=None, plot=False, data_age
except (NameError, ModuleNotFoundError):
pass
qepro = QEPro('XF:28ID2-ES{QEPro:Spec-1}:', name='QEPro', )
qepro.wait_for_connection(10)
4 changes: 3 additions & 1 deletion startup/11-pump_ultra.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,13 @@ def syringe_diameter(volume, material='steel'):
'read_withdrawn', 'read_withdrawn_unit',
'read_infuse_rate', 'read_infuse_rate_unit',
'read_withdraw_rate', 'read_withdraw_rate_unit'])
ultra1.wait_for_connection(10)

ultra2 = syrng_ultra('XF:28IDC-ES:1{Pump:Syrng-Ultra:2}:', name='Pump_Ultra2',
read_attrs=['status', 'communication', 'update_pump',
'read_target_vol', 'read_target_vol_unit',
'read_infused', 'read_infused_unit',
'read_withdrawn', 'read_withdrawn_unit',
'read_infuse_rate', 'read_infuse_rate_unit',
'read_withdraw_rate', 'read_withdraw_rate_unit'])
'read_withdraw_rate', 'read_withdraw_rate_unit'])
ultra2.wait_for_connection()
Loading