Skip to content

Commit

Permalink
Merge branch 'main' into ld_monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Jan 6, 2025
2 parents a278a1a + 3d8f152 commit 2ba85ae
Show file tree
Hide file tree
Showing 149 changed files with 6,464 additions and 4,582 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude =
socs/mibs/MBG-SNMP-ROOT-MIB.py,
socs/mibs/IBOOTPDU-MIB.py,
socs/mibs/UPS-MIB.py,
versioneer.py,
socs/mibs/MBG-SYNCBOX-N2X-MIB.py,
docs/conf.py,
per-file-ignores =
# Windows only dependency
Expand Down
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# Dockerize
- name: Build docker images
run: |
docker-compose build
docker compose build
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -44,13 +44,13 @@ jobs:
export DOCKER_TAG=`git describe --tags --always`
# Tag all images for upload to the registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:latest
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:latest
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
# Upload to docker registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:latest
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} echo ${DOCKERHUB_ORG}/{}:${DOCKER_TAG} pushed
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:latest
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} echo ${DOCKERHUB_ORG}/{}:${DOCKER_TAG} pushed
wheel:
name: build and deploy to PyPI
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# Dockerize
- name: Build docker images
run: |
docker-compose build
docker compose build
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -47,11 +47,11 @@ jobs:
echo "${DOCKER_TAG}"
# Tag all images for upload to the registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
# Upload to docker registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} echo ${DOCKERHUB_ORG}/{}:${DOCKER_TAG} pushed
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} echo ${DOCKERHUB_ORG}/{}:${DOCKER_TAG} pushed
# testing so we can catch any issues before release
# if issues are found, test locally, or copy to pytest.yml for test on push
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
test:
name: pytest with coverage
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
- name: Build docker test images
run: |
docker-compose build socs
docker compose build socs
# Integration Tests
- name: Run integration tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
# Dockerize
- name: Build docker images
run: |
docker-compose build
docker compose build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# dynamic package version
socs/_version.py

# iPython Notebooks
*.ipynb

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-yaml
Expand All @@ -12,10 +12,10 @@ repos:
- id: isort
name: isort (python)
- repo: https://github.com/hhatto/autopep8
rev: v2.0.4
rev: v2.3.1
hooks:
- id: autopep8
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# A container setup with an installation of socs.

# Use the ocs image as a base
FROM simonsobs/ocs:v0.10.4
FROM simonsobs/ocs:v0.11.3-3-g63fd5ef

# Set up the cryo/smurf user and group so this can run on smurf-servers
# See link for how all other smurf-containers are set up:
Expand All @@ -16,10 +16,9 @@ RUN useradd -d /home/cryo -M cryo -u 1000 && \

# Install packages
# suprsync agent - rsync
# labjack agent - wget, python3-pip, libusb-1.0-0-dev, udev
# labjack agent - wget, libusb-1.0-0-dev, udev
RUN apt-get update && apt-get install -y rsync \
wget \
python3-pip \
libusb-1.0-0-dev \
udev

Expand All @@ -35,13 +34,17 @@ RUN ./labjack_ljm_software_2020_03_30_x86_64/labjack_ljm_installer.run -- --no-r
COPY requirements/ /app/socs/requirements
COPY requirements.txt /app/socs/requirements.txt
WORKDIR /app/socs/
RUN pip3 install -r requirements.txt
# Work around https://github.com/pypa/setuptools/issues/4483/ temporarily
RUN python -m pip install -U "setuptools<71.0.0"
RUN python -m pip install -r requirements.txt
RUN python -m pip uninstall -y opencv-python && \
python -m pip install opencv-python-headless

# Copy the current directory contents into the container at /app
COPY . /app/socs/

# Install socs
RUN pip3 install .
RUN python -m pip install .

# Reset workdir to avoid local imports
WORKDIR /
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

53 changes: 32 additions & 21 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,8 @@
SOCS - Simons Observatory Control System
========================================

.. image:: https://img.shields.io/github/actions/workflow/status/simonsobs/socs/develop.yml?branch=main
:target: https://github.com/simonsobs/socs/actions?query=workflow%3A%22Build+Test+Images%22
:alt: GitHub Workflow Status

.. image:: https://readthedocs.org/projects/socs/badge/?version=main
:target: https://socs.readthedocs.io/en/main/?badge=main
:alt: Documentation Status

.. image:: https://coveralls.io/repos/github/simonsobs/socs/badge.svg
:target: https://coveralls.io/github/simonsobs/socs

.. image:: https://img.shields.io/badge/dockerhub-latest-blue
:target: https://hub.docker.com/r/simonsobs/socs

.. image:: https://img.shields.io/pypi/v/socs
:target: https://pypi.org/project/socs/
:alt: PyPI Package

.. image:: https://results.pre-commit.ci/badge/github/simonsobs/socs/main.svg
:target: https://results.pre-commit.ci/latest/github/simonsobs/socs/main
:alt: pre-commit.ci status
| |pypi| |versions| |docker| |license|
| |tests| |pre-commit| |coverage| |docs|
Overview
--------
Expand Down Expand Up @@ -142,3 +123,33 @@ This project is licensed under the BSD 2-Clause License - see the
`LICENSE.txt`_ file for details.

.. _LICENSE.txt: https://github.com/simonsobs/socs/blob/main/LICENSE.txt


.. |coverage| image:: https://coveralls.io/repos/github/simonsobs/socs/badge.svg
:target: https://coveralls.io/github/simonsobs/socs

.. |docker| image:: https://img.shields.io/badge/dockerhub-latest-blue
:target: https://hub.docker.com/r/simonsobs/socs

.. |docs| image:: https://readthedocs.org/projects/socs/badge/?version=main
:target: https://socs.readthedocs.io/en/main/?badge=main
:alt: Documentation Status

.. |license| image:: https://img.shields.io/pypi/l/socs
:target: LICENSE.txt
:alt: PyPI - License

.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/simonsobs/socs/main.svg
:target: https://results.pre-commit.ci/latest/github/simonsobs/socs/main
:alt: pre-commit.ci status

.. |pypi| image:: https://img.shields.io/pypi/v/socs
:target: https://pypi.org/project/socs/
:alt: PyPI Package

.. |tests| image:: https://github.com/simonsobs/socs/actions/workflows/develop.yml/badge.svg?branch=main
:target: https://github.com/simonsobs/socs/actions/workflows/develop.yml
:alt: GitHub Workflow Status

.. |versions| image:: https://img.shields.io/pypi/pyversions/socs
:alt: PyPI - Python Version
2 changes: 1 addition & 1 deletion docker/pysmurf_controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM simonsobs/sodetlib:v0.5.2-3-ge0aa529
FROM simonsobs/sodetlib:v0.5.2-20-gdd529b5

ENV OCS_CONFIG_DIR /config

Expand Down
25 changes: 15 additions & 10 deletions docker/wiregrid_actuator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,28 @@ FROM socs:latest

WORKDIR /home/ocs/

# This line is to avoid warnings during the build.
ENV DEBIAN_FRONTEND="noninteractive"

# Galil installation information:
# -https://www.galil.com/sw/pub/all/doc/global/install/linux/ubuntu/
# -https://www.galil.com/sw/pub/all/doc/gclib/html/python.html
RUN apt-get update \
&& apt-get install -y apt-utils \
&& apt-get install -y wget libavahi-common-dev libavahi-client-dev libavahi-core-dev libcap-dev libdaemon-dev avahi-daemon \
&& wget http://www.galil.com/sw/pub/all/crypto/GALIL-GPG-KEY-E29D0E4B.asc \
&& apt-key add GALIL-GPG-KEY-E29D0E4B.asc \
&& wget http://www.galil.com/sw/pub/ubuntu/20.04/galil.list \
&& cp galil.list /etc/apt/sources.list.d \
&& wget https://www.galil.com/sw/pub/apt/all/galil-release_1_all.deb \
&& apt-get install -y ./galil-release_1_all.deb \
&& rm ./galil-release_1_all.deb \
&& apt-get update \
&& apt-get install -y --download-only gclib \
&& dpkg -x $(find / -name "gclib*.deb") / \
&& apt-get install -y gclib \
&& apt install -y gclib \
&& apt-get install -y --download-only gcapsd \
&& dpkg -x $(find / -name "gcapsd*.deb") /tmp/gcapsd/ \
&& mv /tmp/gcapsd/usr/sbin/gcapsd /usr/sbin/ \
&& mv -v /tmp/gcapsd/usr/sbin/gcapsd /usr/sbin/ \
&& rm -r /tmp/gcapsd/ \
&& tar -xvf /usr/share/doc/gclib/src/gclib_python.tar.gz \
&& python3 setup.py install
&& cp /usr/share/gclib/src/wrappers/python/* . \
&& cp /usr/share/gclib/doc/examples/python/* . \
&& python3 -m pip install . \
&& python3 -c "import gclib; print(f'gclib location: {gclib.__file__}')"

COPY . .

Expand Down
1 change: 1 addition & 0 deletions docs/agents/acu_agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ example configuration block is below::
'upper': 360.,
},
'acc': (8./1.88),
'axes_sequential': False,
},
}

Expand Down
4 changes: 2 additions & 2 deletions docs/agents/bluefors_agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ An example configuration for your ocs config file::
Docker Compose
``````````````

Example docker-compose configuration::
Example docker compose configuration::

ocs-bluefors:
image: simonsobs/socs:latest
Expand Down Expand Up @@ -145,7 +145,7 @@ tools, i.e. Docker for Windows, if possible) is:
- Run docker terminal (this performs some Virtualbox setup)
- Run docker login
- Clone the ocs-site-configs repo and create a directory for your machine
- Configure ocs/docker-compose files
- Configure ocs/docker compose files
- Make sure your system clock is set to UTC
- Bring up the container(s)

Expand Down
3 changes: 2 additions & 1 deletion docs/agents/cryomech_cpa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Docker Compose
``````````````

The Cryomech CPA Agent should be configured to run in a Docker container.
An example docker-compose service configuration is shown here::
An example docker compose service configuration is shown here::

ocs-ptc1:
image: simonsobs/socs:latest
Expand Down Expand Up @@ -91,3 +91,4 @@ Supporting APIs

.. autoclass:: socs.agents.cryomech_cpa.agent.PTC
:members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/agents/generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Docker Compose
``````````````

The Generator Agent should be configured to run in a Docker container. An
example docker-compose service configuration is shown here::
example docker compose service configuration is shown here::

ocs-generator:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/hi6200.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Docker Compose
``````````````

The SCPI PSU Agent should be configured to run in a Docker container.
An example docker-compose service configuration is shown here::
An example docker compose service configuration is shown here::

ocs-hi6200:
image: simonsobs/socs:latest
Expand Down
Loading

0 comments on commit 2ba85ae

Please sign in to comment.