Skip to content

Commit

Permalink
Merge branch 'main' into configfile_default
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Nov 15, 2024
2 parents abaa4cf + 84db894 commit 0fb045f
Show file tree
Hide file tree
Showing 162 changed files with 11,511 additions and 5,212 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.

9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@

version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "BrianJKoopman"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "BrianJKoopman"
14 changes: 7 additions & 7 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 All @@ -62,7 +62,7 @@ jobs:

steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
- '.github/dependabot.yml'

jobs:
test:
Expand All @@ -30,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 @@ -46,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 All @@ -61,7 +62,7 @@ jobs:

steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ on:
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
- '.github/dependabot.yml'
workflow_call:

jobs:
test:
name: pytest with coverage
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

Expand All @@ -27,7 +29,7 @@ jobs:
sudo apt-get install -y socat
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand All @@ -52,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
1 change: 1 addition & 0 deletions .github/workflows/skipped-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
- '.github/dependabot.yml'

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/skipped-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
- '.github/dependabot.yml'

jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
- '.github/dependabot.yml'

jobs:
build:
Expand All @@ -25,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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- 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: 6.1.0
rev: 7.1.1
hooks:
- id: flake8
11 changes: 6 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.2
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,15 @@ 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

# 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
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
Loading

0 comments on commit 0fb045f

Please sign in to comment.