Skip to content

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

Draft
wants to merge 4 commits into
base: latch/3.x.x
Choose a base branch
from
Draft

forch draft #70

wants to merge 4 commits into from

Conversation

ayushkamat
Copy link

No description provided.

Signed-off-by: Ayush Kamat <ayush@latch.bio>

@Override
protected TaskMonitor createTaskMonitor() {
return TaskPollingMonitor.create(session, name, 100, Duration.of("15s"))
Copy link
Member

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()
Copy link
Member

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
Copy link
Member

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

gpus: int


async def create_task(payload: CreateTaskInput):
Copy link
Member

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

]


async def get_task_status(task_id: int):
Copy link
Member

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

coalesce(
(
select
(
Copy link
Member

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

'submitted'
when te.type = 'container-created' then
'running'
when te.type = 'container-exited' then
Copy link
Member

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


async def main():
await pool.open()
args = sys.argv[1:]
Copy link
Member

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>
Signed-off-by: Ayush Kamat <ayush@latch.bio>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants