nexuscompute-sdk 2.2.2__tar.gz → 2.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/PKG-INFO +1 -1
  2. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/cli.py +25 -0
  3. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/provider.py +2 -0
  4. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexuscompute_sdk.egg-info/PKG-INFO +1 -1
  5. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/setup.py +1 -1
  6. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/__init__.py +0 -0
  7. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/client.py +0 -0
  8. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/compute_ops.py +0 -0
  9. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/compute_worker_cli.py +0 -0
  10. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexus_sdk/docker_sandbox.py +0 -0
  11. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexuscompute_sdk.egg-info/SOURCES.txt +0 -0
  12. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexuscompute_sdk.egg-info/dependency_links.txt +0 -0
  13. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexuscompute_sdk.egg-info/entry_points.txt +0 -0
  14. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexuscompute_sdk.egg-info/requires.txt +0 -0
  15. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/nexuscompute_sdk.egg-info/top_level.txt +0 -0
  16. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/setup.cfg +0 -0
  17. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/tests/test_api.py +0 -0
  18. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/tests/test_compute_ops.py +0 -0
  19. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/tests/test_docker.py +0 -0
  20. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/tests/test_docker_edge.py +0 -0
  21. {nexuscompute_sdk-2.2.2 → nexuscompute_sdk-2.2.4}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nexuscompute-sdk
3
- Version: 2.2.2
3
+ Version: 2.2.4
4
4
  Summary: NexusCompute Unified SDK — python client for renting compute and hosting provider nodes (API key auth)
5
5
  Author: NexusCompute
6
6
  Classifier: Programming Language :: Python :: 3
@@ -144,6 +144,7 @@ def provider_cli():
144
144
  parser.add_argument("--token", help="Hardware node connection token")
145
145
  parser.add_argument("--api-url", default="https://nexuscompute.net/api/v1", help="Nexus API Endpoint URL")
146
146
  parser.add_argument("--detect", action="store_true", help="Detect system specifications and print them as JSON")
147
+ parser.add_argument("--daemon", action="store_true", help="Run the provider in the background as a daemon")
147
148
 
148
149
  args = parser.parse_args()
149
150
 
@@ -156,6 +157,30 @@ def provider_cli():
156
157
  parser.print_help()
157
158
  print("\nError: --token is required to run the provider agent.", file=sys.stderr)
158
159
  sys.exit(1)
160
+ if args.daemon:
161
+ import subprocess
162
+ import os
163
+
164
+ # Build the command line without --daemon
165
+ cmd = [sys.executable] + [arg for arg in sys.argv if arg != "--daemon"]
166
+
167
+ print("Starting provider in the background (daemon mode)...")
168
+ # On Windows, creationflags=subprocess.DETACHED_PROCESS or creationflags=subprocess.CREATE_NEW_PROCESS_GROUP
169
+ # On Unix, start_new_session=True
170
+ if os.name == 'nt':
171
+ kwargs = {'creationflags': 0x00000008} # DETACHED_PROCESS
172
+ else:
173
+ kwargs = {'start_new_session': True}
174
+
175
+ p = subprocess.Popen(
176
+ cmd,
177
+ stdout=subprocess.DEVNULL,
178
+ stderr=subprocess.DEVNULL,
179
+ stdin=subprocess.DEVNULL,
180
+ **kwargs
181
+ )
182
+ print(f"Daemon started with PID: {p.pid}")
183
+ sys.exit(0)
159
184
 
160
185
  try:
161
186
  agent = Provider(token=args.token, api_url=args.api_url)
@@ -227,3 +227,5 @@ class Provider:
227
227
  time.sleep(1)
228
228
  except KeyboardInterrupt:
229
229
  print("\nStopping provider agent...")
230
+ if getattr(self, 'sandbox', None):
231
+ self.sandbox.teardown()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nexuscompute-sdk
3
- Version: 2.2.2
3
+ Version: 2.2.4
4
4
  Summary: NexusCompute Unified SDK — python client for renting compute and hosting provider nodes (API key auth)
5
5
  Author: NexusCompute
6
6
  Classifier: Programming Language :: Python :: 3
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="nexuscompute-sdk",
5
- version="2.2.2",
5
+ version="2.2.4",
6
6
  description="NexusCompute Unified SDK — python client for renting compute and hosting provider nodes (API key auth)",
7
7
  author="NexusCompute",
8
8
  packages=find_packages(),