Skip to content

Commit

Permalink
Merge pull request #956 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Stage release for Rogue 6.0.0
  • Loading branch information
slacrherbst authored Jun 30, 2023
2 parents 6973d07 + 69e0a4b commit b8cf8d8
Show file tree
Hide file tree
Showing 277 changed files with 20,859 additions and 24,977 deletions.
37 changes: 37 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
BasedOnStyle: Google
ColumnLimit: 120
IndentWidth: 4
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: WithoutElse # Maybe want Never
DerivePointerAlignment: false
PointerAlignment: Left
AllowAllConstructorInitializersOnNextLine: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackArguments: false
BinPackParameters: false
AlignConsecutiveAssignments: true
AlignConsecutiveMacros: true
AccessModifierOffset: -2
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
# Rogue Directives.h goes first
- Regex: '^((<|")(rogue)/(Directives.h))'
Priority: -1
# Rogue headers go last
- Regex: '^((<|")(rogue)/)'
Priority: 5
# C-headers
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 2
# C++ headers
- Regex: '^<.*'
Priority: 3
# Everything else
- Regex: '.*'
Priority: 4

105 changes: 21 additions & 84 deletions .github/workflows/rogue_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ jobs:
full_build_test:
name: Full Build Test
runs-on: ubuntu-20.04

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

steps:

# This step checks out a copy of your repository.
Expand All @@ -39,15 +34,6 @@ jobs:
cache: 'pip'
cache-dependency-path: 'pip_requirements.txt'

- name: Setup Environment
run: |
LD_LIBRARY_PATH=/usr/lib:${EPICS_BASE}/lib/linux-x86_64:${EPICS_PCAS_ROOT}/lib/linux-x86_64
PATH=${EPICS_BASE}/bin/linux-x86_64:${PATH}
echo "EPICS_BASE=$EPICS_BASE" >> $GITHUB_ENV
echo "EPICS_PCAS_ROOT=$EPICS_PCAS_ROOT" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -62,41 +48,12 @@ jobs:
python -m compileall -f ./tests
flake8 --count ./tests/
- name: Cache EPICS
uses: actions/cache@v3
id: epics-cache
with:
key: epics
path: |
${{ env.EPICS_BASE }}/
${{ env.EPICS_PCAS_ROOT }}/
- if: ${{ steps.epics-cache.outputs.cache-hit != 'true' }}
name: Install EPICS Base
run: |
mkdir -p ${EPICS_BASE}
cd ${EPICS_BASE}
pwd
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.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
# Rogue
- name: Build Rogue
run: |
python -c "import numpy; print(numpy.get_include())"
mkdir build; cd build
cmake .. -DROGUE_INSTALL=local -DDO_EPICS=1
cmake .. -DROGUE_INSTALL=local
make -j4 install
# Run Tests
Expand All @@ -105,14 +62,20 @@ jobs:
source setup_rogue.sh
python -m pytest --cov
# # Run test_rate.py
# # - name: Get test_rate.py output
# # uses: mathiasvr/command-output@v1
# # id: rates
# # with:
# # run: |
# # source setup rogue.sh
# # python -m test_rate.py
# Compile API Test
- name: Compile API Test
run: |
source setup_rogue.sh
cd tests/api_test
mkdir build; cd build
cmake ..
make
# Run API Test
- name: Run API Test
run: |
source setup_rogue.sh
tests/api_test/bin/api_test
# Code Coverage
- name: Code Coverage
Expand All @@ -123,33 +86,19 @@ jobs:
# Generate Documentation
- name: Generate Documentation
if: github.ref == 'refs/heads/documentation' || startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/')
run: |
source setup_rogue.sh
cd docs
make html
- name: Deploy Documentation
if: github.ref == 'refs/heads/documentation' || startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: docs/build/html

# # Set up for Comment PR
# - name: Checkout
# uses: actions/checkout@v3

# # Comment on PR
# - name: Comment PR
# uses: thollander/actions-comment-pull-request@v1
# with:
# message: |
# Rates -
# ${{steps.rates.outputs.stdout}}
# github_token: ${{ secrets.GITHUB_TOKEN }}


small_build_test:
name: Small Build Test
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -211,13 +160,7 @@ jobs:
name: Anaconda Build
needs: [full_build_test, small_build_test]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os:
- ubuntu-20.04
src:
- conda-recipe
runs-on: ${{ matrix.os }}
runs-on: ubuntu-20.04
steps:

# This step checks out a copy of your repository.
Expand All @@ -230,8 +173,6 @@ jobs:
python-version: 3.8

- name: Setup anaconda
env:
OS_NAME: ${{ matrix.os }}
run: |
cd ${HOME}
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
Expand All @@ -250,24 +191,21 @@ jobs:
id: get_image_info
env:
CONDA_UPLOAD_TOKEN_TAG: ${{ secrets.CONDA_UPLOAD_TOKEN_TAG }}
OS_NAME: ${{ matrix.os }}
run: |
echo ::set-output name=token::$CONDA_UPLOAD_TOKEN_TAG
echo ::set-output name=os::linux-64
- name: Build
env:
CONDA_SRC: ${{ matrix.src }}
run: |
export PATH="${HOME}/miniconda/bin:$PATH"
source ${HOME}/miniconda/etc/profile.d/conda.sh
conda build $CONDA_SRC --output-folder bld-dir -c tidair-packages -c conda-forge
conda build conda-recipe --output-folder bld-dir -c conda-forge
- name: Upload
run: |
export PATH="${HOME}/miniconda/bin:$PATH"
source ${HOME}/miniconda/etc/profile.d/conda.sh
anaconda -t ${{ steps.get_image_info.outputs.token }} upload --force bld-dir/${{ steps.get_image_info.outputs.os }}/*.tar.bz2
anaconda -t ${{ steps.get_image_info.outputs.token }} upload --force bld-dir/*/*.tar.bz2
docker_build:
name: Docker Build
Expand All @@ -286,7 +224,6 @@ jobs:
run: |
echo ::set-output name=tag::`git describe --tags`
echo ::set-output name=branch::`echo ${GITHUB_REF} | awk 'BEGIN { FS = "/" } ; { print $3 }'`
echo ::set-output name=name::"rogue"
# Setup docker build environment
- name: Set up Docker Buildx
Expand All @@ -306,6 +243,6 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: tidair/${{ steps.get_image_info.outputs.name }}:${{ steps.get_image_info.outputs.tag }}
tags: tidair/rogue:${{ steps.get_image_info.outputs.tag }}, tidair/rogue:latest
build-args: branch=${{ steps.get_image_info.outputs.branch }}

75 changes: 0 additions & 75 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,63 +162,6 @@ if (NOT ZeroMQ_FOUND)

endif()


#####################################
# EPICS V3
#####################################
if((NOT NO_PYTHON) AND (DO_EPICS) AND DEFINED ENV{EPICS_BASE})
set(DO_EPICS_V3 1)
set(EPICS_BASE_DIR $ENV{EPICS_BASE})
if(DEFINED ENV{EPICS_HOST_ARCH})
set(EPICS_ARCH $ENV{EPICS_HOST_ARCH})
else()
execute_process(COMMAND ${EPICS_BASE_DIR}/startup/EpicsHostArch
OUTPUT_VARIABLE EPICS_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "\n$" "" EPICS_ARCH "${EPICS_ARCH}")
endif()

# PCAS is part of epics before version 4
if(EPICS_PCAS_ROOT)
set(EPICS_PCAS_DIR ${EPICS_PCAS_ROOT})
elseif(DEFINED ENV{EPICS_PCAS_ROOT})
set(EPICS_PCAS_DIR $ENV{EPICS_PCAS_ROOT})
else()
set(EPICS_PCAS_DIR $ENV{EPICS_BASE})
endif()

# See if we can find the pcas header, may not exist if epics 7 without pcas is installed
find_path(E3_TEST_INCLUDE_DIR NAMES casdef.h PATHS ${EPICS_PCAS_DIR}/include)
if (NOT E3_TEST_INCLUDE_DIR)
set(DO_EPICS_V3 0)
elseif(APPLE)

set(EPICS_INCLUDES ${EPICS_PCAS_DIR}/include
${EPICS_BASE_DIR}/include
${EPICS_BASE_DIR}/include/compiler/clang
${EPICS_BASE_DIR}/include/os/Darwin)

set(EPICS_LIBRARIES ${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libcas.dylib
${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libgdd.dylib
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libca.dylib
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libCom.dylib )
else()

set(EPICS_INCLUDES ${EPICS_PCAS_DIR}/include
${EPICS_BASE_DIR}/include
${EPICS_BASE_DIR}/include/compiler/gcc
${EPICS_BASE_DIR}/include/os/Linux)

set(EPICS_LIBRARIES ${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libcas.so
${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libgdd.so
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libca.so
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libCom.so )
endif()

else()
set(DO_EPICS_V3 0)
endif()


##########################################################
# Generate version with GIT If Not Passed As -DVERSION
##########################################################
Expand Down Expand Up @@ -434,14 +377,6 @@ if (${ROGUE_INSTALL} STREQUAL "conda")
${ROGUE_DIR}/etc/conda/deactivate.d/rogue.sh)")
endif()

# Conda activate and deactivate functions
if ((${ROGUE_INSTALL} STREQUAL "conda") AND DO_EPICS_V3)
install(CODE "execute_process(COMMAND scp ${PROJECT_SOURCE_DIR}/templates/activate-epics-rogue.sh
${ROGUE_DIR}/etc/conda/activate.d/epics-rogue.sh)")
install(CODE "execute_process(COMMAND scp ${PROJECT_SOURCE_DIR}/templates/deactivate-epics-rogue.sh
${ROGUE_DIR}/etc/conda/deactivate.d/epics-rogue.sh)")
endif()

# Python file install
if (NOT NO_PYTHON)

Expand Down Expand Up @@ -486,16 +421,6 @@ else()
message("-- Found numpy: ${Python3_NumPy_INCLUDE_DIRS}")
endif()

message("")

if (DO_EPICS_V3)
message("-- Found EPICS: ${EPICS_BASE_DIR}")
message("")
message("-- Found PCAS: ${EPICS_PCAS_DIR}")
else()
message("-- EPICS V3 not included!")
endif()

message("")
message("-- Found ZeroMq: ${ZeroMQ_INCLUDE_DIR}")
message("")
Expand Down
25 changes: 23 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
FROM tidair/rogue-base:v3.0.2
FROM ubuntu:22.10

# Install system tools
RUN apt-get update && apt-get install -y \
wget \
git \
cmake \
python3 \
python3-dev \
libboost-all-dev \
libbz2-dev \
python3-pip \
libzmq3-dev \
python3-pyqt5 \
python3-pyqt5.qtsvg \
libreadline6-dev \
&& rm -rf /var/lib/apt/lists/*

# PIP Packages
RUN pip3 install PyYAML parse click ipython pyzmq packaging matplotlib numpy p4p jsonpickle sqlalchemy pyserial
RUN pip3 install pydm>=1.18.0

# Install Rogue
ARG branch
Expand All @@ -7,8 +27,9 @@ RUN git clone https://github.com/slaclab/rogue.git -b $branch
WORKDIR rogue
RUN mkdir build
WORKDIR build
RUN cmake .. -DROGUE_INSTALL=system -DDO_EPICS=1
RUN cmake .. -DROGUE_INSTALL=system
RUN make -j4 install
RUN echo /usr/local/lib >> /etc/ld.so.conf.d/rogue_epics.conf
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
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ The following is how you install the latest released version of Rogue with anaco

```
$ conda create -n rogue_tag -c tidair-tag -c tidair-packages -c conda-forge rogue
$ conda create -n rogue_tag -c tidair-tag -c conda-forge rogue
```

The following is how you install the development version (pre-release) or Rogue with anaconda.
It is important to use the latest conda solver:

```
$ conda create -n rogue_pre -c tidair-dev -c tidair-packages -c conda-forge rogue
$ conda config --set channel_priority strict
$ conda install -n base conda-libmamba-solver
$ conda config --set solver libmamba
```

#hello?
See migration notes in the documentation before moving to Rogue Version 6.0 as there have been some key structural changes.
Loading

0 comments on commit b8cf8d8

Please sign in to comment.