mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-19 02:54:28 -05:00
### Background
This PR adds support on IPC on autogpt_server.
To make this happen, there are a couple of refactoring efforts being made (will be described in the `Changes` section).
Currently, there are three independent processes:
```
AgentServer ----> ExecutionManager
|
--> ExecutionScheduler
```
### Changes 🏗️
* Added Pyro5 for IPC support.
* Introduced `AppService`: a class to construct an independent process that can expose a method to other running processes (this is analogous to a microservice).
* Introduced `AppProcess`: used by `AppService` a class for creating a child process that can be executed in the background.
* Adapting existing codebase to user `AppService`.
82 lines
2.3 KiB
Python
82 lines
2.3 KiB
Python
from pkgutil import iter_modules
|
|
from shutil import which
|
|
|
|
from cx_Freeze import Executable, setup
|
|
|
|
packages = [
|
|
m.name
|
|
for m in iter_modules()
|
|
if m.ispkg and m.module_finder and "poetry" in m.module_finder.path # type: ignore
|
|
]
|
|
packages.append("collections")
|
|
|
|
# if mac use the icns file, otherwise use the ico file
|
|
icon = (
|
|
"../../assets/gpt_dark_RGB.icns"
|
|
if which("sips")
|
|
else "../../assets/gpt_dark_RGB.ico"
|
|
)
|
|
|
|
setup(
|
|
name="AutoGPT Server",
|
|
url="https://agpt.co",
|
|
# The entry points of the application
|
|
executables=[
|
|
Executable(
|
|
"autogpt_server/app.py",
|
|
target_name="agpt_server",
|
|
base="console",
|
|
icon=icon,
|
|
),
|
|
Executable(
|
|
"autogpt_server/cli.py",
|
|
target_name="agpt_server_cli",
|
|
base="console",
|
|
icon=icon,
|
|
),
|
|
],
|
|
options={
|
|
# Options for building all the executables
|
|
"build_exe": {
|
|
"packages": packages,
|
|
"includes": [
|
|
"autogpt_server",
|
|
"uvicorn.loops.auto",
|
|
"uvicorn.protocols.http.auto",
|
|
"uvicorn.protocols.websockets.auto",
|
|
"uvicorn.lifespan.on",
|
|
],
|
|
# Exclude the two module from readability.compat as it causes issues
|
|
"excludes": ["readability.compat.two"],
|
|
},
|
|
# Mac .app specific options
|
|
"bdist_mac": {
|
|
"bundle_name": "AutoGPT",
|
|
"iconfile": "../../assets/gpt_dark_RGB.icns",
|
|
# "include_resources": ["IMG_3775.jpeg"],
|
|
},
|
|
# Mac .dmg specific options
|
|
"bdist_dmg": {
|
|
"applications_shortcut": True,
|
|
"volume_label": "AutoGPTServer",
|
|
},
|
|
# Windows .msi specific options
|
|
"bdist_msi": {
|
|
"target_name": "AutoGPTServer",
|
|
"add_to_path": True,
|
|
"install_icon": "../../assets/gpt_dark_RGB.ico",
|
|
},
|
|
# Linux .appimage specific options
|
|
"bdist_appimage": {},
|
|
# Linux rpm specific options
|
|
"bdist_rpm": {
|
|
"name": "AutoGPTServer",
|
|
"description": "AutoGPT Server",
|
|
"version": "0.1",
|
|
"license": "UNKNOWNORPROPRIETARY",
|
|
"url": "https://agpt.co",
|
|
"long_description": "AutoGPT Server",
|
|
},
|
|
},
|
|
)
|