Skip to content

Commit d0f089e

Browse files
committed
lint
1 parent b8f0b0c commit d0f089e

7 files changed

Lines changed: 38 additions & 18 deletions

File tree

‎datatorch/agent/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ async def stop() -> None:
139139

140140
print(" ")
141141

142-
logger.warning("Gracefully exiting agent.")
142+
logger.warning("Gracefully exiting runner.")
143143

144-
logger.info("Closing agent jobs.")
144+
logger.info("Closing runner jobs.")
145145
await _exit_jobs()
146146

147-
logger.info("Closing agent jobs.")
147+
logger.info("Closing runner jobs.")
148148
await _exit_jobs()
149149

150150
logger.info("Closing all other tasks.")

‎datatorch/cli/agent/__init__.py‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,28 @@
55
from .dir import dir
66

77

8-
@click.group(help="Commands for managing agents.")
9-
def agent():
8+
@click.group(
9+
name="runner",
10+
help=(
11+
"Commands for managing runners — self-hosted compute that "
12+
"executes pipeline jobs. (Formerly 'agent'.)"
13+
),
14+
)
15+
def runner():
1016
pass
1117

1218

13-
agent.add_command(start)
14-
agent.add_command(create)
15-
agent.add_command(dir)
19+
runner.add_command(start)
20+
runner.add_command(create)
21+
runner.add_command(dir)
22+
23+
# Deprecated alias: `datatorch agent <cmd>` keeps working for existing
24+
# installs/scripts, sharing the exact command objects; hidden from
25+
# --help so new users learn `runner`. The wire protocol (agent token,
26+
# GraphQL mutations) and the on-disk agent directory are unchanged.
27+
agent = click.Group(
28+
name="agent",
29+
commands=runner.commands,
30+
hidden=True,
31+
help="Deprecated alias for 'runner'.",
32+
)

‎datatorch/cli/agent/create.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ def create(ctx):
3535
agent_settings = agent_directory.settings
3636

3737
if agent_settings.agent_id:
38-
click.echo("An agent is already installed.")
39-
confirmed = click.confirm("Would you like to create a new agent?", default=True)
38+
click.echo("A runner is already installed.")
39+
confirmed = click.confirm(
40+
"Would you like to create a new runner?", default=True
41+
)
4042
if not confirmed:
4143
return
4244

@@ -48,17 +50,17 @@ def create(ctx):
4850
if not user_settings.api_key:
4951
ctx.invoke(login, host=user_settings.api_url)
5052

51-
name = click.prompt("Enter agents name", default=platform.node(), show_default=True)
52-
spinner = Spinner("Creating agent")
53+
name = click.prompt("Enter runner name", default=platform.node(), show_default=True)
54+
spinner = Spinner("Creating runner")
5355

5456
try:
5557
agent = create_agent(name)["createAgent"]
5658
agent_settings.agent_id = agent["agent"]["id"]
5759
agent_settings.agent_token = agent["token"]
5860
agent_settings.api_url = user_settings.api_url
5961
except Exception as ex:
60-
spinner.done(click.style("Failed to new create agent.", fg="red"))
62+
spinner.done(click.style("Failed to create runner.", fg="red"))
6163
click.echo(ex)
6264
return
6365

64-
spinner.done("Successfully created agent.")
66+
spinner.done("Successfully created runner.")

‎datatorch/cli/agent/dir.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from datatorch.agent import agent_directory
66

77

8-
@click.command(help="Opens agent directory where settings and files are stored.")
8+
@click.command(help="Opens the runner directory where settings and files are stored.")
99
def dir():
1010
path = agent_directory.dir
1111
if platform.system() == "Windows":

‎datatorch/cli/agent/start.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def add_signal_handlers(loop: AbstractEventLoop):
1515
pass # Ignore if not implemented. Means this program is running in windows.
1616

1717

18-
@click.command(help="Run an agent")
18+
@click.command(help="Start the runner (executes pipeline jobs on this machine)")
1919
def start():
2020
loop = asyncio.new_event_loop()
2121
asyncio.set_event_loop(loop)

‎datatorch/cli/groups.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .main.upgrade import package_upgrade
1010
from .main.version import version
1111

12-
from .agent import agent
12+
from .agent import agent, runner
1313
from .pipeline import pipeline
1414
from .action import action
1515
from .import_cmds import import_cmd
@@ -29,6 +29,7 @@ def main():
2929
main.add_command(package_upgrade)
3030

3131
main.add_command(pipeline)
32+
main.add_command(runner)
3233
main.add_command(agent)
3334
main.add_command(action)
3435
main.add_command(import_cmd)

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
setup(
3535
name="datatorch",
36-
version="0.6.4",
36+
version="0.7.0",
3737
description="A CLI and library for interacting with DataTorch.",
3838
author="DataTorch",
3939
author_email="support@datatorch.io",

0 commit comments

Comments
 (0)