Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ba4c706
Initial refactor
albireox May 9, 2026
48fb0e3
Add workflow_dispatch to actions
albireox May 9, 2026
3b01c96
Do not build the wrapper in debug mode
albireox May 9, 2026
08f3aae
Some fixes
albireox May 9, 2026
f4cc5af
Add docker workflow and update Dockerfile
albireox May 9, 2026
f5e3327
Build docker image on all pushes for now
albireox May 9, 2026
774328d
Run docker build after copying the Andor SDK to the runner
albireox May 9, 2026
827f4e8
Add && \
albireox May 9, 2026
b05c2ae
Try to fix the docker build
albireox May 9, 2026
e37e1b8
Add an ls for debugging
albireox May 9, 2026
0aa6632
Put curl command in its own step
albireox May 9, 2026
562c203
Move SDK copy to the docker job
albireox May 9, 2026
efae8c5
List SDK files
albireox May 9, 2026
15edbf2
Do not use checkout
albireox May 9, 2026
91d0617
Use current context
albireox May 9, 2026
c01762e
Add focus control API and router
albireox May 11, 2026
a33164f
Add timeout to focus API client
albireox May 11, 2026
7629147
Reduce extra delay
albireox May 11, 2026
445e3c6
Add /expose/abort endpoint
albireox May 11, 2026
218afe8
Add TESTEXP header keyword to FITS files created
albireox May 11, 2026
1529150
Add last exposure path
albireox May 11, 2026
a4293bc
Add /expose/last endpoint to return the path of the last exposure taken
albireox May 11, 2026
f5bae7e
Change config to be a dataclass
albireox May 11, 2026
8e1be6b
Also make EvoraState a dataclass
albireox May 11, 2026
b03bda7
Set filter in /expose if filter is provided
albireox May 11, 2026
4b6ad03
Add TCS info to headers and refactor tools into separate files
albireox May 11, 2026
3c3c0d5
Fix config
albireox May 30, 2026
8b56ae8
Multiple changes and improvements during testing
albireox May 30, 2026
d97ba60
Use hours for RA and steps for focus in FITS header
albireox May 30, 2026
d8ce04d
Add standalone-start script
albireox Jun 2, 2026
c3bf457
Add plate solving code and route
albireox Jun 2, 2026
508bb8b
Rename /focus to /focuser
albireox Jun 2, 2026
cdb0f8e
Explicitly name the status endpoints `/status`
albireox Jun 2, 2026
3bcc3d8
Add focus assist module with endpoints
albireox Jun 2, 2026
e0f69e2
Remove serialize()
albireox Jun 2, 2026
b61fad1
Fix import errors
albireox Jun 2, 2026
8dcebb5
Raise HTTP exception if weather station is not found
albireox Jun 2, 2026
61d1a88
Update uv.lock
albireox Jun 2, 2026
54c9c72
Explicitly set EVORA_SERVER_DEBUG=0 in standalone-start.sh
albireox Jun 2, 2026
4d406e4
Add READEME instructions
albireox Jun 2, 2026
4df5991
Delete settings.py
albireox Jun 2, 2026
8548198
Change user to uwmro for docker workflow
albireox Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .flake8

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Docker

on:
push:
paths-ignore:
- 'docs/**'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'

jobs:

docker:
name: Docker

runs-on: ubuntu-24.04

env:
USER: uwmro
APP: evora-server

steps:
- uses: actions/checkout@v6

- name: Download SDK zip file
run: |
curl -L -o andor.zip ${{ secrets.ANDOR_SDK_LINK }}

- name: Extract SDK
run: |
rm -Rf andor
unzip andor.zip -d andor_tmp
mv andor_tmp/andor ./
rm -Rf andor.zip andor_tmp

- name: List files
run: |
ls

- name: List Andor SDK files
run: |
ls andor

- name: Set docker tags
id: set-tags
run: |
if [[ $GITHUB_REF == refs/heads/main ]]
then
echo TAGS=$USER/$APP:latest >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/* ]]
then
BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's/[\/]/_/g')
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/pull/* ]]
then
BRANCH=${{ github.head_ref || github.ref_name }}
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
else
echo TAGS=$USER/$APP:${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
fi

- name: Show tags
run: echo ${{ steps.set-tags.outputs.TAGS }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
push: true
provenance: false
tags: ghcr.io/${{ steps.set-tags.outputs.TAGS }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint

on:
workflow_dispatch:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'

jobs:
lint:
name: Lint

runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Lint with ruff
run: |
uv tool install ruff
ruff check src/ tests/
ruff format --check src/ tests/
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
workflow_dispatch:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'

jobs:
test:
name: Test

runs-on: ubuntu-24.04

strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']

env:
EVORA_SERVER_DEBUG: '1'

steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
run: |
uv sync --no-dev --frozen

- name: Test with pytest
run: |
uv pip install pytest pytest-mock pytest-asyncio pytest-cov
uv run pytest
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,12 @@ node_modules
# Ignore data folder if debugging
data/
evora/debug.py

# Do not commit andor drivers
andor/

# Skip the deprecated code
deprecated/

.vscode/
.envrc
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Use a Python image without uv. We don't need uv in the final image
# so we'll mount it only for syncing.
FROM python:3.14-slim

# Use the system Python across both stages
ENV UV_PYTHON_DOWNLOADS=0

# Install the project into `/app`
WORKDIR /app

# Install libusb-1.0-0 for andor drivers
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y install libusb-1.0-0 libusb-1.0-0-dev build-essential

# Copy andor drivers
COPY andor /app/andor

# Install andor drivers
RUN cd /app/andor && bash install_andor

# Delete source drivers folder
RUN rm -rf /app/andor

# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1

# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy

# Then, add the rest of the project source code and install it
ADD ./pyproject.toml /app
ADD ./uv.lock /app
ADD ./setup.py /app
ADD ./src /app/src

RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
--mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev

# Remove build tools and clean up apt cache to save space
RUN apt-get purge -y --auto-remove build-essential libusb-1.0-0-dev && \
rm -rf /var/lib/apt/lists/*

# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"

ENV WORKERS=1
ENV PORT=80

# Reset the entrypoint, don't invoke `uv`
ENTRYPOINT []

CMD ["sh", "-c", "fastapi run src/evora_server/app.py --port $PORT --workers $WORKERS"]
Loading