Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
706fb36
push docker image with version tag also on branch qa
backmari Sep 4, 2024
749e772
Merge pull request #36 from neutrons/publish_qa_tag
backmari Sep 4, 2024
4c2f882
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Sep 16, 2024
13dfc69
Modify to retain user plots, purging beamline plots
Sep 17, 2024
a94a689
modify migrations
Sep 17, 2024
52f2aab
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2024
06eba04
fix pre-commit
Sep 17, 2024
704f0e8
Merge pull request #35 from neutrons/pre-commit-ci-update-config
Sep 17, 2024
e2b5025
add instruments enum, use that to differentiate
Sep 17, 2024
92b7073
change to 1/1/2100 for user data
Sep 18, 2024
0a14552
little cleanup
Sep 18, 2024
282783d
update clean()
Sep 18, 2024
d2db2a9
add enum test, i guess
Sep 18, 2024
6486145
update migration 0002
Sep 18, 2024
05f1dd5
revert change to 0003 and init migrations
Sep 18, 2024
dcfe5f0
Merge pull request #37 from neutrons/keep-user
Sep 18, 2024
70c7f32
Bump codecov/codecov-action from 4 to 5 (#40)
dependabot[bot] Jan 15, 2025
4ebbeee
[pre-commit.ci] pre-commit autoupdate (#39)
pre-commit-ci[bot] Jan 15, 2025
b1290d1
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Aug 4, 2025
84675ae
Merge pull request #41 from neutrons/pre-commit-ci-update-config
rosswhitfield Aug 5, 2025
64dcb58
Run readthedocs on pull requests
rosswhitfield Aug 5, 2025
16ecb9b
Move to pixi
rosswhitfield Aug 5, 2025
e06df7d
Fix test
rosswhitfield Aug 5, 2025
bd5be1f
Fix coverage combine
rosswhitfield Aug 5, 2025
abc458d
Update docs
rosswhitfield Aug 6, 2025
e44b503
Update docs build instructions
rosswhitfield Aug 6, 2025
c48055c
Merge pull request #42 from neutrons/pixi
rosswhitfield Aug 7, 2025
b5365ae
Remove invalid option
rosswhitfield Aug 8, 2025
4bb3314
Bump prefix-dev/setup-pixi from 0.8.10 to 0.8.14
dependabot[bot] Aug 11, 2025
0a78642
Merge pull request #43 from neutrons/dependabot/github_actions/prefix…
rosswhitfield Aug 11, 2025
4f3bbf2
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Aug 11, 2025
1177f13
Merge pull request #44 from neutrons/pre-commit-ci-update-config
backmari Aug 13, 2025
6f98e0c
Bump actions/checkout from 4 to 5
dependabot[bot] Aug 18, 2025
a766f88
Bump prefix-dev/setup-pixi from 0.8.14 to 0.9.0
dependabot[bot] Aug 18, 2025
e2ab5aa
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Aug 18, 2025
807d93a
Merge pull request #45 from neutrons/dependabot/github_actions/action…
backmari Aug 21, 2025
d81026c
Merge pull request #46 from neutrons/dependabot/github_actions/prefix…
backmari Aug 21, 2025
37e2a00
Merge pull request #47 from neutrons/pre-commit-ci-update-config
backmari Aug 21, 2025
4e7316a
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Aug 25, 2025
0a011df
Merge pull request #48 from neutrons/pre-commit-ci-update-config
backmari Aug 26, 2025
eb975c8
Bump prefix-dev/setup-pixi from 0.9.0 to 0.9.1
dependabot[bot] Sep 29, 2025
4d68898
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Oct 13, 2025
72bf931
Merge pull request #50 from neutrons/pre-commit-ci-update-config
backmari Oct 16, 2025
efdf308
Merge pull request #51 from neutrons/dependabot/github_actions/prefix…
backmari Oct 16, 2025
b920476
Bump prefix-dev/setup-pixi from 0.9.1 to 0.9.3
dependabot[bot] Nov 10, 2025
46a5769
Bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
b5c5031
Bump peter-evans/create-pull-request from 7 to 8
dependabot[bot] Dec 15, 2025
1239e7e
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Dec 22, 2025
cab03e4
Remove obselete option to publish json format
darshdinger Dec 23, 2025
ba8edb0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 23, 2025
d5e2d24
Merge pull request #53 from neutrons/pre-commit-ci-update-config
backmari Jan 8, 2026
da2adcf
Add test to verify session authentication persists across requests
darshdinger Jan 8, 2026
ebb5d25
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2026
aa231e8
Address code review nitpicks
darshdinger Jan 8, 2026
82fe195
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2026
c02fb92
Fix indentation error in conftest.py
darshdinger Jan 8, 2026
a4f14be
Merge pull request #57 from neutrons/ewm14160_remove_obsolete_option
darshdinger Jan 8, 2026
f9afcc6
Merge pull request #54 from neutrons/dependabot/github_actions/prefix…
backmari Jan 9, 2026
5c9141f
Merge pull request #55 from neutrons/dependabot/github_actions/action…
backmari Jan 9, 2026
f8ef900
Merge pull request #56 from neutrons/dependabot/github_actions/peter-…
backmari Jan 9, 2026
781de47
Merge pull request #59 from neutrons/release/v1.5.0rc3
darshdinger Jan 20, 2026
d145873
Fix: Use pixi run to execute versioningit in publish workflow
darshdinger Jan 28, 2026
c561616
Test check docker build
darshdinger Jan 28, 2026
bbfd5d8
Revert: Remove pull_request trigger
darshdinger Jan 28, 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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
23 changes: 6 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge,defaults
mamba-version: "*"
environment-file: environment.yml
cache-environment-key: ${{ runner.os }}-env-${{ hashFiles('**/environment.yml') }}
cache-downloads-key: ${{ runner.os }}-downloads-${{ hashFiles('**/environment.yml') }}
- name: Install requirements
run: |
# --quiet should turn off progress bars to make logs more readable
conda env create
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3

- name: Create tag version
id: tag
run: |
conda activate livedata
echo "tag=$(versioningit)" >> $GITHUB_OUTPUT
echo "tag=$(pixi run versioningit)" >> $GITHUB_OUTPUT

- name: Create latest tag version
id: latest_tag
Expand Down Expand Up @@ -87,8 +76,8 @@ jobs:
tags: ${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.latest_tag.outputs.latest_tag }}
push: true

- name: Push version tag only for main branch
if: github.ref == 'refs/heads/main'
- name: Push version tag for branches qa and main
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/qa'
uses: docker/build-push-action@v6
with:
context: .
Expand Down
32 changes: 10 additions & 22 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
jobs:
linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

env:
DATABASE_NAME: livedatadb
DATABASE_USER: livedatauser
Expand All @@ -27,17 +23,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Conda environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge,defaults
mamba-version: "*"
environment-file: environment.yml
cache-environment-key: ${{ runner.os }}-env-${{ hashFiles('**/environment.yml') }}
cache-downloads-key: ${{ runner.os }}-downloads-${{ hashFiles('**/environment.yml') }}
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3

- name: Start docker containers
run: |
Expand All @@ -48,7 +37,7 @@ jobs:
run: sleep 30

- name: Run unit tests
run: python -m pytest tests/
run: pixi run test

- name: Stop the coverage process
# Stopping the coverage process allows the code coverage to be written to disk
Expand All @@ -58,19 +47,18 @@ jobs:
run: docker cp live_data_server-django-1:/var/www/livedata/app /tmp/

- name: Combine and show code coverage
shell: bash -l {0}
run: |
cd /tmp/app
coverage combine
coverage xml
cp coverage.xml $OLDPWD
coverage report
pixi run coverage combine --data-file=/tmp/app/.coverage
cp /tmp/app/.coverage src
cd src
pixi run coverage xml
pixi run coverage report

- name: Bring down docker containers completely now
# This will completely remove the containers
run: docker compose down

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/update-lockfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update lockfiles

permissions:
contents: write
pull-requests: write

on:
workflow_dispatch:
schedule:
- cron: 0 5 1 * *

jobs:
pixi-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
run-install: false
- name: Update lockfiles
run: |
set -o pipefail
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
- name: Create pull request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update pixi lockfile
title: Update pixi lockfile
body-path: diff.md
branch: update-pixi
base: next # change this to the default branch of your repository
labels: pixi
delete-branch: true
add-paths: pixi.lock
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ target/

# Ruff cache
.ruff_cache
# pixi environments
.pixi/*
!.pixi/config.toml
4 changes: 2 additions & 2 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.6.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=8192]
Expand All @@ -11,7 +11,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
rev: v0.14.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
17 changes: 12 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
version: 2

build:
os: ubuntu-22.04
os: "ubuntu-24.04"
tools:
python: "mambaforge-4.10"
python: "3.11"
jobs:
create_environment:
- asdf plugin add pixi
- asdf install pixi latest
- asdf global pixi latest
install:
- pixi install
build:
html:
- pixi run sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true

conda:
environment: environment.yml
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ Developer documentation at <https://livedata-ornl.readthedocs.io/en/latest/>

### Dependencies

- [Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) / [Mamba/Miniforge](https://github.com/conda-forge/miniforge)
- [Pixi](https://pixi.sh/latest/installation/)
- [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/)
- [direnv](https://direnv.net/) (optional)

### Setup for Local Development

1. Clone the repository and `cd` into the project directory.

1. Create a conda environment `livedata`, containing all the dependencies
1. Create a pixi environment `live_data_server`, containing all the dependencies

```python
conda env create -f environment.yml
conda activate livedata
pixi install
pixi shell
```

1. To deploy this application locally, you will need to set a number of environment variables,
Expand Down Expand Up @@ -69,8 +69,8 @@ Developer documentation at <https://livedata-ornl.readthedocs.io/en/latest/>
After the setup, with the server running, you can test your setup by running `pytest`:

```bash
pytest tests/test_post_get.py
# or simply
pixi run test
# or
pytest
```

Expand All @@ -95,7 +95,7 @@ Additional documentation is available in the `docs` directory. To build the docu
run the following command from within directory `docs/`:

```bash
make html
pixi run -e docs make html
```

The documentation will be built in the `docs/_build/html` directory. To view the documentation,
Expand Down
11 changes: 6 additions & 5 deletions deploy/django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM continuumio/miniconda3:23.10.0-1 AS base
FROM ghcr.io/prefix-dev/pixi:0.50.2-jammy AS base

### System dependencies and cron job setup
RUN apt-get update -y && \
# apt upgrade -y && \
apt-get install -y \
vim cron
vim cron wget

# Set up cron job to purge expired data once a month
COPY scripts/periodic-purge.sh /var/opt/
Expand All @@ -16,8 +16,9 @@ RUN echo "0 0 1 * * /var/opt/periodic-purge.sh >> /var/log/cron.log 2>&1" > /etc
### Environment setup
FROM base AS build

COPY environment.yml .
RUN conda env create
COPY pixi.lock .
COPY pyproject.toml .
RUN pixi install --locked -e deploy

WORKDIR /var/www/livedata
COPY src app
Expand All @@ -28,4 +29,4 @@ FROM build AS final

COPY deploy/django/docker-entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/docker-entrypoint.sh
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "livedata", "/usr/bin/docker-entrypoint.sh"]
ENTRYPOINT ["pixi", "run" , "-e", "deploy", "/usr/bin/docker-entrypoint.sh"]
8 changes: 4 additions & 4 deletions docs/developer/config_for_local_use.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ Prerequisites
-------------
- `Docker <https://docs.docker.com/get-docker/>`_
- `Docker Compose <https://docs.docker.com/compose/install/>`_
- `Conda <https://docs.conda.io/en/latest/miniconda.html>`_
- `Pixi <https://pixi.sh>`_

Setup
-----

Clone the repository and ``cd`` into the project directory.

Create a conda environment ``livedata``, containing all the dependencies
Create a pixi environment ``live_data_server``, containing all the dependencies

.. code-block:: python

conda env create -f environment.yml
conda activate livedata
pixi install
pixi shell

To deploy this application locally, you will need to set a number of environment variables,
for example (bash):
Expand Down
3 changes: 1 addition & 2 deletions docs/developer/updating_data_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ From within the Django app Docker container:

# or if you are not in the container
docker exec -i live_data_server-django-1 bash -ic '
conda activate livedata
cd app
python manage.py migrate
pixi run -e deploy python manage.py migrate
'

If the migration(s) are not correct, you can delete them and start again:
Expand Down
17 changes: 0 additions & 17 deletions environment.yml

This file was deleted.

Loading