File size: 1,899 Bytes
b458825
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# setup.py
import configparser
# Monkey-patch for Python 3: define SafeConfigParser for stdeb compatibility
configparser.SafeConfigParser = configparser.RawConfigParser

from setuptools import setup, find_packages

# Load long description from README
with open("README.md", encoding="utf-8") as f:
    long_desc = f.read()

setup(
    name="distributed-task-system",
    version="1.0",
    description="A simple distributed task offload system",
    long_description=long_desc,
    long_description_content_type="text/markdown",
    author="Osama Awartany",
    author_email="osama@example.com",
    url="https://github.com/yourusername/distributed-task-system",
    packages=find_packages(include=["offload_core", "offload_core.*"]),
    py_modules=["dts_cli"],  # Include the CLI helper module
    install_requires=[
        "flask",
        "requests",
        "psutil",
        "zeroconf",
        "flask_cors",
        "numpy",
        "uvicorn"
    ],
    entry_points={
        "console_scripts": [
            "dts-start=dts_cli:main",
        ],
    },
    data_files=[
        ("/etc/systemd/system", ["dts.service"])
    ],
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: POSIX :: Linux",
    ],
    python_requires='>=3.6',
)


# dts_cli.py
# CLI entry-point module for the Distributed Task System
# Place this next to setup.py

def main():
    """
    Main entry for dts-start console script.
    Launches the FastAPI/Flask app via Uvicorn.
    """
    # Import your application instance here:
    try:
        from offload_core.main import app
    except ImportError:
        # If you have a factory, adjust accordingly:
        from offload_core.main import create_app
        app = create_app()

    # Run with Uvicorn
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=7520)