unitlab 2.3.41__tar.gz → 2.3.42__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.
- {unitlab-2.3.41/src/unitlab.egg-info → unitlab-2.3.42}/PKG-INFO +1 -1
- {unitlab-2.3.41 → unitlab-2.3.42}/setup.py +1 -1
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/main.py +1 -1
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/persistent_tunnel.py +27 -22
- {unitlab-2.3.41 → unitlab-2.3.42/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.3.41 → unitlab-2.3.42}/LICENSE.md +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/README.md +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/setup.cfg +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/__init__.py +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/__main__.py +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/client.py +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab/utils.py +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.3.41 → unitlab-2.3.42}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -122,7 +122,7 @@ def dataset_download(
|
|
122
122
|
def run_agent(
|
123
123
|
api_key: API_KEY,
|
124
124
|
device_id: Annotated[str, typer.Option(help="Device ID")] = None,
|
125
|
-
base_domain: Annotated[str, typer.Option(help="Base domain for tunnels")] = "
|
125
|
+
base_domain: Annotated[str, typer.Option(help="Base domain for tunnels")] = "api-dev.unitlab.ai",
|
126
126
|
|
127
127
|
):
|
128
128
|
|
@@ -38,7 +38,7 @@ class PersistentTunnel:
|
|
38
38
|
|
39
39
|
# Clean device ID for subdomain
|
40
40
|
if device_id:
|
41
|
-
self.device_id = device_id.replace('
|
41
|
+
self.device_id = device_id.replace('_', '').replace('.', '').lower()[:30]
|
42
42
|
else:
|
43
43
|
import uuid
|
44
44
|
self.device_id = str(uuid.uuid4())[:8]
|
@@ -151,26 +151,26 @@ class PersistentTunnel:
|
|
151
151
|
return False
|
152
152
|
|
153
153
|
# First, check if SSH DNS record exists and delete it
|
154
|
-
print("🔍 Checking for existing SSH DNS record: {}.{}".format(self.ssh_subdomain, self.domain))
|
155
|
-
list_url = "{}?name={}.{}".format(url, self.ssh_subdomain, self.domain)
|
156
|
-
list_response = requests.get(list_url, headers=headers)
|
157
|
-
|
158
|
-
if list_response.status_code == 200:
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
else:
|
173
|
-
|
154
|
+
# print("🔍 Checking for existing SSH DNS record: {}.{}".format(self.ssh_subdomain, self.domain))
|
155
|
+
# list_url = "{}?name={}.{}".format(url, self.ssh_subdomain, self.domain)
|
156
|
+
# list_response = requests.get(list_url, headers=headers)
|
157
|
+
|
158
|
+
# if list_response.status_code == 200:
|
159
|
+
# records = list_response.json().get("result", [])
|
160
|
+
# print("Found {} existing DNS records".format(len(records)))
|
161
|
+
# print('this is new version')
|
162
|
+
# for record in records:
|
163
|
+
# if record["name"] == "{}.{}".format(self.ssh_subdomain, self.domain):
|
164
|
+
# record_id = record["id"]
|
165
|
+
# print("🗑️ Deleting old SSH DNS record: {}".format(record_id))
|
166
|
+
# delete_url = "{}/{}".format(url, record_id)
|
167
|
+
# delete_response = requests.delete(delete_url, headers=headers)
|
168
|
+
# if delete_response.status_code in [200, 204]:
|
169
|
+
# print("✅ Deleted old SSH DNS record")
|
170
|
+
# else:
|
171
|
+
# print("⚠️ Could not delete old SSH DNS record: {}".format(delete_response.text[:200]))
|
172
|
+
# else:
|
173
|
+
# print("⚠️ Could not list DNS records: {}".format(list_response.text[:200]))
|
174
174
|
|
175
175
|
# Wait a moment for DNS deletion to propagate
|
176
176
|
time.sleep(2)
|
@@ -263,15 +263,20 @@ class PersistentTunnel:
|
|
263
263
|
f.write("credentials-file: {}\n\n".format(cred_file))
|
264
264
|
f.write("ingress:\n")
|
265
265
|
|
266
|
-
|
266
|
+
# SSH service on dedicated subdomain (s{deviceid}.unitlab-ai.com)
|
267
267
|
f.write(" - hostname: {}.{}\n".format(self.ssh_subdomain, self.domain))
|
268
268
|
f.write(" service: ssh://localhost:22\n")
|
269
269
|
|
270
|
+
|
271
|
+
|
272
|
+
|
270
273
|
# API (more specific path goes first)
|
271
274
|
f.write(" - hostname: {}.{}\n".format(self.subdomain, self.domain))
|
272
275
|
f.write(" path: /api-agent/*\n")
|
273
276
|
f.write(" service: http://localhost:8001\n")
|
274
277
|
|
278
|
+
|
279
|
+
|
275
280
|
# Jupyter (general hostname for HTTP)
|
276
281
|
f.write(" - hostname: {}.{}\n".format(self.subdomain, self.domain))
|
277
282
|
f.write(" service: http://localhost:8888\n")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|