Skip to content

feat: update default version#1021

Merged
earayu merged 24 commits into
mainfrom
feature/refine_compose
Jul 3, 2025
Merged

feat: update default version#1021
earayu merged 24 commits into
mainfrom
feature/refine_compose

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented Jul 2, 2025

No description provided.

@earayu earayu requested a review from iziang as a code owner July 2, 2025 10:25
@apecloud-bot apecloud-bot added the size/S Denotes a PR that changes 10-29 lines. label Jul 2, 2025
cursor[bot]

This comment was marked as outdated.

@apecloud-bot apecloud-bot added size/L Denotes a PR that changes 100-499 lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Jul 2, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@apecloud-bot apecloud-bot added size/XL Denotes a PR that changes 500-999 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Jul 3, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@apecloud-bot apecloud-bot added size/XXL Denotes a PR that changes 1000+ lines. and removed size/XL Denotes a PR that changes 500-999 lines. labels Jul 3, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@earayu earayu merged commit a0a3d09 into main Jul 3, 2025
6 of 7 checks passed
@earayu earayu deleted the feature/refine_compose branch July 3, 2025 05:38
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Docker Compose Commands Ignore Version Variable

The Makefile's docker-compose commands (compose-up, compose-infra, compose-down, compose-logs) hardcode VERSION=v0.5.0-alpha.30 instead of using the configurable $(VERSION) variable (which defaults to nightly). This inconsistency means make build uses nightly while make compose-* operations use v0.5.0-alpha.30, preventing users from customizing the version and potentially leading to mismatched image versions and deployment issues.

Makefile#L1-L134

ApeRAG/Makefile

Lines 1 to 134 in bb2cbb9

# Configuration variables
VERSION ?= nightly
VERSION_FILE ?= aperag/version/__init__.py
BUILDX_PLATFORM ?= linux/amd64,linux/arm64
BUILDX_ARGS ?= --sbom=false --provenance=false
REGISTRY ?= registry.cn-hangzhou.aliyuncs.com
# Image names
APERAG_IMAGE = apecloud/aperag
APERAG_FRONTEND_IMG = apecloud/aperag-frontend
# Detect host architecture
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M),x86_64)
LOCAL_PLATFORM = linux/amd64
else ifeq ($(UNAME_M),aarch64)
LOCAL_PLATFORM = linux/arm64
else ifeq ($(UNAME_M),arm64)
LOCAL_PLATFORM = linux/arm64
else
LOCAL_PLATFORM = linux/amd64
endif
##################################################
# Environment & Dependencies
##################################################
# Python environment setup
.PHONY: install-uv venv install clean
install-uv:
@if [ -z "$$(which uv)" ]; then \
echo "Installing uv..."; \
pip install uv; \
fi
venv: install-uv
@if [ ! -d ".venv" ]; then \
echo "Creating virtual environment..."; \
uv venv -p 3.11.12; \
fi
install: venv
@echo "Installing Python dependencies..."
uv sync --all-groups --all-extras
# Development environment setup
.PHONY: dev install-hooks
dev: install-uv venv install-addlicense install-hooks
@echo "Installing development tools..."
@command -v redocly >/dev/null || npm install @redocly/cli -g
@command -v openapi-generator-cli >/dev/null || npm install @openapitools/openapi-generator-cli -g
@command -v datamodel-codegen >/dev/null || uv tool install datamodel-code-generator
@echo ""
@echo "✅ Development environment ready!"
@echo "📝 Next steps:"
@echo " 1. Activate virtual environment: source .venv/bin/activate"
@echo " 2. Install dependencies: make install"
@echo " 3. Start databases: make compose-infra"
@echo " 4. Apply migrations: make migrate"
@echo " 5. Run services: make run-backend, make run-celery"
install-hooks:
@echo "Installing git hooks..."
@./scripts/install-hooks.sh
# Environment cleanup
clean:
@echo "Cleaning development environment..."
@rm -f db.sqlite3
@$(MAKE) compose-down REMOVE_VOLUMES=1
##################################################
# Database & Infrastructure
##################################################
# Database schema management
.PHONY: makemigration migrate
makemigration:
@uv run alembic -c aperag/alembic.ini revision --autogenerate
migrate:
@uv run alembic -c aperag/alembic.ini upgrade head
# Docker Compose infrastructure
# Variables for compose command based on environment flags
# Usage examples:
# make compose-up # Full application
# make compose-up WITH_NEO4J=1 # Full application + Neo4j
# make compose-up WITH_DOCRAY=1 # Full application + DocRay
# make compose-up WITH_NEO4J=1 WITH_DOCRAY=1 # Full application + Neo4j + DocRay
# make compose-up WITH_NEO4J=1 WITH_DOCRAY=1 WITH_GPU=1 # All features
# make compose-infra # Infrastructure only (databases)
# make compose-infra WITH_NEO4J=1 # Infrastructure + Neo4j
# make compose-down # Stop all services
# make compose-down REMOVE_VOLUMES=1 # Stop and remove volumes
_PROFILES_TO_ACTIVATE :=
_EXTRA_ENVS :=
_COMPOSE_DOWN_FLAGS :=
# Determine which additional profiles to activate
ifeq ($(WITH_NEO4J),1)
_PROFILES_TO_ACTIVATE += --profile neo4j
endif
ifeq ($(WITH_DOCRAY),1)
ifeq ($(WITH_GPU),1)
_PROFILES_TO_ACTIVATE += --profile docray-gpu
_EXTRA_ENVS += DOCRAY_HOST=http://aperag-docray-gpu:8639
else
_PROFILES_TO_ACTIVATE += --profile docray
_EXTRA_ENVS += DOCRAY_HOST=http://aperag-docray:8639
endif
endif
# Determine flags for 'compose-down'
ifeq ($(REMOVE_VOLUMES),1)
_COMPOSE_DOWN_FLAGS += -v
endif
.PHONY: compose-up compose-down compose-logs compose-infra
# Full application startup
compose-up:
VERSION=v0.5.0-alpha.30 DOCRAY_VERSION=v0.1.1 $(_EXTRA_ENVS) docker-compose --profile app $(_PROFILES_TO_ACTIVATE) -f docker-compose.yml up -d
# Infrastructure only (databases + supporting services)
compose-infra:
VERSION=v0.5.0-alpha.30 DOCRAY_VERSION=v0.1.1 docker-compose $(_PROFILES_TO_ACTIVATE) -f docker-compose.yml up -d
compose-down:
VERSION=v0.5.0-alpha.30 DOCRAY_VERSION=v0.1.1 docker-compose --profile app --profile docray --profile docray-gpu --profile neo4j -f docker-compose.yml down $(_COMPOSE_DOWN_FLAGS)
compose-logs:
VERSION=v0.5.0-alpha.30 DOCRAY_VERSION=v0.1.1 docker-compose -f docker-compose.yml logs -f

Fix in Cursor


Bug: Alembic Migration Chain Broken by Revision ID Change

The Alembic migration chain is broken because an existing migration file's revision ID was changed from '850b2c5dc08f' to '0b274fcc91e2', and its down_revision was also altered. This prevents existing installations that have applied the original migration from correctly upgrading, as Alembic will not recognize the migration state and may attempt to recreate existing tables.

aperag/migration/versions/20250703133208-0b274fcc91e2.py#L14-L16

# revision identifiers, used by Alembic.
revision: str = '0b274fcc91e2'
down_revision: Union[str, None] = 'db9c88848f52'

aperag/migration/versions/20250703133304-b598e645b2ba.py#L16-L18

# revision identifiers, used by Alembic.
revision: str = 'b598e645b2ba'
down_revision: Union[str, None] = '0b274fcc91e2'

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL Denotes a PR that changes 1000+ lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants