Skip to content

Commit

Permalink
Merge pull request #941 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release 5.18.4 Candidate
  • Loading branch information
slacrherbst authored May 5, 2023
2 parents f8fc007 + 1f20fd3 commit 6973d07
Show file tree
Hide file tree
Showing 10 changed files with 298 additions and 52 deletions.
32 changes: 10 additions & 22 deletions .github/workflows/rogue_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# ----------------------------------------------------------------------------
# The following environment variables are required for this process:
# secrets.GH_TOKEN
# secrets.CONDA_UPLOAD_TOKEN_DEV
# secrets.CONDA_UPLOAD_TOKEN_TAG
# secrets.DOCKERHUB_TOKEN

Expand All @@ -24,8 +23,8 @@ jobs:
runs-on: ubuntu-20.04

env:
EPICS_BASE: /home/runner/packages/epics/base-7.0.3
EPICS_PCAS_ROOT: /home/runner/packages/pcas/pcas-4.13.2
EPICS_BASE: /home/runner/packages/epics/base-7.0.7
EPICS_PCAS_ROOT: /home/runner/packages/pcas/pcas-4.13.3

steps:

Expand Down Expand Up @@ -78,17 +77,17 @@ jobs:
mkdir -p ${EPICS_BASE}
cd ${EPICS_BASE}
pwd
wget -O base-7.0.3.tar.gz https://github.com/epics-base/epics-base/archive/R7.0.3.tar.gz
tar xzf base-7.0.3.tar.gz --strip 1
wget -O base-7.0.7.tar.gz https://github.com/epics-base/epics-base/archive/R7.0.7.tar.gz
tar xzf base-7.0.7.tar.gz --strip 1
make clean && make && make install
- if: ${{ steps.epics-cache.outputs.cache-hit != 'true' }}
name: Install EPICS PCAS
run: |
mkdir -p ${EPICS_PCAS_ROOT}
cd ${EPICS_PCAS_ROOT}
wget -O pcas-4.13.2.tar.gz https://github.com/epics-modules/pcas/archive/v4.13.2.tar.gz
tar xzf pcas-4.13.2.tar.gz --strip 1
wget -O pcas-4.13.3.tar.gz https://github.com/epics-modules/pcas/archive/v4.13.3.tar.gz
tar xzf pcas-4.13.3.tar.gz --strip 1
echo "EPICS_BASE=$EPICS_BASE" >> configure/RELEASE.local
make clean && make && make install
Expand Down Expand Up @@ -211,7 +210,7 @@ jobs:
conda_build:
name: Anaconda Build
needs: [full_build_test, small_build_test]
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/pre-release'
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os:
Expand Down Expand Up @@ -250,16 +249,10 @@ jobs:
- name: Get Image Information
id: get_image_info
env:
CONDA_UPLOAD_TOKEN_DEV: ${{ secrets.CONDA_UPLOAD_TOKEN_DEV }}
CONDA_UPLOAD_TOKEN_TAG: ${{ secrets.CONDA_UPLOAD_TOKEN_TAG }}
OS_NAME: ${{ matrix.os }}
run: |
if [ ${GITHUB_REF} == "refs/heads/pre-release" ]
then
echo ::set-output name=token::$CONDA_UPLOAD_TOKEN_DEV
else
echo ::set-output name=token::$CONDA_UPLOAD_TOKEN_TAG
fi
echo ::set-output name=token::$CONDA_UPLOAD_TOKEN_TAG
echo ::set-output name=os::linux-64
- name: Build
Expand All @@ -280,7 +273,7 @@ jobs:
name: Docker Build
runs-on: ubuntu-20.04
needs: [full_build_test, small_build_test]
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/pre-release'
if: startsWith(github.ref, 'refs/tags/')
steps:

# This step checks out a copy of your repository.
Expand All @@ -293,12 +286,7 @@ jobs:
run: |
echo ::set-output name=tag::`git describe --tags`
echo ::set-output name=branch::`echo ${GITHUB_REF} | awk 'BEGIN { FS = "/" } ; { print $3 }'`
if [ ${GITHUB_REF} == "refs/heads/pre-release" ]
then
echo ::set-output name=name::"rogue-dev"
else
echo ::set-output name=name::"rogue"
fi
echo ::set-output name=name::"rogue"
# Setup docker build environment
- name: Set up Docker Buildx
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tidair/rogue-base:v2.0.1
FROM tidair/rogue-base:v3.0.2

# Install Rogue
ARG branch
Expand All @@ -9,3 +9,8 @@ RUN mkdir build
WORKDIR build
RUN cmake .. -DROGUE_INSTALL=system -DDO_EPICS=1
RUN make -j4 install
RUN ldconfig
ENV PYQTDESIGNERPATH /usr/local/lib/python3.10/dist-packages/pyrogue/pydm
ENV PYDM_DATA_PLUGINS_PATH /usr/local/lib/python3.10/dist-packages/pyrogue/pydm/data_plugins
ENV PYDM_TOOLS_PATH /usr/local/lib/python3.10/dist-packages/pyrogue/pydm/tools
WORKDIR /root
7 changes: 7 additions & 0 deletions docs/src/installing/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ where:

If your application uses a graphical interface, then you need to pass additional arguments in order to properly forward X:

As an example use can test the docker install and X11 with the following command:

.. code::
$ setfacl -m user:0:r ${HOME}/.Xauthority
$ docker run -ti --net=host -e DISPLAY -v ${HOME}/.Xauthority:/root/.Xauthority tidair/rogue python3 -m pyrogue.examples --gui
GUI On A Linux OS
=================

Expand Down
15 changes: 10 additions & 5 deletions python/pyrogue/_Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def __init__(self, *,
maximum=None,
function=None,
background=False,
guiGroup=None):
guiGroup=None,
**kwargs):

pr.BaseVariable.__init__(
self,
Expand All @@ -51,7 +52,8 @@ def __init__(self, *,
minimum=minimum,
maximum=maximum,
bulkOpEn=False,
guiGroup=guiGroup)
guiGroup=guiGroup,
**kwargs)

self._function = function
self._functionWrap = pr.functionWrapper(function=self._function, callArgs=['root', 'dev', 'cmd', 'arg'])
Expand Down Expand Up @@ -556,15 +558,17 @@ def __init__(self, *,
bitSize=32,
bitOffset=0,
overlapEn=False,
guiGroup=None):
guiGroup=None,
**kwargs):

# RemoteVariable constructor will handle assignment of most params
BaseCommand.__init__(
self,
name=name,
retValue=retValue,
function=function,
guiGroup=guiGroup)
guiGroup=guiGroup,
**kwargs)

pr.RemoteVariable.__init__(
self,
Expand All @@ -584,7 +588,8 @@ def __init__(self, *,
overlapEn=overlapEn,
bulkOpEn=False,
verify=False,
guiGroup=guiGroup)
guiGroup=guiGroup,
**kwargs)

def set(self, value, *, index=-1, write=True):
"""
Expand Down
5 changes: 0 additions & 5 deletions python/pyrogue/_Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,11 +991,6 @@ def _rootAttached(self, parent, root):
for var in nodes:
var._default = defValue

# Some variable initialization can run until the blocks are built
for v in self.variables.values():
v._finishInit()


def _setTimeout(self,timeout):
"""
Set timeout value on all devices & blocks
Expand Down
95 changes: 95 additions & 0 deletions python/pyrogue/_Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import rogue.interfaces.memory as rim
import numpy as np
import struct

def wordCount(bits, wordSize):
"""
Expand Down Expand Up @@ -460,6 +461,36 @@ def __init__(self, bitSize):
super().__init__(bitSize)
self.ndType = np.dtype(bool)

def toBytes(self, value):
"""
Parameters
----------
value :
Returns
-------
"""
return value.to_bytes(byteCount(self.bitSize), self.endianness, signed=self.signed)

def fromBytes(self, ba):
"""
Parameters
----------
ba :
Returns
-------
"""
return bool(int.from_bytes(ba, self.endianness, signed=self.signed))

def fromString(self, string):
"""
Expand Down Expand Up @@ -496,6 +527,40 @@ def __init__(self, bitSize):
super().__init__(bitSize)
self.name = f'{self.__class__.__name__}({self.bitSize//8})'


def toBytes(self, value):
"""
Parameters
----------
value :
Returns
-------
"""
ba = bytearray(value, self.encoding)
ba.extend(bytearray(1))
return ba

def fromBytes(self, ba):
"""
Parameters
----------
ba :
Returns
-------
"""
s = ba.rstrip(bytearray(1))
return s.decode(self.encoding)

def fromString(self, string):
"""
Expand Down Expand Up @@ -526,6 +591,36 @@ def __init__(self, bitSize):
self.name = f'{self.__class__.__name__}{self.bitSize}'
self.ndType = np.dtype(np.float32)

def toBytes(self, value):
"""
Parameters
----------
value :
Returns
-------
"""
return bytearray(struct.pack(self.fstring, value))

def fromBytes(self, ba):
"""
Parameters
----------
ba :
Returns
-------
"""
return struct.unpack(self.fstring, ba)[0]

def fromString(self, string):
"""
Expand Down
4 changes: 4 additions & 0 deletions python/pyrogue/_Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,10 @@ def _rootAttached(self,parent,root):
for grp in parent.groups:
self.addToGroup(grp)

def _finishInit(self):
for key,value in self._nodes.items():
value._finishInit()

@expose
def getYaml(self, readFirst=False, modes=['RW','RO','WO'], incGroups=None, excGroups=['Hidden'], recurse=True):

Expand Down
9 changes: 4 additions & 5 deletions python/pyrogue/_Root.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ def start(self):
# Call special root level rootAttached
self._rootAttached()

# Finish Initialization
self._finishInit()

# Get full list of Devices and Blocks
tmpList = []
for d in self.deviceList:
Expand Down Expand Up @@ -891,7 +894,7 @@ def _hbeatWorker(self):

def _rootAttached(self):
"""
"""
"""
self._parent = self
self._root = self
self._path = self.name
Expand All @@ -901,10 +904,6 @@ def _rootAttached(self):

self._buildBlocks()

# Some variable initialization can run until the blocks are built
for v in self.variables.values():
v._finishInit()

def _sendYamlFrame(self,yml):
"""
Generate a frame containing the passed string.
Expand Down
Loading

0 comments on commit 6973d07

Please sign in to comment.