Skip to content

Commit

Permalink
Merge branch 'main' into http-camera-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvng committed Aug 16, 2024
2 parents 94e9641 + d8b902e commit f677be9
Show file tree
Hide file tree
Showing 69 changed files with 928 additions and 165 deletions.
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
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ repos:
- id: isort
name: isort (python)
- repo: https://github.com/hhatto/autopep8
rev: v2.2.0
rev: v2.3.1
hooks:
- id: autopep8
- repo: https://github.com/pycqa/flake8
rev: 7.0.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.11.0
FROM simonsobs/ocs:v0.11.1-1-gb6cbd88

# 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
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
2 changes: 1 addition & 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
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
2 changes: 1 addition & 1 deletion docs/agents/hwp_encoder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Docker Compose
``````````````

The CHWP BBB agent can be run via a Docker container. The following is an
example of what to insert into your institution's docker-compose file.
example of what to insert into your institution's docker compose file.
This again is an example to run multiple agents::

ocs-hwpbbb-agent-HBA0:
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/hwp_gripper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ An example site-config-file block::
Docker Compose
`````````````````````

An example docker-compose configuration::
An example docker compose configuration::

ocs-hwp-gripper:
image: simonsobs/socs:latest
Expand Down
3 changes: 1 addition & 2 deletions docs/agents/hwp_pcu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ configuration block that will automatically start data acquisition::

{'agent-class': 'HWPPCUAgent',
'instance-id': 'hwp-pcu',
'arguments': [['--port', '/dev/HWPPCU'],
['--mode', 'acq']]},
'arguments': ['--port', '/dev/HWPPCU']},

Each device requires configuration under 'agent-instances'. See the OCS site
configs documentation for more details.
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/hwp_picoscope.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Docker
yourself. A Dockerfile is provided in ``socs/docker/hwp_picoscope/``.

The HWP picoscope agent can be run via a Docker container. The following is an
example of what to insert into your institution's docker-compose file::
example of what to insert into your institution's docker compose file::

picoscope:
image: ocs-hwp-picoscope-agent:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/hwp_pid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ An example site-config-file block::
Docker Compose
``````````````

An example docker-compose configuration::
An example docker compose configuration::

ocs-hwp-pid:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/hwp_pmx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ An example site-config-file block::
Docker Compose
``````````````

An example docker-compose configuration::
An example docker compose configuration::

ocs-hwp-pmx:
image: simonsobs/socs:latest
Expand Down
11 changes: 11 additions & 0 deletions docs/agents/hwp_supervisor_agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ current action will be aborted at the next opportunity and replaced with the new
requested action. The ``abort_action`` task can be used to abort the current
action without beginning a new one.

ACU Safety Checks
```````````````````

If the ACU instance-id is provided in the site-config, the supervisor will check
the ACU state before spin-up or gripping procedures to ensure the telescope is
in a safe state to perform the specified operation.

Before spinning up the HWP, the agent will check that
- The current elevation and commanded elevation are in the range ``(acu-min-el, acu-max-el)``.
- The ACU state info has been updated within ``acu-max-time-since-update`` seconds.

Examples
```````````
Below is an example client script that runs the PID to freq operation, and waits
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/ibootbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Docker Compose
``````````````

The iBootbar 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-ibootbar:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/ifm_sbn246_flowmeter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Docker Compose
``````````````

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

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

The LabJack 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-labjack:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/lakeshore425.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you would like to chanege the setting or check the status of the lakeshore 42
Docker Compose
``````````````
The ocs-lakeshore425-agent can be run via a Docker container. The following is an
example of what to insert into your institution's docker-compose file.::
example of what to insert into your institution's docker compose file.::

ocs-lakeshore425-agent:
image: simonsobs/socs:latest
Expand Down
4 changes: 2 additions & 2 deletions docs/agents/magpie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ frame is received.
Configuration File Examples
------------------------------

Below are example docker-compose and ocs configuration files for running the
Below are example docker compose and ocs configuration files for running the
magpie agent.

OCS Site Config
Expand Down Expand Up @@ -67,7 +67,7 @@ fake data by adding the ``--fake-data`` argument.
Docker Compose
``````````````````

Below is an example docker-compose entry for running a magpie corresponding to
Below is an example docker compose entry for running a magpie corresponding to
crate-id 1 and slot 2. If crossbar is being run on a different server, you'll
have to modify the ``site-hub`` and ``site-http`` args accordingly::

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

The Meinberg M1000 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-m1000:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/meinberg_syncbox_agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Docker Compose
``````````````

The Meinberg Syncbox 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-timing-syncbox:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/pfeiffer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Docker Compose
``````````````

The Pfeiffer Agent can be run via a Docker container. The following is an
example of what to insest into your institution's docker-compose file. ::
example of what to insest into your institution's docker compose file. ::


ocs-pfeiffer:
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/pfeiffer_tc400.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ block using all of the available arguments::
Docker Compose
``````````````
The 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-pfeiffer-turboA:
image: simonsobs/socs:latest
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/pysmurf-controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mount in a development copy of SODETLIB so that we have the most recent version
without having to rebuild this container.


The docker-compose for the pysmurf-controller that publishes to a container
The docker compose for the pysmurf-controller that publishes to a container
named ``ocs-pysmurf-monitor`` might look something like::

ocs-pysmurf:
Expand Down
4 changes: 2 additions & 2 deletions docs/agents/pysmurf-monitor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Example site-config entry::

Docker Compose
````````````````
An example docker-compose entry might look like::
An example docker compose entry might look like::

ocs-pysmurf-monitor:
image: simonsobs/socs:latest
Expand All @@ -48,7 +48,7 @@ An example docker-compose entry might look like::
- /data:/data

Where SOCS_TAG and CB_HOST are set in the ``.env`` file in the same dir as the
docker-compose file.
docker compose file.

Description
-----------
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/scpi_psu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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-psuK:
image: simonsobs/socs:latest
Expand Down
4 changes: 2 additions & 2 deletions docs/agents/smurf_crate_monitor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ steps:
4. Copy ocs-user ssh key using 'ssh-copy-id'

You also need to add the ocs-base anchor and mount the home directory of
the ocs-user in your 'docker-compose' file, see below for an example.
the ocs-user in your 'docker compose' file, see below for an example.

The second argument, 'crate-id', is just an identifier for your feed names
to distinguish between identical sensors on different crates.
Expand All @@ -64,7 +64,7 @@ Docker Compose
``````````````

The SMuRF Crate 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-smurf-crate-monitor:
<<: *ocs-base
Expand Down
4 changes: 2 additions & 2 deletions docs/agents/smurf_timing_card.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ timing software.
Configuration File Examples
------------------------------
Below are configuration examples for the ocs config file and for the
docker-compose service.
docker compose service.

OCS Site Config
`````````````````
Expand All @@ -36,7 +36,7 @@ False by default.

Docker Compose
````````````````
Below is an example of the docker-compose service for the timing card agent::
Below is an example of the docker compose service for the timing card agent::

ocs-smurf-timing-card:
image: simonsobs/socs:latest
Expand Down
Loading

0 comments on commit f677be9

Please sign in to comment.