Skip to content

Commit ccfe33f

Browse files
committed
Refactor control package under app namespace
1 parent e74cdb9 commit ccfe33f

181 files changed

Lines changed: 1507 additions & 527 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
**/__pycache__/
3+
**/*.pyc
4+
node_modules
5+
dist
6+
build
7+
.env
8+
.env.*
9+
!app/**

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CLI=PYTHONPATH=cli python -m aion.cli
44
PY ?= python
55

66
dev-control:
7-
cd control && uvicorn app.main:app --reload --port 8001
7+
cd control && uvicorn app.control.main:app --reload --port 8001
88

99
doctor:
1010
$(CLI) doctor --verbose
File renamed without changes.

app/control/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /srv/app
4+
5+
ENV PYTHONPATH=/srv/app:/srv/app/app
6+
7+
RUN apt-get update && apt-get install -y --no-install-recommends \
8+
gcc g++ build-essential libpq-dev \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
COPY app/control/pyproject.toml ./pyproject.toml
12+
COPY app/control/README.md ./README.md
13+
COPY app/control/aionos_control ./aionos_control
14+
COPY app/control/app ./app
15+
COPY app/kernel ./app/kernel
16+
17+
RUN pip install --upgrade pip setuptools wheel \
18+
&& pip install -e .
19+
20+
EXPOSE 8000
21+
22+
CMD ["python", "-m", "app.control.app.main"]

app/control/ai_router.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
"""Compatibility shim for ``app.control.app.ai_router``."""
3+
from __future__ import annotations
4+
5+
from importlib import import_module as _import_module
6+
7+
_target = _import_module('app.control.app.ai_router')
8+
_globals = globals()
9+
for _name in getattr(_target, '__all__', [n for n in dir(_target) if not n.startswith('_')]):
10+
_globals[_name] = getattr(_target, _name)
11+
__all__ = getattr(_target, '__all__', [n for n in _globals if not n.startswith('_')])

app/control/aion_grpc/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
"""Compatibility shim for ``app.control.app.aion_grpc.__init__``."""
3+
from __future__ import annotations
4+
5+
from importlib import import_module as _import_module
6+
7+
_target = _import_module('app.control.app.aion_grpc.__init__')
8+
_globals = globals()
9+
for _name in getattr(_target, '__all__', [n for n in dir(_target) if not n.startswith('_')]):
10+
_globals[_name] = getattr(_target, _name)
11+
__all__ = getattr(_target, '__all__', [n for n in _globals if not n.startswith('_')])
12+
if hasattr(_target, '__path__'):
13+
__path__ = _target.__path__ # type: ignore[assignment]
14+
if hasattr(_target, '__spec__'):
15+
__spec__ = _target.__spec__
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
"""Compatibility shim for ``app.control.app.aion_grpc.aion.__init__``."""
3+
from __future__ import annotations
4+
5+
from importlib import import_module as _import_module
6+
7+
_target = _import_module('app.control.app.aion_grpc.aion.__init__')
8+
_globals = globals()
9+
for _name in getattr(_target, '__all__', [n for n in dir(_target) if not n.startswith('_')]):
10+
_globals[_name] = getattr(_target, _name)
11+
__all__ = getattr(_target, '__all__', [n for n in _globals if not n.startswith('_')])
12+
if hasattr(_target, '__path__'):
13+
__path__ = _target.__path__ # type: ignore[assignment]
14+
if hasattr(_target, '__spec__'):
15+
__spec__ = _target.__spec__

0 commit comments

Comments
 (0)