-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[AINode] Package AINode via PyInstaller #16707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the AINode distribution from a venv-based approach to a PyInstaller-based binary distribution. This change simplifies deployment by eliminating the need for Python virtual environment setup on target systems.
Key Changes:
- Introduces PyInstaller-based binary building with
build_binary.pyandainode.specconfiguration - Removes venv setup scripts (
ainode-env.shandainode-env.bat) and related Maven build steps - Updates startup scripts to execute pre-built binaries instead of managing Python environments
- Refactors Python code for PyInstaller compatibility (multiprocessing support, config path handling)
- Updates dependencies to include PyInstaller and removes Python version-specific constraints
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/sbin/windows/start-ainode.bat | Simplified to execute binary; contains syntax errors in variable declarations |
| scripts/sbin/start-ainode.sh | Simplified to execute binary from lib/ainode/ainode path |
| scripts/conf/windows/ainode-env.bat | Removed venv setup logic (no longer needed) |
| scripts/conf/ainode-env.sh | Removed venv setup logic (no longer needed) |
| iotdb-core/ainode/pom.xml | Removed venv creation steps, updated to call build_binary.py |
| iotdb-core/ainode/pyproject.toml | Added PyInstaller dependency, removed Python version-specific constraints |
| iotdb-core/ainode/poetry.lock | Updated with new dependencies; regenerated with older Poetry version |
| iotdb-core/ainode/build_binary.py | New script to manage PyInstaller build process with venv setup |
| iotdb-core/ainode/ainode.spec | PyInstaller configuration for bundling AINode application |
| iotdb-core/ainode/iotdb/ainode/core/script.py | Added PyInstaller multiprocessing support and argument filtering |
| iotdb-core/ainode/iotdb/ainode/core/log.py | Enhanced logging message with file prefix information |
| iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py | Refactored ModelManager to instance variable; increased pool ready timeout; contains commented code |
| iotdb-core/ainode/iotdb/ainode/core/inference/pool_scheduler/basic_pool_scheduler.py | Refactored ModelManager from global to instance variable |
| iotdb-core/ainode/iotdb/ainode/core/constant.py | Removed unused AINODE_ROOT constants |
| iotdb-core/ainode/iotdb/ainode/core/config.py | Updated config file paths to remove AINODE_ROOT references |
| iotdb-core/ainode/resources/syncPythonVersion.groovy | Removed venv validation check |
| iotdb-core/ainode/ainode.xml | Updated to package dist directory as lib instead of .whl files |
| iotdb-core/ainode/.gitignore | Updated to ignore PyInstaller build artifacts |
Comments suppressed due to low confidence (1)
iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py:98
- This comment appears to contain commented-out code.
# if not self.has_request_pools(model_id, device.index):
# # TODO: choose a device based on some strategy
# device = self.DEFAULT_DEVICE
# actions = self._pool_scheduler.schedule(model_id, device)
# for action in actions:
# if action.action == ScaleActionType.SCALE_UP:
# # initialize the first pool
# self._first_pool_init(action.model_id, str(device))
# # start a background thread to expand pools
# expand_thread = threading.Thread(
# target=self._expand_pools_on_device,
# args=(action.model_id, str(device), action.amount - 1),
# daemon=True,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16707 +/- ##
============================================
- Coverage 38.76% 38.74% -0.02%
Complexity 207 207
============================================
Files 4990 5002 +12
Lines 330499 331480 +981
Branches 42019 42138 +119
============================================
+ Hits 128103 128447 +344
- Misses 202396 203033 +637 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py:98
- This comment appears to contain commented-out code.
# if not self.has_request_pools(model_id, device.index):
# # TODO: choose a device based on some strategy
# device = self.DEFAULT_DEVICE
# actions = self._pool_scheduler.schedule(model_id, device)
# for action in actions:
# if action.action == ScaleActionType.SCALE_UP:
# # initialize the first pool
# self._first_pool_init(action.model_id, str(device))
# # start a background thread to expand pools
# expand_thread = threading.Thread(
# target=self._expand_pools_on_device,
# args=(action.model_id, str(device), action.amount - 1),
# daemon=True,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…otdb into pkg-ain-via-pyinstaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py:98
- This comment appears to contain commented-out code.
# if not self.has_request_pools(model_id, device.index):
# # TODO: choose a device based on some strategy
# device = self.DEFAULT_DEVICE
# actions = self._pool_scheduler.schedule(model_id, device)
# for action in actions:
# if action.action == ScaleActionType.SCALE_UP:
# # initialize the first pool
# self._first_pool_init(action.model_id, str(device))
# # start a background thread to expand pools
# expand_thread = threading.Thread(
# target=self._expand_pools_on_device,
# args=(action.model_id, str(device), action.amount - 1),
# daemon=True,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
SpriCoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM~
|
LTGM~ |
(cherry picked from commit 49c625b)
(cherry picked from commit 49c625b)
* [AINode] Refactor code base * [AINode] Implement concurrent inference framework (#16311) (cherry picked from commit 7b9ec7e) * [AINode] Fix bugs for SHOW LOADED MODELS (#16410) (cherry picked from commit 40b2b33) * [AINode] Add a batcher for inference (#16411) (cherry picked from commit 7734331) * [AINode][Bug fix] Concurrent inference (#16518) * trigger CI * bug fix 4 show loaded models (cherry picked from commit b4dde12) * [AINode] Concurrent inference bug fix (#16595) (cherry picked from commit 46a0c6a) * [AINode] Adjust the maximum inference input length (#16640) (cherry picked from commit 2c9064f) * [AINode] Fix bug of sundial and forecast udf (#16768) (cherry picked from commit 2b47be7) * [AINode] Package AINode via PyInstaller (#16707) (cherry picked from commit 49c625b) * [AINode] Enable AINode start as background (-d) (#16762) (cherry picked from commit 1ebb951) * [AINode] Update AINodeClient for DataNode to borrow (#16647) (cherry picked from commit d49d7dd) * [AINode] Fix bug that AINode cannot compile in Windows (#16767) (cherry picked from commit cd443ba) * [AINode] Delete poetry.lock for easier maintain different operating systems (#16793) (cherry picked from commit 50f92e4) * [AINode] Fix cp errors --------- Co-authored-by: Leo <[email protected]> Co-authored-by: jtmer <[email protected]> Co-authored-by: Zeyu Zhang <[email protected]>
(cherry picked from commit 49c625b)



Recently, we heard lots of our users complaint about the entry level for registering our AINode into their deployed IoTDB clusters. Practically, installing AINode requires the user config the correct python version, which is usually accomplished via pyenv or conda etc., and maintain smooth network connection to download python dependencies and model weight files. Nevertheless, as an application program like both the ConfigNode and the DataNode of IoTDB, the AINode is naturally required to be easy to use, aka can be started through a simple line of instruction.
As a result, we realized the former solution--packaging AINode as a python whl--is wrong! To bridge the gap between the Apache IoTDB community and our users, in this PR, we refactored the package pipeline from a whl to an application program! With this new feature, we are now proudly announce that, everyone could easily enjoy the cutting-edge research achievements of the time series models since our next official release by the following command,
./sbin/start-ainode.<sh/bat>without any strenuously environmental setup process!