datatorch 0.7.1__tar.gz → 0.7.2__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.
- {datatorch-0.7.1 → datatorch-0.7.2}/PKG-INFO +1 -1
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/__init__.py +35 -15
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/PKG-INFO +1 -1
- {datatorch-0.7.1 → datatorch-0.7.2}/setup.py +1 -1
- {datatorch-0.7.1 → datatorch-0.7.2}/README.md +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/agent.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/client.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/directory.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/log_handler.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/logging.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/monitoring.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/action/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/action/action.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/action/cache.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/action/config.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/job/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/job/job.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/pipeline.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/resolver.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/command.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/docker.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/factory.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/node.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/python.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/runner.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/runner/shell.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/step/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/step/step.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/pipelines/template.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/services/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/utils/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/utils/docker.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/agent/utils/process.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/api.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/client.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/annotation.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/base.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/dataset.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/file.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/label.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/project.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/settings.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/sources/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/sources/image/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/sources/image/bounding_box.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/sources/image/segmentations.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/sources/image/typings.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/sources/source.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/storage_link.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/entity/user.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/pull.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/scripts/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/scripts/import_coco.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/scripts/import_pixmask.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/scripts/utils/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/scripts/utils/simplify.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/utils.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/api/where.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/action/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/action/create.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/action/pull.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/action/run.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/agent/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/agent/create.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/agent/dir.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/agent/start.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/groups.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/import_cmds/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/import_cmds/coco.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/import_cmds/pixmask.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/main/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/main/login.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/main/logout.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/main/pull.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/main/upgrade.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/main/version.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/pipeline/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/pipeline/generate.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/pipeline/run.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/pipeline/upload.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/spinner.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/upload/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/upload/folder.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/cli/utils.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/core/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/core/env.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/core/folder.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/core/settings.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/__init__.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/converters.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/files.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/hash_table.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/objects.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/package.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/string_style.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch/utils/url.py +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/SOURCES.txt +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/dependency_links.txt +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/entry_points.txt +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/not-zip-safe +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/requires.txt +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/datatorch.egg-info/top_level.txt +0 -0
- {datatorch-0.7.1 → datatorch-0.7.2}/setup.cfg +0 -0
|
@@ -10,7 +10,7 @@ from .directory import agent_directory
|
|
|
10
10
|
from .agent import Agent, tasks
|
|
11
11
|
|
|
12
12
|
from gql import Client as GqlClient
|
|
13
|
-
from gql.transport.exceptions import
|
|
13
|
+
from gql.transport.exceptions import TransportError, TransportQueryError
|
|
14
14
|
from gql.transport.websockets import WebsocketsTransport
|
|
15
15
|
from websockets.exceptions import ConnectionClosed, InvalidMessage, InvalidURI
|
|
16
16
|
|
|
@@ -89,6 +89,22 @@ async def _exit_tasks() -> None:
|
|
|
89
89
|
task.cancel()
|
|
90
90
|
|
|
91
91
|
|
|
92
|
+
async def _restart_after_failure(transport, backoff_wait: float) -> float:
|
|
93
|
+
"""Tears down jobs, transport and tasks, then sleeps with backoff.
|
|
94
|
+
|
|
95
|
+
Returns the next backoff wait."""
|
|
96
|
+
await _exit_jobs()
|
|
97
|
+
await _close_transport(transport)
|
|
98
|
+
await _exit_tasks()
|
|
99
|
+
|
|
100
|
+
backoff_wait = min(BACKOFF_MAX, backoff_wait * BACKOFF_FACTOR)
|
|
101
|
+
logger.debug(
|
|
102
|
+
f"Sleeping for {round(backoff_wait)} seconds and then attempting restart."
|
|
103
|
+
)
|
|
104
|
+
await asyncio.sleep(backoff_wait)
|
|
105
|
+
return backoff_wait
|
|
106
|
+
|
|
107
|
+
|
|
92
108
|
async def start() -> None:
|
|
93
109
|
"""Creates and runs an agent."""
|
|
94
110
|
setup_logging()
|
|
@@ -108,32 +124,36 @@ async def start() -> None:
|
|
|
108
124
|
backoff_wait = BACKOFF_INIT_WAIT
|
|
109
125
|
await Agent.run(session)
|
|
110
126
|
|
|
127
|
+
except (asyncio.CancelledError, InvalidURI):
|
|
128
|
+
break
|
|
129
|
+
|
|
111
130
|
except (
|
|
112
131
|
# ConnectionClosed covers both the error and the "OK" close
|
|
113
132
|
# (a server-side restart closes cleanly); OSError covers the
|
|
114
133
|
# socket-level failures seen right after a laptop wakes
|
|
115
134
|
# (DNS gaierror, ConnectionReset, ConnectionRefused, timeouts).
|
|
135
|
+
# TransportQueryError is what gql raises when the socket drops
|
|
136
|
+
# while a query is in flight ("Query completed without any
|
|
137
|
+
# answer received from the server"); it is NOT a TransportError
|
|
138
|
+
# subclass in the installed gql, so it is listed on its own.
|
|
116
139
|
ConnectionClosed,
|
|
117
140
|
OSError,
|
|
118
141
|
IncompleteReadError,
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
TransportError,
|
|
143
|
+
TransportQueryError,
|
|
121
144
|
InvalidMessage,
|
|
122
145
|
asyncio.TimeoutError,
|
|
123
146
|
) as e:
|
|
124
|
-
await _exit_jobs()
|
|
125
|
-
await _close_transport(transport)
|
|
126
|
-
await _exit_tasks()
|
|
127
|
-
|
|
128
147
|
logger.error(e)
|
|
129
|
-
backoff_wait =
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
148
|
+
backoff_wait = await _restart_after_failure(transport, backoff_wait)
|
|
149
|
+
|
|
150
|
+
except Exception:
|
|
151
|
+
# Last resort: the loop must never die. On 2026-09-12 an
|
|
152
|
+
# uncaught exception here left the process alive for weeks
|
|
153
|
+
# with no agent loop, so the runner showed OFFLINE while its
|
|
154
|
+
# window looked fine.
|
|
155
|
+
logger.exception("Unexpected error in the agent loop; restarting.")
|
|
156
|
+
backoff_wait = await _restart_after_failure(transport, backoff_wait)
|
|
137
157
|
|
|
138
158
|
logger.info("Exiting job processing task.")
|
|
139
159
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|