Skip to content

Commit 7969be6

Browse files
GioeleB00Copilot
andauthored
Release/0.1.0 (#17)
* setting up the branch * minor correction * minor changes * improved script for linux * minor change * Delete docker_fs/.env.dev * Delete docker_fs/.env.test * Features/event generator (#1) * setting up the generator * poisson-poisson requests sampling * Delete docker_fs/.env.dev * Delete docker_fs/.env.test * changes * refactor for event generator * added gaussian truncated generator and unit tests for helpers * imprved documentantion and simulation time handling * simulation start with the vent generator * small refactor + tests for the generation of events * minor changes * Update src/app/schemas/simulation_input.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/unit/sampler/test_sampler_helper.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update scripts/quality-check.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/integration/db_initialization/test_init_models.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * minor changes after PR review --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * minor changes * Features/event generator documentation test improvements (#2) * moving file to correct folder * Documentation added * Update requests_generator.md * test Added, introduced constants for the sampling window * Update tests/unit/sampler/test_poisson_posson.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * README update * Improved constants management * Clean and refactor * Features/request handler endpoint input (#3) * Introduction of the input structure for endpoints * Documentation + foundation of topology input * Improve Step validation, added unit test for the input * improved documentation for the input * Features/definition full payload simulation (#4) * Improved input structure and pytest * Improved pytest structure accordingly to the new schema * definition of the metrics to be measured and update of the simulation input * improved documentations added rationale behind metrics * improved pytest logic and code coherence * Update src/app/core/helpers.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Features/rqs generator runtime (#5) * definition of state and RqsGeneratorRuntime * defined edge runtime and more central logic for sampler * minor changes * minor changes * minor bug fixed * pytest adapted to the new structure, added pytest for rqs_state * Update src/app/core/runtime/rqs_generator.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/app/core/runtime/rqs_generator.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/app/core/runtime/edge.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/app/core/runtime/edge.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/unit/runtime/test_requests_generator.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/app/core/event_samplers/common_helpers.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/app/core/event_samplers/common_helpers.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/app/core/event_samplers/common_helpers.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * minor changes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Features/client server runtime (#6) * defined client runtime + tests * initiated the server runtime plus correction of tghe structure * code refactor + test added for runtime + documentation * Update tests/conftest.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Features/metric sampler and collection (#7) * defined architecture for the central collector + documentation * server modification to collect metrics and updated docs * Completed metric collector for server plus test * remove web app dependencies and added metrics for rqs latency * improved docs and improved metric collection * changes to make the code compatible with new changes * improved ci against toml changes * update lock file * minor change * Features/metrics elaboration (#8) * introduction to the analyzer class + tests * refactor of the analyzer * Features/load balancer node (#9) * Added LB structure in the input for the simulation + tests * introduced LB runtime + documentation * Added test for LB and small refactor to define the SimRunner * Features/simulation runner (#10) * added the first method to the simulation runner * added methods to handle nodes * completed simulation runtime + integration test * Features/integration tests unit tests (#11) * new integration test + bug fixing * added integration and unit test * first tests working * minor change * first working example, upgrade docs, upgrade docstrings * improvements * path bug fixed * new readme and guide to build yaml * Update README.md * Added pybuilder and unit tests (#12) * Refactor/change project name plus docs improvement (#13) * Changed name from fastsim to asyncflow app folder renamed in asyncflow * improved docs * minor changes * Refactor/pypi preparation (#14) * Reafctor for the folder schemas + defined import for public api * Defined public api, improved docs * minor changes * minor changes * Features/lb example and docs tutorial (#15) * minor docs changes * improved pytoml * improved docs + LB examples * sanity ci check * Ci for main (#16) * Readme final, docs improved * Docs improvement, refactor analyzer, example added * Added scripts for setup, added pytest, improved readme * Example LB improvements * CI for main + system tests * fixing a bug * bug fixed --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 30f30dd commit 7969be6

File tree

147 files changed

+14578
-961
lines changed

Some content is hidden

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

147 files changed

+14578
-961
lines changed

.gitattributes

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
*.sh text eol=lf
2-
*.py text eol=lf
3-
*.env text eol=lf
4-
*.yml text eol=lf
1+
# Unix-style line endings (LF)
2+
*.sh text eol=lf
3+
*.py text eol=lf
4+
*.yml text eol=lf
5+
*.yaml text eol=lf
6+
*.toml text eol=lf
7+
*.cfg text eol=lf
8+
*.ini text eol=lf
9+
Makefile text eol=lf
10+
11+
# PowerShell
12+
*.ps1 text eol=crlf

.github/workflows/ci-develop.yml

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -55,38 +55,19 @@ jobs:
5555

5656
# Unit-tests only (exclude integration markers)
5757
- name: Run unit tests
58+
env:
59+
ENVIRONMENT: test
5860
run: poetry run pytest -m "not integration" --disable-warnings
5961

6062

6163

6264
# Job 2 ─ Full validation (executed only on push events)
63-
# --------------------------------------------------------------------------- #
64-
# Includes everything from the quick job plus:
65-
# • PostgreSQL service container
66-
# • Alembic migrations
67-
# • Integration tests
68-
# • Multi-stage Docker build and health-check
69-
7065
full:
7166
if: |
7267
github.event_name == 'push' &&
7368
github.ref == 'refs/heads/develop'
7469
runs-on: ubuntu-latest
7570

76-
services:
77-
postgres:
78-
image: postgres:17
79-
env:
80-
POSTGRES_USER: ${{ secrets.DB_USER }}
81-
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
82-
POSTGRES_DB: ${{ secrets.DB_NAME }}
83-
ports: ["5432:5432"]
84-
options: >-
85-
--health-cmd "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"
86-
--health-interval 10s
87-
--health-timeout 5s
88-
--health-retries 5
89-
9071
steps:
9172
- uses: actions/checkout@v3
9273
- uses: actions/setup-python@v4
@@ -108,41 +89,12 @@ jobs:
10889
- name: Run mypy
10990
run: poetry run mypy src
11091

111-
- name: Apply Alembic migrations
112-
env:
113-
ENVIRONMENT: test
114-
DB_URL: postgresql+psycopg://${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@localhost:5432/${{ secrets.DB_NAME }}
115-
run: poetry run alembic upgrade head
116-
11792
- name: Run all tests
118-
env:
119-
ENVIRONMENT: test
120-
DB_URL: postgresql+asyncpg://${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@localhost:5432/${{ secrets.DB_NAME }}
12193
run: |
12294
poetry run pytest \
12395
--cov=src --cov-report=term \
12496
--disable-warnings
12597
126-
- name: Build Docker image
127-
run: docker build --progress=plain -t backend:ci .
98+
12899

129-
- name: Smoke test container
130-
run: |
131-
# partiamo con --network host così il container condivide la rete del runner
132-
docker run -d \
133-
--name backend_ci \
134-
--network host \
135-
-e ENVIRONMENT=test \
136-
-e DB_URL=postgresql+asyncpg://${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@localhost:5432/${{ secrets.DB_NAME }} \
137-
backend:ci \
138-
uvicorn app.main:app --host 0.0.0.0 --port 8000
139-
140-
for i in {1..10}; do
141-
if curl --silent --fail http://localhost:8000/health; then
142-
echo "✔ Health OK"; break
143-
else
144-
echo "Waiting…"; sleep 3
145-
fi
146-
done
147-
148-
docker stop backend_ci
100+

.github/workflows/ci-main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI – Main Branch
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ci-main-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
PYTHON_VERSION: "3.12"
14+
MPLBACKEND: Agg
15+
ASYNCFLOW_RUN_SYSTEM_TESTS: "1"
16+
17+
jobs:
18+
all-checks:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 25
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ env.PYTHON_VERSION }}
28+
cache: 'pip'
29+
30+
- uses: actions/cache@v3
31+
with:
32+
path: ~/.cache/pypoetry
33+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
34+
35+
- name: Install Poetry & deps
36+
run: |
37+
curl -sSL https://install.python-poetry.org | python3 -
38+
export PATH="$HOME/.local/bin:$PATH"
39+
poetry config virtualenvs.create false
40+
poetry install --with dev --no-interaction
41+
42+
- name: Ruff (lint)
43+
run: poetry run ruff check src tests
44+
45+
- name: MyPy (type-check)
46+
run: poetry run mypy src tests
47+
48+
- name: All tests (unit + integration + system)
49+
run: |
50+
poetry run pytest \
51+
--disable-warnings

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pip-wheel-metadata/
3030
venv/
3131
ENV/
3232
env/
33+
docker_fs/.env
34+
docker_fs/.env.*
3335

3436
# Poetry-specific
3537
.cache/pypoetry/

Dockerfile

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)