Skip to content
Merged
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
4 changes: 0 additions & 4 deletions .env (Root)

This file was deleted.

154 changes: 139 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,155 @@ name: Release

on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
paths:
- ".github/workflows/release.yml"
- "pyproject.toml"
- "CHANGELOG.md"
- "RELEASE_NOTES_*.md"
workflow_dispatch:
inputs:
tag:
description: "Existing semantic-version tag to validate"
required: true
type: string

permissions:
contents: write
issues: write
pull-requests: write
contents: read

jobs:
release:
verify:
name: Verify release candidate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', inputs.tag) || github.ref }}

- uses: actions/setup-node@v4
- uses: actions/setup-python@v5
with:
node-version: "20"
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
pyproject.toml

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
- name: Validate version and release notes
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
shell: bash
run: |
tag="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
[[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
version="${tag#v}"
RELEASE_VERSION="$version" python - <<'PY'
import os
from pathlib import Path
import tomllib

version = os.environ["RELEASE_VERSION"]
project = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))
assert project["project"]["version"] == version
assert Path(f"RELEASE_NOTES_{version}.md").is_file()
assert f"## [{version}]" in Path("CHANGELOG.md").read_text(encoding="utf-8")
PY

- name: Install release dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt -r requirements-dev.txt build

- name: Run quality gates
run: |
black --check . --line-length=100
ruff check .
mypy models.py utils.py event_bus.py location_store.py matching_engine.py pricing_engine.py consumer.py --ignore-missing-imports
pytest
python benchmarks/ride_sharing_benchmarks.py --iterations 250 --driver-count 100 --output benchmark-results.json
python -m json.tool benchmark-results.json > /dev/null

- name: Build Python distributions
run: python -m build

- name: Build application image
run: docker build --tag ride-sharing-platform:${{ github.sha }} .

- name: Create release checksums
run: sha256sum dist/* > SHA256SUMS.txt

- name: Generate SPDX SBOM
uses: anchore/sbom-action@v0
with:
path: .
format: spdx-json
output-file: sbom.spdx.json

- uses: actions/upload-artifact@v4
with:
name: release-assets
path: |
dist/*
SHA256SUMS.txt
sbom.spdx.json

publish-release:
name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
needs: verify
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: release-assets
path: release-assets

- id: notes
shell: bash
run: echo "path=RELEASE_NOTES_${GITHUB_REF_NAME#v}.md" >> "$GITHUB_OUTPUT"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ steps.notes.outputs.path }}
generate_release_notes: false
files: release-assets/*

publish-container:
name: Publish release container to GHCR
if: startsWith(github.ref, 'refs/tags/v')
needs: verify
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: metadata
uses: docker/metadata-action@v5
with:
images: ghcr.io/coreyleath-code/ride-sharing-platform
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest

- uses: docker/build-push-action@v6
with:
semantic_version: 18
branches: |
["main"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
context: .
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
25 changes: 5 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,35 +89,23 @@ ipython_config.py

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
# However, since this is a Python application, its lock file must be refreshed deliberately.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
# Similar to Poetry, it is generally recommended to include poetry.lock in version control.
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
# PEP 582
__pypackages__/

# Celery stuff
Expand All @@ -127,9 +115,10 @@ celerybeat.pid
# SageMath parsed files
*.sage.py

# Environments
# Environments and local configuration
.env
.env.*
.env (Root)
!.env.example
.venv
env/
Expand Down Expand Up @@ -163,10 +152,6 @@ dmypy.json
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Ruff stuff:
Expand Down
27 changes: 17 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Changelog

## [Unreleased]
- Added `docker-compose.yml` to spin up Kafka, Zookeeper, DB, and backend in one command.
- Added unit tests for preprocessing and event producers.

## [2025-06-01] v1.0.0
- Initial release of Scalable Event-Driven Ride-Sharing Platform.
- Features:
- Event producer/consumer modules using Kafka.
- REST API for ride requests (FastAPI or Flask).
- Basic data model and database schema for ride and driver tables.
- Unit tests for core modules (data loading, preprocessing).

## [1.1.0] - 2026-08-21
### Added
- Redis-backed driver-location state for scaled API replicas.
- NGINX least-connections gateway configuration and readiness checks.
- CI coverage for gateway routing, shared-state access, and single-replica loss.
- Reproducible release artifacts: Python wheel, source distribution, checksums, SPDX SBOM, and version-tagged GHCR image.

### Changed
- Release automation now validates a semantic tag, quality gates, package build, and container build before publishing.

## [1.0.0] - 2025-06-01
### Added
- Event producer/consumer modules using Kafka.
- REST API for ride requests.
- Basic data model and database schema for ride and driver tables.
- Unit tests for core modules.
19 changes: 19 additions & 0 deletions RELEASE_NOTES_1.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# v1.1.0

v1.1.0 packages the repository's currently implemented reference components and release evidence. It is not a claim of a complete production ride-sharing service.

## Added

- Redis-backed driver-location storage for scaled API replicas.
- NGINX least-connections routing with liveness/readiness checks.
- CI coverage for gateway routing, shared-state reads, and one-replica loss.
- Release assets: wheel, source distribution, SHA-256 checksums, and SPDX SBOM.
- A version-tagged GHCR container image.

## Verification

The release workflow runs formatting, linting, static typing, unit tests, the deterministic benchmark harness, Python package build, and Docker image build before publishing assets.

## Scope

The release distributes a reference implementation. It does not provide production identity, payment processing, PII controls, a fully integrated broker/deployment environment, or a production availability commitment.
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"name": "event-driven-ride-sharing-platform",
"version": "1.0.0",
"version": "1.1.0",
"private": true,
"description": "Scalable event-driven ride-sharing architecture",
"repository": {
"type": "git",
"url": "https://github.com/CoreyLeath-code/Scalable-Event-Driven-Ride-Sharing-Platform.git"
},
"release": {
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
}
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "event-driven-ride-sharing-platform"
version = "1.1.0"
description = "Reference components for an event-driven ride-request platform."
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [{ name = "CoreyLeath-code" }]
dependencies = [
"fastapi>=0.111,<1.0",
"uvicorn>=0.30,<1.0",
"pydantic>=2,<3",
"pydantic-settings>=2,<3",
"kafka-python>=2.0,<3.0",
"python-json-logger>=2,<4",
"redis>=5,<6",
"prometheus-client>=0.20,<1.0",
]

[project.urls]
Homepage = "https://github.com/CoreyLeath-code/Scalable-Event-Driven-Ride-Sharing-Platform"
Repository = "https://github.com/CoreyLeath-code/Scalable-Event-Driven-Ride-Sharing-Platform"
Changelog = "https://github.com/CoreyLeath-code/Scalable-Event-Driven-Ride-Sharing-Platform/blob/main/CHANGELOG.md"

[tool.setuptools]
py-modules = [
"api_router",
"consumer",
"event_bus",
"kafka_bus",
"location_store",
"main",
"matching_engine",
"models",
"pricing_engine",
"producer",
"rabbitmq_bus",
"redis_bus",
"utils",
]

[tool.setuptools.packages.find]
include = ["shared*"]
namespaces = true

[tool.black]
line-length = 100

Expand Down
Loading