Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev-3.0.0-rc' into feature-3.0.0…
Browse files Browse the repository at this point in the history
…-rc-pr
  • Loading branch information
Xiong-Li-github committed Dec 18, 2023
2 parents fc2c4f1 + fca0ae7 commit 4680082
Show file tree
Hide file tree
Showing 23 changed files with 137 additions and 728 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import click
import time

from eggroll.client.sdk import EggrollClient
from eggroll.deepspeed.sdk_client import EggrollClient
from ..utils.cli_utils import prettify, unzip
from eggroll.config import Config

Expand Down Expand Up @@ -70,27 +70,25 @@ def submit(ctx, **kwargs):
f"deepspeed_session_{datetime.datetime.now().strftime('%Y%m%d-%H%M%S-%f')}"
)
print(f"session_id:{session_id}")
client.task.submit(
client._session_id = session_id
client.submit(
world_size=world_size,
files=files,
resource_options=resource_options,
options=options,
command_arguments=command_arguments,
session_id=session_id,
)

while True:
response = client.task.query_status(session_id=session_id)
response = client.query_status()
print(f'task session_id:{session_id} status:{response["status"]}')
time.sleep(1)
if response["status"] != "NEW":
break
log_type = kwargs.get("log_type") if not kwargs.get("log_type") else "stdout"
response = client.task.get_log(
config=config, sessionId=session_id, logType=log_type
)
response = client.get_log(sessionId=session_id, logType=log_type)
if response["status"]:
response = client.task.query_status(session_id=session_id)
response = client.query_status()
prettify(response)


Expand All @@ -99,7 +97,8 @@ def submit(ctx, **kwargs):
@click.pass_context
def query(ctx, **kwargs):
client: EggrollClient = ctx.obj["client"]
response = client.task.query_status(session_id=kwargs.get("session_id"))
client._session_id = kwargs.get("session_id")
response = client.query_status()
prettify(response)


Expand All @@ -108,7 +107,8 @@ def query(ctx, **kwargs):
@click.pass_context
def kill(ctx, **kwargs):
client: EggrollClient = ctx.obj["client"]
response = client.task.kill_job(session_id=kwargs.get("session_id"))
client._session_id = kwargs.get("session_id")
response = client.kill()
prettify(response)


Expand All @@ -117,7 +117,8 @@ def kill(ctx, **kwargs):
@click.pass_context
def stop(ctx, **kwargs):
client: EggrollClient = ctx.obj["client"]
response = client.task.stop_job(session_id=kwargs.get("session_id"))
client._session_id = kwargs.get("session_id")
response = client.stop()
prettify(response)


Expand All @@ -136,15 +137,15 @@ def stop(ctx, **kwargs):
def download(ctx, **kwargs):
client: EggrollClient = ctx.obj["client"]
download_dir = kwargs.get("download_dir")
status = client.task.query_status(session_id=kwargs.get("session_id"))
if status["message"]:
return prettify(status)
client._session_id = kwargs.get("session_id")
response = client.query_status()
if response.get("message", None):
return prettify(response)

os.makedirs(download_dir, exist_ok=True)
with tempfile.TemporaryDirectory() as temp_dir:
rank_to_path = lambda rank: f"{temp_dir}/{rank}.zip"
client.task.download_job_to(
session_id=kwargs.get("session_id"),
client.download_job_to(
rank_to_path=rank_to_path,
content_type=kwargs.get("content_type"),
ranks=kwargs.get("ranks", None),
Expand Down Expand Up @@ -176,8 +177,8 @@ def download(ctx, **kwargs):
def get_log(ctx, **kwargs):
config = Config().load_default()
client: EggrollClient = ctx.obj["client"]
response = client.task.get_log(
config=config,
client._session_id = kwargs.get("session_id")
response = client.get_log(
sessionId=kwargs.get("session_id"),
rank=kwargs.get("rank"),
path=kwargs.get("path"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

import click
from ruamel import yaml

from eggroll.client.cli.commands import task
from eggroll.client.sdk import EggrollClient
from eggroll.cli.commands import task
from eggroll.deepspeed.sdk_client import EggrollClient
from eggroll.config import Config

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
Expand Down Expand Up @@ -55,7 +54,7 @@ def eggroll_cli(ctx, eggroll_properties):
config.load_properties(eggroll_properties)
config.load_env()
ctx.obj["client"] = EggrollClient(
config=config, ip=cli_config.get("ip"), port=cli_config.get("port")
config=config, host=cli_config.get("ip"), port=cli_config.get("port")
)


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions python/eggroll/client/sdk/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions python/eggroll/client/sdk/_client.py

This file was deleted.

16 changes: 0 additions & 16 deletions python/eggroll/client/sdk/api/__init__.py

This file was deleted.

Loading

0 comments on commit 4680082

Please sign in to comment.