Skip to content

Conversation

@CRZbulabula
Copy link
Contributor

@CRZbulabula CRZbulabula commented Nov 7, 2025

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!

@CRZbulabula CRZbulabula requested a review from Copilot November 7, 2025 04:26
Copy link
Contributor

Copilot AI left a 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.py and ainode.spec configuration
  • Removes venv setup scripts (ainode-env.sh and ainode-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
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.74%. Comparing base (b6c6c7a) to head (c65ac2c).
⚠️ Report is 21 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CRZbulabula CRZbulabula requested a review from Copilot November 9, 2025 09:38
Copy link
Contributor

Copilot AI left a 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.

@CRZbulabula CRZbulabula requested a review from Copilot November 9, 2025 09:56
Copy link
Contributor

Copilot AI left a 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.

@CRZbulabula CRZbulabula changed the title Package AINode via PyInstaller [AINode] Package AINode via PyInstaller Nov 11, 2025
@sonarqubecloud
Copy link

Copy link
Contributor

@SpriCoder SpriCoder left a comment

Choose a reason for hiding this comment

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

LTGM~

@RkGrit
Copy link
Contributor

RkGrit commented Nov 12, 2025

LTGM~

@CRZbulabula CRZbulabula merged commit 49c625b into master Nov 12, 2025
30 of 32 checks passed
@CRZbulabula CRZbulabula deleted the pkg-ain-via-pyinstaller branch November 12, 2025 08:42
JackieTien97 pushed a commit that referenced this pull request Nov 26, 2025
CRZbulabula added a commit that referenced this pull request Dec 16, 2025
CRZbulabula added a commit that referenced this pull request Dec 16, 2025
* [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]>
CRZbulabula added a commit that referenced this pull request Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants