Skip to content

Commit

Permalink
Merge pull request #2230 from fractal-analytics-platform/2229-depreca…
Browse files Browse the repository at this point in the history
…te-v1-api-and-runner

Deprecate V1 (db tables, API, runner)
  • Loading branch information
tcompa authored Feb 3, 2025
2 parents fcf38c0 + 1e30f2d commit 02855cd
Show file tree
Hide file tree
Showing 123 changed files with 235 additions and 19,048 deletions.
1 change: 0 additions & 1 deletion .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
export FRACTAL_TASKS_DIR=/tmp/FRACTAL_TASKS_DIR
export JWT_SECRET_KEY=secret
export JWT_EXPIRE_SECONDS=84600
export FRACTAL_API_SUBMIT_RATE_LIMIT=0
cd benchmarks/
poetry run fractalctl set-db
poetry run python populate_db/populate_db_script.py
Expand Down
61 changes: 1 addition & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,6 @@ on:

jobs:

tests_v1:
name: "V1 - Python ${{ matrix.python-version }}"
runs-on: ubuntu-22.04
timeout-minutes: 30

strategy:
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Start Postgres
run: |
sudo systemctl start postgresql.service
sudo --login -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
sudo --login -u postgres createdb fractal_test
- name: Cache SLURM Docker images
id: cache-docker-slurm-multipy
uses: actions/cache@v4
with:
path: ci/cache/docker/slurm-multipy
key: cache-docker-slurm-multipy

- name: Use SLURM Docker Image Cache if cache hit
if: steps.cache-docker-slurm-multipy.outputs.cache-hit == 'true'
run: docker image load --input ./ci/cache/docker/slurm-multipy/slurm-multipy.tar

- name: Update SLURM Docker Image Cache if cache miss
if: steps.cache-docker-slurm-multipy.outputs.cache-hit != 'true'
run: docker pull ghcr.io/fractal-analytics-platform/ubuntu22-slurm-multipy:0.1 && mkdir -p ci/cache/docker/slurm-multipy && docker image save ghcr.io/fractal-analytics-platform/ubuntu22-slurm-multipy:0.1 --output ./ci/cache/docker/slurm-multipy/slurm-multipy.tar

- name: Install poetry
run: pipx install poetry==2.0.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"

- name: Install dependencies
run: |
poetry install --with dev --no-interaction
- name: Test with pytest
env:
COVERAGE_FILE: coverage-data-v1-${{ matrix.python-version }}
run: poetry run coverage run --concurrency=thread,greenlet,multiprocessing -m pytest -vv tests/v1 --durations 0

- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-v1-${{ matrix.python-version }}
path: coverage-data-v1-${{ matrix.python-version }}*

tests_v2_part1:

name: "V2 - Part 1 - Python ${{ matrix.python-version }}"
Expand Down Expand Up @@ -176,7 +117,7 @@ jobs:
coverage:
name: Coverage
runs-on: ubuntu-22.04
needs: [tests_v1, tests_v2_part1, tests_v2_part2]
needs: [tests_v2_part1, tests_v2_part2]

permissions:
pull-requests: write
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ jobs:
poetry add setuptools # required for py3.12
- name: Apply migration and fix-db script (postgres)
env:
FRACTAL_V27_DEFAULT_USER_EMAIL: admin@fractal.xy
run: |
cp $ROOTDIR/.fractal_server_postgres.env .fractal_server.env
poetry run fractalctl set-db
Expand Down Expand Up @@ -101,10 +99,13 @@ jobs:
run: |
poetry install --no-interaction
# We only run `alembic downgrade` until the specific revision that drops
# V1 tables (rather than all the way to `base`), because that revision
# is breakingly non-reversible
- name: Apply upgrade and downgrade
run: |
cp $ROOTDIR/.fractal_server_postgres.env fractal_server/.fractal_server.env
cd fractal_server
poetry run alembic history
poetry run alembic upgrade head
poetry run alembic downgrade base
poetry run alembic downgrade 1eac13a26c83
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ monitoring.db
jobs/wf*
runinfo
mypy-scan

.coverage*
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
**Note**: Numbers like (\#1234) point to closed Pull Requests on the fractal-server repository.

> WARNING: Notes for 2.11.0 prereleases are currently separated, and they should be merged at a later stage.
# 2.12.0

> WARNING: The database schema update introduced via this version is non-reversible.
* API:
* Drop V1 endpoints (\#2230).
* Database:
* Drop V1 tables (\#2230).
* Runner:
* Drop V1 runners (\#2230).
* Testing:
* Drop V1 tests (\#2230).
* Update V2 tests to keep coverage stable (\#2230).

# 2.11.1

Expand Down
2 changes: 1 addition & 1 deletion fractal_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "2.11.1"
__VERSION__ = "2.12.0a1"
2 changes: 0 additions & 2 deletions fractal_server/app/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
will not be picked up by alembic.
"""
from .linkusergroup import LinkUserGroup # noqa: F401
from .linkuserproject import LinkUserProject # noqa: F401
from .linkuserproject import LinkUserProjectV2 # noqa: F401
from .security import * # noqa
from .user_settings import UserSettings # noqa
from .v1 import * # noqa
from .v2 import * # noqa
9 changes: 0 additions & 9 deletions fractal_server/app/models/linkuserproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
from sqlmodel import SQLModel


class LinkUserProject(SQLModel, table=True):
"""
Crossing table between User and Project
"""

project_id: int = Field(foreign_key="project.id", primary_key=True)
user_id: int = Field(foreign_key="user_oauth.id", primary_key=True)


class LinkUserProjectV2(SQLModel, table=True):
"""
Crossing table between User and ProjectV2
Expand Down
13 changes: 0 additions & 13 deletions fractal_server/app/models/v1/__init__.py

This file was deleted.

71 changes: 0 additions & 71 deletions fractal_server/app/models/v1/dataset.py

This file was deleted.

101 changes: 0 additions & 101 deletions fractal_server/app/models/v1/job.py

This file was deleted.

29 changes: 0 additions & 29 deletions fractal_server/app/models/v1/project.py

This file was deleted.

Loading

0 comments on commit 02855cd

Please sign in to comment.