-
Notifications
You must be signed in to change notification settings - Fork 0
forch draft #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: latch/3.x.x
Are you sure you want to change the base?
forch draft #70
Conversation
|
||
@Override | ||
protected TaskMonitor createTaskMonitor() { | ||
return TaskPollingMonitor.create(session, name, 100, Duration.of("15s")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
del the ForchTaskMonitor
? or is that going to be used later?
idk what the downsides of the TaskPollingMonitor
are
|
||
String command = "forch status ${forchTaskId}" | ||
StringBuilder stdout = new StringBuilder(), stderr = new StringBuilder(); | ||
Process proc = command.execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this API is crazy wtf Groovy
|
||
@Override | ||
void kill() { | ||
// noop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi you can insert a container-killed
event (if it's running) or set cancelled
on the task (if it's not running) to kill it
see pods-stop
in nucleus
forch_interface.py
Outdated
gpus: int | ||
|
||
|
||
async def create_task(payload: CreateTaskInput): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u can just wrap this function in with_conn_retry
without a helper, since it doesn't do anything else
forch_interface.py
Outdated
] | ||
|
||
|
||
async def get_task_status(task_id: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap with @with_conn_retry
directly
forch_interface.py
Outdated
coalesce( | ||
( | ||
select | ||
( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the indentation is looking sus
forch_interface.py
Outdated
'submitted' | ||
when te.type = 'container-created' then | ||
'running' | ||
when te.type = 'container-exited' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably also want to consider the forch_pub.tasks.cancelled_at
field
forch_interface.py
Outdated
|
||
async def main(): | ||
await pool.open() | ||
args = sys.argv[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use argparse, it's probably easier to dela with than sys.argv
form argparse import ArgumentParser
argp = ArgumentParser("forch")
cmds = argp.add_subparsers()
argp_create = cmds.add_parser("create")
argp_create.add_argument("spec")
argp_status = cmds.add_parser("status")
argp_status.add_argument("task_id")
args = argp.parse_args()
Signed-off-by: Ayush Kamat <ayush@latch.bio>
Signed-off-by: Ayush Kamat <ayush@latch.bio>
No description provided.