Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions .github/workflows/check-uv-lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check uv.lock

on:
pull_request:
branches: [ master ]
paths:
- 'pyproject.toml'
- 'uv.lock'

jobs:
check-uv-lock:
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
steps:
- uses: actions/checkout@v4

- name: Check uv.lock
run: |
uv lock --check
48 changes: 48 additions & 0 deletions .github/workflows/test-migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test migrations

on:
push:
branches: [master]
workflow_call:
pull_request:

env:
UV_FROZEN: true # Do not update the lockfile

jobs:
test_migrations:
name: Test migrations
runs-on: ubuntu-latest
container: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
env:
DATABASE_URI: postgresql://nwa:nwa@postgres/orchestrator-core
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: nwa
POSTGRES_USER: nwa
POSTGRES_DB: orchestrator-core
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Install dependencies
run: uv sync

- name: Test migrations
run: uv run main.py db upgrade heads

- name: Verify number of heads
run: |
num_heads=$(uv run main.py db heads | grep -c '(head)')
if [ "$num_heads" -ne 2 ]; then
echo "Found $num_heads DB heads instead of 2, check for duplicate down_revisions"
exit 1
fi
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ services:
- ./graphql_federation.py:/home/orchestrator/graphql_federation.py
- ./utils:/home/orchestrator/utils
- ./services:/home/orchestrator/services
- ./requirements.txt:/home/orchestrator/requirements.txt
- ./pyproject.toml:/home/orchestrator/pyproject.toml
- ./uv.lock:/home/orchestrator/uv.lock
- ./alembic.ini:/home/orchestrator/alembic.ini
- ./translations:/home/orchestrator/translations
- ./templates:/home/orchestrator/templates
Expand Down
16 changes: 12 additions & 4 deletions docker/orchestrator/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@
PATH=$PATH:~/.local/bin

# Install extra requirements for orchestrator
pip install -r requirements.txt
pip install uv
uv sync
source .venv/bin/activate

if [ -f ${CORE_OVERRIDE}/pyproject.toml ]; then
echo "⏭️ Use editable install of orchestrator-core with dev and test dependencies"
pip install -e $CORE_OVERRIDE[dev,test]
uv pip install -e $CORE_OVERRIDE[dev,test]

# Run any missing migrations on the database
python main.py db upgrade heads

uvicorn --host 0.0.0.0 --port 8080 $UVICORN_ARGS main:app --reload --proxy-headers --reload-dir $CORE_OVERRIDE
uvicorn --host 0.0.0.0 --port 8080 $UVICORN_ARGS main:app --reload --proxy-headers \
--reload-dir $CORE_OVERRIDE \
--reload-dir products \
--reload-dir services \
--reload-dir translations \
--reload-dir utils \
--reload-dir workflows
else
# Run any missing migrations on the database
python main.py db upgrade heads

echo "⏭️ Use pip installed orchestrator-core $(pip freeze | grep orchestrator-core)"
echo "⏭️ Use orchestrator-core as specified in pyproject.toml $(uv pip freeze | grep orchestrator-core)"
uvicorn --host 0.0.0.0 --port 8080 $UVICORN_ARGS main:app --reload --proxy-headers
fi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Update validate targets.

Revision ID: bc54616fefcf
Revises: d946c20663d3
Revises: 0e8d17ce0f06
Create Date: 2025-08-26 22:55:28.955536

"""
Expand All @@ -11,7 +11,7 @@

# revision identifiers, used by Alembic.
revision = "bc54616fefcf"
down_revision = "d946c20663d3"
down_revision = "0e8d17ce0f06"
branch_labels = None
depends_on = None

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
"deepdiff==8.0.1",
"orchestrator-core==4.0.4",
"orchestrator-core==4.4.0rc3",
"pynetbox==7.4.1",
"rich==13.9.4",
]
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

60 changes: 42 additions & 18 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion workflows/l2vpn/modify_l2vpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def update_subscription_description(subscription: L2vpn) -> State:


@step("Update L2VPN in NRM")
def update_l2vpn_in_nrm(subscription: L2vpnProvisioning) -> State:
def update_l2vpn_in_nrm(subscription: L2vpn) -> State:
"""Dummy step, replace with actual call to NRM."""
return {"subscription": subscription}

Expand Down
Loading