Skip to content

Commit a637fe2

Browse files
committed
Merge branch 'main' into antenna-tracking
2 parents 7591add + 7b0e2ea commit a637fe2

273 files changed

Lines changed: 31834 additions & 4620 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
installer/startup-data-loader/data/*.csv binary

.github/workflows/code-quality.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Code Quality Checks
2+
3+
on:
4+
push:
5+
branches: [ main, deploy ]
6+
pull_request:
7+
branches: [ main, deploy ]
8+
9+
jobs:
10+
lint-docker:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install Hadolint
17+
run: |
18+
sudo wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
19+
sudo chmod +x /usr/local/bin/hadolint
20+
21+
- name: Lint Dockerfiles
22+
run: |
23+
find . -name "Dockerfile" -exec hadolint {} \;
24+
25+
check-dependencies:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Check for security vulnerabilities in Python dependencies
32+
run: |
33+
find . -name "requirements.txt" -exec safety check --file {} \; || true
34+
35+
validate-shell-scripts:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Install ShellCheck
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y shellcheck
45+
46+
- name: Check shell scripts
47+
run: |
48+
find . -name "*.sh" -exec shellcheck {} \;

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy to Staging
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to deploy to'
8+
required: true
9+
default: 'staging'
10+
type: choice
11+
options:
12+
- staging
13+
- production
14+
15+
env:
16+
REGISTRY: ghcr.io
17+
IMAGE_NAME: ${{ github.repository }}
18+
19+
jobs:
20+
deploy:
21+
runs-on: ubuntu-latest
22+
environment: ${{ inputs.environment }}
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Deploy to ${{ inputs.environment }}
28+
run: |
29+
echo "Deploying to ${{ inputs.environment }} environment"
30+
# Add your deployment commands here
31+
# For example:
32+
# - SSH to your server
33+
# - Pull latest images
34+
# - Run docker compose up
35+
# - Run health checks

.github/workflows/docker-build.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Build and Test DAQ System
2+
3+
on:
4+
push:
5+
branches: [ deploy ]
6+
pull_request:
7+
branches: [ main, deploy ]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
validate-compose:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Prepare environment file for CI
21+
run: |
22+
if [ ! -f server/installer/.env ]; then
23+
cp server/installer/.env.example server/installer/.env
24+
echo "Created .env file from .env.example"
25+
fi
26+
27+
- name: Validate docker-compose files
28+
run: |
29+
cd server/installer
30+
docker compose config
31+
docker compose -f docker-compose.yml config
32+
33+
build-and-push:
34+
runs-on: ubuntu-latest
35+
needs: validate-compose
36+
permissions:
37+
contents: read
38+
packages: write
39+
40+
strategy:
41+
matrix:
42+
service: [slackbot, lap-detector, file-uploader]
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Convert repository name to lowercase
49+
run: |
50+
echo "IMAGE_NAME_LOWER=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
51+
52+
- name: Log in to Container Registry
53+
uses: docker/login-action@v3
54+
with:
55+
registry: ${{ env.REGISTRY }}
56+
username: ${{ github.actor }}
57+
password: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Extract metadata
60+
id: meta
61+
run: |
62+
echo "tags<<EOF" >> $GITHUB_OUTPUT
63+
echo "${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}/${{ matrix.service }}:latest" >> $GITHUB_OUTPUT
64+
echo "${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}/${{ matrix.service }}:${{ github.sha }}" >> $GITHUB_OUTPUT
65+
echo "EOF" >> $GITHUB_OUTPUT
66+
67+
- name: Build and push Docker image
68+
uses: docker/build-push-action@v5
69+
with:
70+
context: ./server/installer/${{ matrix.service }}
71+
push: true
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: |
74+
org.opencontainers.image.title=${{ github.event.repository.name }}
75+
org.opencontainers.image.description=WFR DAQ System - ${{ matrix.service }}
76+
org.opencontainers.image.url=${{ github.event.repository.html_url }}
77+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
78+
org.opencontainers.image.version=${{ github.sha }}
79+
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
80+
org.opencontainers.image.revision=${{ github.sha }}
81+
82+
test-compose:
83+
runs-on: ubuntu-latest
84+
needs: build-and-push
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v4
88+
89+
- name: Set up Docker Buildx
90+
uses: docker/setup-buildx-action@v3
91+
92+
- name: Create .env file for testing
93+
run: |
94+
cd server/installer
95+
cp .env.example .env
96+
mkdir -p .ci-slicks/src/slicks
97+
cat > .ci-slicks/pyproject.toml <<'EOF'
98+
[project]
99+
name = "slicks"
100+
version = "0.0.0"
101+
[build-system]
102+
requires = ["setuptools>=68"]
103+
build-backend = "setuptools.build_meta"
104+
[tool.setuptools.packages.find]
105+
where = ["src"]
106+
EOF
107+
touch .ci-slicks/README.md
108+
echo '__version__ = "0.0.0"' > .ci-slicks/src/slicks/__init__.py
109+
echo "SLICKS_HOST_PATH=${PWD}/.ci-slicks" >> .env
110+
111+
- name: Pull pre-built images
112+
run: |
113+
docker pull timescale/timescaledb:latest-pg16
114+
docker pull grafana/grafana
115+
docker pull telegraf:1.30
116+
docker pull nginx:alpine
117+
118+
- name: Build test images
119+
run: |
120+
cd server/installer
121+
docker compose build --parallel
122+
123+
- name: Validate compose configuration
124+
run: |
125+
cd server/installer
126+
docker compose config --quiet
127+
128+
- name: Test container startup (quick smoke test)
129+
run: |
130+
cd server/installer
131+
# Start core monitoring stack to ensure compose wiring is valid
132+
timeout 60s docker compose up timescaledb file-uploader grafana frontend || true
133+
# Check if containers started (even if they exit quickly)
134+
docker compose ps
135+
136+
cleanup:
137+
runs-on: ubuntu-latest
138+
needs: [validate-compose, build-and-push, test-compose]
139+
if: always()
140+
steps:
141+
- name: Checkout code
142+
uses: actions/checkout@v4
143+
144+
- name: Clean up Docker resources
145+
run: |
146+
docker system prune -f
147+
docker image prune -f

0 commit comments

Comments
 (0)