Skip to content

Commit

Permalink
Merge pull request #49 from epics-containers/3.0-schema
Browse files Browse the repository at this point in the history
3.0 schema and Comprehensive CI
  • Loading branch information
gilesknap authored Jun 24, 2024
2 parents d344029 + a5f2661 commit 5e3c70a
Show file tree
Hide file tree
Showing 75 changed files with 35,674 additions and 6,387 deletions.
64 changes: 49 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@ on:
pull_request:

jobs:
check-generate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Run schema/ioc instance generation tests
run: |
pip install -r requirements.txt
bash tests/test_generate.sh
check-docker-build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
permissions:
contents: read
packages: write
env:
CACHE: /tmp/.buildx-cache
strategy:
fail-fast: false
max-parallel: 10
matrix:
repo: [ioc-adaravis, ioc-pmac, ioc-lakeshore340, ioc-tetramm, ioc-opcua, ioc-motorSim, ioc-adsimdetector]
include:
# rtems is cross compiled on ubuntu-latest
# linux is natively compiled on ubuntu-latest and macos-latest
Expand All @@ -25,8 +38,9 @@ jobs:
# os: ubuntu-latest
# platform: linux/amd64

- architecture: linux
os: ubuntu-latest
- os: ubuntu-latest
epics-target: linux-x86_64
extension: ""
platform: linux/amd64

# enable below for MACOS native build on M1 macs
Expand All @@ -52,13 +66,33 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Test Build Script
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup
# before building the container set up to use this version of ibek-support
# and its associated version of ibek
env:
ARCH: ${{ matrix.architecture }}
PLATFORM: ${{ matrix.platform }}
CACHE: ${{ env.CACHE }}
REPO: ${{ matrix.repo }}
run: |
for test in tests/*.sh; do
echo "RUNNING TEST SCRIPT ${test}"
${test}
done
git clone https://github.com/epics-containers/${REPO} /tmp/generic_ioc
cp -r . /tmp/generic_ioc/ibek-support
cp ./requirements.txt /tmp/generic_ioc
- name: Build image
uses: docker/build-push-action@v5
with:
context: /tmp/generic_ioc
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
IMAGE_EXT=${{ matrix.extension }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}
tags: ci_test
load: true

- name: Test image
# can't test non native without some hardware to run on
if: ${{ matrix.epics-target == 'linux-x86_64' }}
run: /tmp/generic_ioc/tests/run-tests.sh ci_test
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "tests/beamlines/bl47p"]
path = tests/ioc_repos/bl47p
url = https://github.com/epics-containers/bl47p.git
[submodule "tests/beamlines/bl45p"]
path = tests/ioc_repos/bl45p
url = https://github.com/epics-containers/bl45p.git
[submodule "tests/ioc_repos/bl01t"]
path = tests/ioc_repos/bl01t
url = https://github.com/epics-containers/bl01t.git
67 changes: 32 additions & 35 deletions ADAravis/ADAravis.ibek.support.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

module: ADAravis

defs:
entity_models:
- name: aravisCamera
description: |-
Creates a aravisCamera camera areaDetector driver
args:
- type: str
name: P
parameters:
P:
type: str
description: |-
PV Prefix
- type: str
name: R
R:
type: str
description: |-
PV Suffix
- type: id
name: PORT
PORT:
type: id
description: |-
Port name for the camera
- type: str
name: ID
ID:
type: str
description: |-
Cam ip address, hostname, MAC address, or ID <manufacturer>-<serial>, (e.g. Prosilica-02-2166A-06844)
- type: enum
name: CLASS
CLASS:
type: enum
description: |-
Camera class for custom commands
values:
Expand Down Expand Up @@ -74,31 +74,35 @@ defs:
AVT_Mako_G234B:
AVT_Manta_G609B:
JAI_CM140:

- type: int
name: BUFFERS
BUFFERS:
type: int
description: |-
Maximum number of NDArray buffers to be created for plugin callbacks
default: 50

- type: int
name: MEMORY
MEMORY:
type: int
description: |-
Max memory to allocate, should be maxw*maxh*nbuffer for driver and all attached plugins
default: -1

- type: int
name: TIMEOUT
TIMEOUT:
type: int
description: |-
Timeout, default 1
default: 1

- type: int
name: ADDR
ADDR:
type: int
description: |-
Asyn Port address, default 0
default: 0

pre_init:
- value: |
# aravisConfig(const char *portName, const char *cameraName, size_t maxMemory, int priority, int stackSize)
aravisConfig("{{PORT}}", "{{ID}}", {{MEMORY}}, 0, 1)
databases:
- file: $(ADARAVIS)/db/aravisCamera.template
args:
Expand All @@ -116,32 +120,25 @@ defs:
TIMEOUT:
ADDR:

pre_init:
- value: |
# aravisConfig(const char *portName, const char *cameraName, size_t maxMemory, int priority, int stackSize)
aravisConfig("{{PORT}}", "{{ID}}", {{MEMORY}}, 0, 1)
pvi:
yaml_path: ADDriver.pvi.device.yaml
ui_macros:
P:
R:
pv: true
pv_prefix: "$(P)$(R)"
pv_prefix: $(P)$(R)

- name: aravisSettings
description: |-
Creates detailed settings screens for and Aravis camera
args:
- type: object
parameters:
camera:
type: object
description: the aravisCamera object to create settings for
name: camera

pvi:
yaml_path: arvFeature.pvi.device.yaml
ui_macros:
P: "{{ camera.P }}"
R: "{{ camera.R }}"
P: '{{ camera.P }}'
R: '{{ camera.R }}'
pv: true
pv_prefix: "{{ camera.P }}{{ camera.R }}"
pv_prefix: '{{ camera.P }}{{ camera.R }}'
65 changes: 34 additions & 31 deletions ADAravis/arvFeature.pvi.device.yaml
Original file line number Diff line number Diff line change
@@ -1,99 +1,102 @@
label: ArvFeature
parent: GenICamFeature
label: arvFeature
parent: ADDriver
children:
- type: Group
name: ADAravis
layout:
type: Grid
labelled: true
children:
- type: SignalR
name: ARFramesCompleted
pv: ARFramesCompleted
widget:
read_pv: $(P)$(R)ARFramesCompleted
read_widget:
type: TextRead

- type: SignalR
name: ARFrameFailures
pv: ARFrameFailures
widget:
read_pv: $(P)$(R)ARFrameFailures
read_widget:
type: TextRead

- type: SignalR
name: ARFrameUnderruns
pv: ARFrameUnderruns
widget:
read_pv: $(P)$(R)ARFrameUnderruns
read_widget:
type: TextRead

- type: SignalR
name: ARMissingPackets
pv: ARMissingPackets
widget:
read_pv: $(P)$(R)ARMissingPackets
read_widget:
type: TextRead

- type: SignalR
name: ARResentPackets
pv: ARResentPackets
widget:
read_pv: $(P)$(R)ARResentPackets
read_widget:
type: TextRead

- type: SignalW
name: ARPacketResendEnable
pv: ARPacketResendEnable
widget:
write_pv: $(P)$(R)ARPacketResendEnable
write_widget:
type: ComboBox

- type: SignalW
name: ARPacketTimeout
pv: ARPacketTimeout
widget:
write_pv: $(P)$(R)ARPacketTimeout
write_widget:
type: TextWrite

- type: SignalW
name: ARFrameRetention
pv: ARFrameRetention
widget:
write_pv: $(P)$(R)ARFrameRetention
write_widget:
type: TextWrite

- type: SignalW
name: ARResetCamera
pv: ARResetCamera
widget:
write_pv: $(P)$(R)ARResetCamera
write_widget:
type: TextWrite

- type: SignalRW
name: ARConvertPixelFormat
pv: ARConvertPixelFormat
widget:
write_pv: $(P)$(R)ARConvertPixelFormat
write_widget:
type: ComboBox
read_pv: ARConvertPixelFormat_RBV
read_pv: $(P)$(R)ARConvertPixelFormat_RBV
read_widget:
type: TextRead

- type: SignalRW
name: ARShiftDir
pv: ARShiftDir
widget:
write_pv: $(P)$(R)ARShiftDir
write_widget:
type: ComboBox
read_pv: ARShiftDir_RBV
read_pv: $(P)$(R)ARShiftDir_RBV
read_widget:
type: TextRead

- type: SignalRW
name: ARShiftBits
pv: ARShiftBits
widget:
write_pv: $(P)$(R)ARShiftBits
write_widget:
type: ComboBox
read_pv: ARShiftBits_RBV
read_pv: $(P)$(R)ARShiftBits_RBV
read_widget:
type: TextRead

- type: Group
name: ArvFeatureMisc
label: arvFeature Ungrouped
layout:
type: Grid
labelled: true
children:
- type: SignalW
name: ARConnectCamera
pv: ARConnectCamera
widget:
write_pv: $(P)$(R)ARConnectCamera
write_widget:
type: TextWrite
Loading

0 comments on commit 5e3c70a

Please sign in to comment.