Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
fe3c8e7
Adding fastapi server. Work in progress.
sfoale May 8, 2025
92ba6f6
Add test data and instrument endpoint tests.
sfoale May 12, 2025
4da60f9
Add pointing tests. Work in progress
sfoale May 13, 2025
08e90ad
Add candidate and gw_alert tests.
sfoale May 19, 2025
4fd6a0b
Add more tests.
sfoale May 27, 2025
260e930
More tests completed.
sfoale May 28, 2025
76d5abc
All tests complete.
sfoale Jun 5, 2025
93ba921
Complete test coverage of fastapi endpoints.
sfoale Jun 9, 2025
f94b067
Merge branch 'master' into fastapi
sfoale Jun 9, 2025
f7045c5
Missing test.
sfoale Jun 10, 2025
4d0c79d
Update README with better signposting for running and testing fastapi…
sfoale Jun 12, 2025
dde0893
Correct paths
sfoale Jun 12, 2025
7fa0df5
Initial steps for svelte front end. Work in progress.
sfoale Jun 17, 2025
a00851a
Update readme
sfoale Jun 17, 2025
8d28223
Adding visualisation. Work in progress.
sfoale Jul 3, 2025
82dee5e
Merge fastapi branch.
sfoale Jul 15, 2025
d428471
Add missing files
sfoale Jul 15, 2025
dc154b9
Default to unpaginated list for query_alerts.
sfoale Jul 21, 2025
d91a5ab
No authorisation required for alert query.
sfoale Jul 21, 2025
62df90a
Make visualization page more modular.
sfoale Jul 23, 2025
2072d6c
Add reporting instruments page.
sfoale Jul 24, 2025
d601521
Refactor extracting reusable ui components
sfoale Jul 24, 2025
f54cce6
Extend query alerts endpoint to the instrument id page.
sfoale Jul 24, 2025
46cc1c8
Adding footprint visualization to the instrument page.
sfoale Jul 24, 2025
614a74b
Refactoring to extract common functionality.
sfoale Jul 25, 2025
f44e754
Refactor: extarct astro calculations.
sfoale Jul 28, 2025
287a356
Refactor: add data loader service.
sfoale Jul 28, 2025
369c77e
Refactor: extract AlertTypeManager.
sfoale Jul 28, 2025
fe6af1e
Refactoring: add VisualizationDataManager
sfoale Jul 28, 2025
86d8c90
Refactoring to extract reusable components.
sfoale Jul 30, 2025
087a5a1
Added functionality for pointings page.
sfoale Aug 5, 2025
4c289e3
Get front page image carousel working.
sfoale Aug 5, 2025
1c09ced
Fix visualization centering.
sfoale Aug 5, 2025
ad44d27
Fix time slider on visualisation page.
sfoale Aug 6, 2025
ae719aa
Add instruments query page
sfoale Aug 6, 2025
ae50664
Refactor alerts page using service components
sfoale Aug 6, 2025
83ee64d
Refactored alerts select page extracting components.
sfoale Aug 7, 2025
3de7ab1
Fix alert page event explorer summary tab.
sfoale Aug 7, 2025
8e306b7
Fix linting issues and formatting.
sfoale Aug 7, 2025
094f688
Fix unused variables, missing keys errors etc.
sfoale Aug 7, 2025
c233a60
Fix form validation and empty object types
sfoale Aug 7, 2025
9303769
Implement JWT authentication and update frontend.
sfoale Aug 8, 2025
f0ece49
Refactor the frontend API client and pointing submission service.
sfoale Aug 8, 2025
9238718
FastAPI server formatting.
sfoale Aug 8, 2025
cb10703
Add routes for front end to be able to access enum values from the se…
sfoale Aug 8, 2025
ec465d0
Add instrument creation page.
sfoale Aug 11, 2025
d9d0849
Improve TypeScript types and fix critical frontend issues.
sfoale Aug 12, 2025
084c9c7
Fix login
sfoale Aug 12, 2025
6147de9
Fix ordering of tabs above sky visualisation.
sfoale Aug 18, 2025
e2f9b4d
Fix tests
sfoale Aug 19, 2025
41a2f58
Build on svelte branch
sfoale Aug 20, 2025
f51dbbf
Add github action to build docker images.
sfoale Aug 21, 2025
cbe44e1
Build on svelte branch.
sfoale Aug 21, 2025
ae52264
Improve docker build github actions.
sfoale Aug 21, 2025
2d594bc
Fix svelte docker build.
sfoale Aug 21, 2025
9d32999
Fix frontend docker build.
sfoale Aug 21, 2025
0d63223
Attempt to fix svelte front end docker build.
sfoale Aug 21, 2025
94726f2
Fix tests via github actions.
sfoale Aug 22, 2025
efb8a1f
Debug test failures.
sfoale Aug 22, 2025
934c852
Another attemot at fixing tests in github actions.
sfoale Aug 22, 2025
204f088
Fix verification logic.
sfoale Aug 22, 2025
80228a3
Initial testing framework and business logic tests for svelte front end.
sfoale Sep 5, 2025
f72e830
Add missing module
sfoale Sep 5, 2025
3a2dc1a
Add github action for frontend tests.
sfoale Sep 5, 2025
898e4ed
Fix front end tests.
sfoale Sep 5, 2025
9160aa9
Fix front end tests.
sfoale Sep 5, 2025
7866cb8
Fix front end tests.
sfoale Sep 5, 2025
eac4411
Fix front end tests.
sfoale Sep 5, 2025
3eb60db
Add missing file
sfoale Sep 5, 2025
aa755c2
Add missing directory
sfoale Sep 5, 2025
0843b36
Ignore warnings.
sfoale Sep 5, 2025
ef3c7b1
Added 'json-summary' to the Vitest coverage reporters in vitest.confi…
sfoale Sep 5, 2025
fea222f
Add comments in svelte tests.
sfoale Sep 8, 2025
57b75c1
Fix svelte lint warnings.
sfoale Sep 9, 2025
440005d
Fix svelte lint warnings.
sfoale Sep 9, 2025
59643d1
Fix type check errors.
sfoale Sep 9, 2025
0dbd7b7
Fix linting errors.
sfoale Sep 9, 2025
264312b
Add missing frontend API config file and fix .gitignore
sfoale Sep 11, 2025
2ddd668
Allow all hosts in development.
sfoale Sep 11, 2025
14e1b30
Allow all hosts in dev mode.
sfoale Sep 11, 2025
973d411
Add an argocd specific values file for deployment.
sfoale Oct 3, 2025
0c21762
Correct paths for github actions built docker artefacts.
sfoale Oct 3, 2025
277a0d2
Correct repository details to github actions built images.
sfoale Oct 7, 2025
3694cdf
Correct repository details to github actions built images.
sfoale Oct 7, 2025
ace38e5
Allow the front end to find the back end when deployed.
sfoale Oct 7, 2025
b884162
Make hard coded values configurable.
sfoale Oct 8, 2025
b1137fd
Use relative path.
sfoale Oct 8, 2025
5c496e6
Fix public api base
sfoale Oct 8, 2025
27f8753
Fix back end public api base
sfoale Oct 8, 2025
1eabf75
Replace hard coded localhost references.
sfoale Oct 8, 2025
830358b
Add ingress prefix rule to route all /ajax_* endpoints to FastAPI bac…
sfoale Oct 8, 2025
77d7ac3
Make the db volume persistent for the dev deployment
sfoale Oct 8, 2025
14a921a
Fix linting error.
sfoale Oct 14, 2025
4b319dc
Add helm charts for ligo and icecube listeners
sfoale Oct 17, 2025
bb73787
Add support for openstack swift alongside s3 and azure.
sfoale Oct 30, 2025
88fa376
Optionally read contours from swift storage.
sfoale Nov 5, 2025
aead366
Remove unused redis instance and update helm and docs.
sfoale Nov 6, 2025
608de5f
Fix unit tests.
sfoale Nov 6, 2025
ead0382
Set a restrict key for db dump and restore.
sfoale Nov 11, 2025
9e16943
Strip restrict lines from database dump before restoring
sfoale Nov 12, 2025
4bc6037
Add openstack swift storage credentials secrets file description.
sfoale Nov 12, 2025
ca283f9
Ignore case of user group when testing for admin
sfoale Nov 12, 2025
b888afd
Add values-listeners.yaml for listeners deployment
sfoale Nov 14, 2025
49ac229
Add global.existingSecret parameter for environment-specific sealed s…
sfoale Nov 20, 2025
e157fdb
Change default ingress class from nginx to traefik for K3s compatibility
sfoale Nov 21, 2025
f9de298
Add values-listeners-prod.yaml for deploying listeners.
sfoale Nov 21, 2025
9a6e2eb
Add enabled conditionals to all component templates to support listen…
sfoale Nov 21, 2025
a327586
Use latest tag for gwtm_cron listener images
sfoale Nov 21, 2025
2ba852d
Use dockerise tag for now. This is the branch in development.
sfoale Nov 21, 2025
649431d
Fix postgres init-scripts and pvc to respect database.enabled flag
sfoale Nov 21, 2025
e2aa4e1
Fix listener liveness probes to use ps instead of pgrep
sfoale Nov 21, 2025
61e8900
Remove liveness probes from listeners - container lacks required util…
sfoale Nov 21, 2025
ba57c5f
Add enabled: true defaults for all components so they deploy by default
sfoale Nov 21, 2025
38c57cf
Increase postgres memory limits for large database restore
sfoale Nov 25, 2025
5fa6cce
Configure Flask backend to use Azure storage, FastAPI uses Swift
sfoale Nov 26, 2025
4ce359d
Add adlfs package for Azure Blob Storage support in Flask backend
sfoale Nov 28, 2025
947f5ec
Set imagePullPolicy to Always for all components.
sfoale Nov 28, 2025
a33c9b3
Fix sun & moon positions in svelte front end.
sfoale Nov 28, 2025
76f01eb
Configure LoadBalancer services for cloud deployments while preservin…
sfoale Dec 2, 2025
625b337
Use IfNotPresent image policy for local deployments.
sfoale Dec 3, 2025
1d5d497
Add development workflow how to.
sfoale Dec 5, 2025
732348c
Add createSecret flag to disable Helm-generated listener secrets.
sfoale Dec 8, 2025
e87d523
Set imagePullPolicy to Always for listener images to Always to pull l…
sfoale Dec 8, 2025
b5483ef
Refactor listener API config to separate host/port/path fields.
sfoale Dec 9, 2025
a593e0b
Configure ingress for IP-based access and use port 80 for listeners.
sfoale Dec 9, 2025
2b1a1ab
Fix ingress template YAML indentation for catch-all routing.
sfoale Dec 9, 2025
fc5c2de
Add GitOps-managed ArgoCD configuration
sfoale Dec 9, 2025
36b77d5
Add instructions for adding a values-secrets.yaml to provide storage …
sfoale Dec 17, 2025
a03d85b
Update frontend README
sfoale Jan 22, 2026
a7ff18e
Prettier README to pass linting.
sfoale Jan 22, 2026
d7aad4a
Add template file for values-secrets.yaml.
sfoale Jan 22, 2026
3f807ef
Bump version of Aladin Lite to use latest 3.7.0-beta.
sfoale Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ static/*.fits.gz
venv/
.git/
viz-example/
tests/
__pycache__/
*.pyc
*.pyo
*.pyd
.pytest_cache/
.coverage
.idea/
.vscode/
*.egg-info/
173 changes: 173 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Build and Push All Images

on:
push:
tags:
- 'v*'
branches:
- svelte # Temporary for testing
workflow_dispatch:
inputs:
version:
description: 'Version to tag images (e.g., 1.0.0)'
required: true
type: string

env:
REGISTRY: ghcr.io

jobs:
build-flask:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image: ${{ steps.meta.outputs.tags }}
digest: ${{ steps.build.outputs.digest }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/flask-app
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=${{ github.event.inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}

- name: Build and push Docker image
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=flask
cache-to: type=gha,mode=max,scope=flask
platforms: linux/amd64,linux/arm64

build-fastapi:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image: ${{ steps.meta.outputs.tags }}
digest: ${{ steps.build.outputs.digest }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/fastapi-backend
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=${{ github.event.inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}

- name: Build and push Docker image
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ./server/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=fastapi
cache-to: type=gha,mode=max,scope=fastapi
platforms: linux/amd64,linux/arm64

build-frontend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image: ${{ steps.meta.outputs.tags }}
digest: ${{ steps.build.outputs.digest }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/svelte-frontend
tags: |
type=match,pattern=v(.*),group=1
type=raw,value=${{ github.event.inputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }}
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}

- name: Build and push Docker image
id: build
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=frontend
cache-to: type=gha,mode=max,scope=frontend
platforms: linux/amd64,linux/arm64

summary:
runs-on: ubuntu-latest
needs: [build-flask, build-fastapi, build-frontend]
if: always()

steps:
- name: Print build summary
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "| Component | Status | Image |" >> $GITHUB_STEP_SUMMARY
echo "|-----------|---------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Flask App | ${{ needs.build-flask.result }} | \`${{ needs.build-flask.outputs.image }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| FastAPI Backend | ${{ needs.build-fastapi.result }} | \`${{ needs.build-fastapi.outputs.image }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Svelte Frontend | ${{ needs.build-frontend.result }} | \`${{ needs.build-frontend.outputs.image }}\` |" >> $GITHUB_STEP_SUMMARY
112 changes: 112 additions & 0 deletions .github/workflows/fastapi-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: FastAPI Tests

on:
push:
branches: [ master, fastapi, svelte ]
pull_request:
branches: [ master, fastapi, svelte ]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30

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

- name: Set up Python for test dependencies
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt

- name: Set up environment variables
run: |
echo "DB_USER=treasuremap" >> $GITHUB_ENV
echo "DB_PWD=treasuremap" >> $GITHUB_ENV
echo "DB_NAME=treasuremap" >> $GITHUB_ENV
echo "MAIL_PASSWORD=dummy" >> $GITHUB_ENV
echo "RECAPTCHA_PUBLIC_KEY=dummy" >> $GITHUB_ENV
echo "RECAPTCHA_PRIVATE_KEY=dummy" >> $GITHUB_ENV
echo "ZENODO_ACCESS_KEY=dummy" >> $GITHUB_ENV
echo "AWS_ACCESS_KEY_ID=dummy" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=dummy" >> $GITHUB_ENV

- name: Build FastAPI Docker image
run: |
docker build -f server/Dockerfile -t gwtm_fastapi:latest .

- name: Start database with Docker Compose
run: |
DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm up -d db

- name: Wait for database to be ready
run: |
timeout 120 bash -c 'until DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm exec -T db pg_isready -U treasuremap -d treasuremap; do sleep 5; done'

- name: Enable PostGIS extension
run: |
DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm exec -T db psql -U treasuremap -d treasuremap -c "CREATE EXTENSION IF NOT EXISTS postgis;"

- name: Initialize database schema with FastAPI models
run: |
docker run --rm --network gwtm_default \
-e DB_USER=treasuremap \
-e DB_PWD=treasuremap \
-e DB_NAME=treasuremap \
-e DB_HOST=db \
-e DB_PORT=5432 \
gwtm_fastapi:latest \
python -c "from server.db.init_db import create_database_tables; create_database_tables()"

- name: Start FastAPI server
run: |
docker run -d --name fastapi-server \
--network gwtm_default \
-e DB_USER=treasuremap \
-e DB_PWD=treasuremap \
-e DB_NAME=treasuremap \
-e DB_HOST=db \
-e DB_PORT=5432 \
-p 8000:8000 \
gwtm_fastapi:latest

- name: Wait for FastAPI server to be ready
run: |
timeout 120 bash -c 'until curl -f http://localhost:8000/health; do echo "Waiting for FastAPI..."; sleep 5; done'

- name: Load test data
run: |
DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm exec -T db psql -U treasuremap -d treasuremap < tests/test-data.sql

- name: Verify test data loaded
run: |
echo "Checking if test users exist in database..."
DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm exec -T db psql -U treasuremap -d treasuremap -c "SELECT COUNT(*) FROM users;" || echo "Users table query failed"
echo "Checking if test tokens exist..."
DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm exec -T db psql -U treasuremap -d treasuremap -c "SELECT username, api_token FROM users LIMIT 3;" || echo "API token query failed"

- name: Test API authentication
run: |
echo "Testing API authentication with test token..."
curl -f -H "api_token: test_token_admin_001" http://localhost:8000/api/v1/pointings | head -5 || echo "API auth test failed"
echo "Testing health endpoint..."
curl -f http://localhost:8000/health || echo "Health check failed"

- name: Run FastAPI tests
run: |
python -m pytest tests/fastapi/ -v --disable-warnings
env:
API_BASE_URL: http://localhost:8000

- name: Cleanup
if: always()
run: |
docker stop fastapi-server || true
docker rm fastapi-server || true
DB_USER=treasuremap DB_PWD=treasuremap DB_NAME=treasuremap docker compose -p gwtm down -v
55 changes: 55 additions & 0 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Frontend Tests

on:
push:
branches: [ master, main, svelte, fastapi ]
paths:
- 'frontend/**'
- '.github/workflows/frontend-tests.yml'
pull_request:
branches: [ master, main, svelte, fastapi ]
paths:
- 'frontend/**'
- '.github/workflows/frontend-tests.yml'

jobs:
test:
name: Run Frontend Tests
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./frontend

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'

- name: Install dependencies
run: npm ci

- name: Run type checking
run: npm run check

- name: Run linting
run: npm run lint

- name: Run tests
run: npm run test:run

- name: Generate coverage report
run: npm run test:coverage

- name: Comment PR with coverage
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: frontend/coverage/coverage-summary.json
21 changes: 19 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,27 @@ __pycache__
#config
#-

config
# Backend config files (not frontend config)
src/config
server/config
scratch/
environment_variables.sh
envars.sh
test
*.DS_Store
deploy/
deploy/
*venv/

# Frontend build artifacts and dependencies
frontend/node_modules/
frontend/build/
frontend/.svelte-kit/
frontend/dist/
frontend/.env

# Editor directories
.vscode/
.idea/

# Helm secrets - contains sensitive credentials
gwtm-helm/values-secrets.yaml
Loading
Loading