Skip to content

Commit

Permalink
Merge branch 'feat/add-pydantic-handling-decorator-for-req-res' into …
Browse files Browse the repository at this point in the history
…refactor/apply-decorator
  • Loading branch information
MintCat98 committed Feb 3, 2025
2 parents dc9872a + 9519d29 commit d62a3db
Show file tree
Hide file tree
Showing 368 changed files with 20,202 additions and 5,813 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
resolves #NNN (BA-MMM)
<!-- replace NNN, MMM with the GitHub issue number and the corresponding Jira issue number. -->

<!--
Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes,
and how it affects the users and other developers.
Expand Down
2 changes: 0 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ area:docs:
- changed-files:
- any-glob-to-any-file:
- 'docs/**/*'
- 'src/ai/backend/manager/api/**/*.py'
- 'src/ai/backend/manager/models/gql.py'

comp:storage-proxy:
- changed-files:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,20 @@ jobs:
gha-cache-key: pants-cache-main-1-deploy-py${{ env.PROJECT_PYTHON_VERSION }}-${{ runner.os }}-${{ runner.arch }}
named-caches-hash: ${{ hashFiles('python*.lock', 'tools/*.lock') }}
cache-lmdb-store: 'false'
- name: Build fat packages
- name: Build both lazy and fat packages
run: |
pants --tag="scie" package '::'
# 'pants run' does not support parallelization
# Rename artifacts to have the platform suffix
platform_suffix="$(python scripts/get-platform-suffix.py)"
for artifact in dist/backendai-*; do
mv "${artifact}" "${artifact}-${platform_suffix}"
done
# Generate checksums. NOTE: 'pants run' does not support parallelization
pants list --filter-tag-regex='checksum' '::' | xargs -n 1 pants run
- name: Clean up intermediate pex files
run: |
rm -rf dist/src.*/
# Merge checksums into a single file
cat dist/*.sha256 > dist/checksum.txt
sort -u dist/checksum.txt -o dist/checksum.txt
rm dist/*.sha256
- name: Upload scies
uses: actions/upload-artifact@v4
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/update-api-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
pull_request:
paths:
- 'src/ai/backend/manager/models/**'
- 'src/ai/backend/manager/api/**'

jobs:
graphql-updated:
api-updated:
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -52,27 +53,28 @@ jobs:
cache-lmdb-store: 'true'
- name: Pants export
run: pants export --resolve=python-default
- name: Create GraphQL schema dump
- name: Create api schema dump
run: |
./backend.ai mgr api dump-gql-schema --output src/ai/backend/manager/api/schema.graphql
./backend.ai mgr api dump-gql-schema --output docs/manager/graphql-reference/schema.graphql
./backend.ai mgr api dump-openapi --output docs/manager/rest-reference/openapi.json
- name: Make commit message for changing change log file
run: |
git add src/ai/backend/manager/api/schema.graphql
git add docs/manager/graphql-reference/schema.graphql
git add docs/manager/rest-reference/openapi.json
author_name=$(git show -q --pretty='format:%an')
author_email=$(git show -q --pretty='format:%ae')
git config user.email "$author_email"
git config user.name "$author_name"
if [ -n "$(git diff --staged)" ]; then
git commit \
-m "chore: update GraphQL schema dump" \
-m "chore: update api schema dump" \
--author="$author_name <$author_email>" \
--trailer "Co-authored-by: octodog <[email protected]>"
git push
fi
graphql-inspector:
needs: graphql-updated
name: Check Schema
needs: api-updated
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -82,6 +84,6 @@ jobs:
- uses: actions/checkout@v4
- uses: kamilkisiela/graphql-inspector@release-1717403590269
with:
schema: '${{ github.base_ref }}:src/ai/backend/manager/api/schema.graphql'
schema: '${{ github.base_ref }}:docs/manager/graphql-reference/schema.graphql'
rules: |
gql-inspector-checker.js
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
.mypy_cache/
.ruff_cache/

# Translations
*.mo
Expand Down Expand Up @@ -78,7 +79,7 @@ venv/
ENV/

# IDE/vim
.idea
.idea/
.swp
.swo
.*.swp
Expand All @@ -90,7 +91,7 @@ ENV/
/.exrc
.ripgreprc
.neoconf.json
/.zed
.zed/
/.ropeproject
pyrightconfig.json

Expand All @@ -103,13 +104,13 @@ pyrightconfig.json
/tools/pants-src

# Local configurations
/account-manager.toml
/manager.toml
/agent.toml
/storage-proxy.toml
/webserver.conf
/cuda-mock.toml
/mock-accelerator.toml
/account-manager*.toml
/manager*.toml
/agent*.toml
/storage-proxy*.toml
/webserver*.conf
/cuda-mock*.toml
/mock-accelerator*.toml
/.pants.env
/.pants.bootstrap
/.pants.rc
Expand Down
2 changes: 0 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ build:
exit 183;
fi
pre_build:
# Auto-generate REST API reference
- PYTHONPATH="src" python -m ai.backend.manager.openapi -o docs/manager/rest-reference/openapi.json
- |
if [ "$READTHEDOCS_VERSION_TYPE" != "external" ];
then
Expand Down
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ python_requirements(
"python-dateutil": ["dateutil", "dateutil.parser", "dateutil.tz"],
"python-json-logger": ["pythonjsonlogger"],
"pyhumps": ["humps"],
"pyroscope-io": ["pyroscope"],
"pyzmq": ["zmq"],
"PyYAML": ["yaml"],
"typing-extensions": ["typing_extensions"],
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,45 @@ Changes

<!-- towncrier release notes start -->

## 25.1.1 (2025-01-20)
No significant changes.


## 25.1.0 (2025-01-20)

### Features
* Implement fine-grained seccomp profile managed by Backend.AI Agent. ([#3019](https://github.com/lablup/backend.ai/issues/3019))
* Enable image rescanning by project. ([#3237](https://github.com/lablup/backend.ai/issues/3237))
* Support auto-scaling of model services by observing proxy and app-specific metrics as configured by autoscaling rules bound to each endpoint ([#3277](https://github.com/lablup/backend.ai/issues/3277))
* Deprecate the JWT-based `X-BackendAI-SSO` header to reduce complexity in authentication process for the pipeline service ([#3353](https://github.com/lablup/backend.ai/issues/3353))
* Add Grafana and Prometheus to Docker Compose ([#3458](https://github.com/lablup/backend.ai/issues/3458))
* Integrate Pyroscope with Backend.AI ([#3459](https://github.com/lablup/backend.ai/issues/3459))
* Update SDK to retrieve and use IDs for VFolder API operations instead of names ([#3471](https://github.com/lablup/backend.ai/issues/3471))

### Fixes
* Refactor container registries' projects traversal logic of the image rescanning. ([#2979](https://github.com/lablup/backend.ai/issues/2979))
* Fix regression of outdated `vfolder` GQL resolver. ([#3047](https://github.com/lablup/backend.ai/issues/3047))
* Fix image without metadata label not working ([#3341](https://github.com/lablup/backend.ai/issues/3341))
* Enforce VFolder name length restriction through the API schema, not by the DB column constraint ([#3363](https://github.com/lablup/backend.ai/issues/3363))
* Fix password based SSH login not working on sessions based on certain images ([#3387](https://github.com/lablup/backend.ai/issues/3387))
* Fix purge API to allow deletion of owner-deleted VFolders by directly retrieving VFolders using the folder ID ([#3388](https://github.com/lablup/backend.ai/issues/3388))
* Fix certain customized images not being pushed to registry properly ([#3391](https://github.com/lablup/backend.ai/issues/3391))
* Fix formatting errors when logging exceptions raised from the current local process that did not pass our custom serialization step ([#3410](https://github.com/lablup/backend.ai/issues/3410))
* Fix scanning and loading container images with no labels at all (`null` in the image manifests) ([#3411](https://github.com/lablup/backend.ai/issues/3411))
* Fix missing CPU architecture name lookup in `LocalRegistry` to directly scan and load container images from the local Docker daemon in dev setups ([#3420](https://github.com/lablup/backend.ai/issues/3420))
* Utilization idle checker computes kernel resource usages correctly ([#3442](https://github.com/lablup/backend.ai/issues/3442))
* Filter vfolders by status before initiating a vfolder deletion task ([#3446](https://github.com/lablup/backend.ai/issues/3446))
* Fix a mis-implementation that has prevented using UUIDs to indicate an exact vfolder when invoking the vfolder REST API ([#3451](https://github.com/lablup/backend.ai/issues/3451))
* Fix the required state output logic in the openopi reference documentation correctly ([#3460](https://github.com/lablup/backend.ai/issues/3460))
* Raise exception if multiple VFolders exist in decorator ([#3465](https://github.com/lablup/backend.ai/issues/3465))

### Documentation Updates
* Deprecate non relay container registry GQL explicitly. ([#3231](https://github.com/lablup/backend.ai/issues/3231))

### Miscellaneous
* Upgrade pantsbuild from 2.21 to 2.23, replacing the scie plugin with the intrinsic pex's scie build support ([#3377](https://github.com/lablup/backend.ai/issues/3377))


## 24.12.1 (2025-01-04)

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.12.1
25.1.1
1 change: 0 additions & 1 deletion changes/3019.feature.md

This file was deleted.

1 change: 1 addition & 0 deletions changes/3511.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add new Pydantic handling api decorator for Request/Response validation
7 changes: 7 additions & 0 deletions configs/account-manager/halfstack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ ssl-enabled = false
pid-file = "./account-manager.pid" # env: BACKEND_PID_FILE


[pyroscope]
enabled = true
app_name = "backendai-half-account-manager"
server_addr = "http://localhost:4040"
sample-rate = 100


[logging]
level = "INFO"
drivers = ["console"]
Expand Down
6 changes: 6 additions & 0 deletions configs/account-manager/sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ ssl-enabled = false
pid-file = "./account-manager.pid" # env: BACKEND_PID_FILE


[pyroscope]
enabled = true
app-name = "backendai-half-account-manager"
server-addr = "http://localhost:4040"
sample-rate = 100

[logging]
level = "INFO"
drivers = ["console"]
Expand Down
12 changes: 12 additions & 0 deletions configs/agent/ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ password = ""

[agent]
rpc-listen-addr = { host = "127.0.0.1", port = 6001 }
# metric API service address
service-addr = { host = "0.0.0.0", port = 6003 }
ssl-enabled = false
#ssl-cert = ""
#ssl-key = ""
agent-sock-port = 6007
id = "i-travis"
scaling-group = "default"
Expand Down Expand Up @@ -34,6 +39,13 @@ target-service = "backendai-agent.service"
soft-reset-available = false


[pyroscope]
enabled = false
# app-name = "backendai-half-agent"
# server-addr = "http://localhost:4040"
# sample-rate = 100


[logging]
level = "INFO"
drivers = ["console"]
Expand Down
12 changes: 12 additions & 0 deletions configs/agent/halfstack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ password = ""
[agent]
mode = "docker"
rpc-listen-addr = { host = "127.0.0.1", port = 6001 }
# metric API service address
service-addr = { host = "0.0.0.0", port = 6003 }
ssl-enabled = false
#ssl-cert = ""
#ssl-key = ""
agent-sock-port = 6007
# id = "i-something-special"
scaling-group = "default"
Expand Down Expand Up @@ -42,6 +47,13 @@ target-service = "backendai-agent.service"
soft-reset-available = false


[pyroscope]
enabled = true
app-name = "backendai-half-agent"
server-addr = "http://localhost:4040"
sample-rate = 100


[logging]
level = "INFO"
drivers = ["console"]
Expand Down
7 changes: 7 additions & 0 deletions configs/agent/sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ target-service = "backendai-agent.service"
soft-reset-available = false


[pyroscope]
enabled = true
app-name = "backendai-half-agent"
server-addr = "http://localhost:4040"
sample-rate = 100


[logging]
# One of: "NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"
# Set the global logging level.
Expand Down
Loading

0 comments on commit d62a3db

Please sign in to comment.