Skip to content
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

Task template #70

Closed
achimnol opened this issue Nov 13, 2019 · 3 comments
Closed

Task template #70

achimnol opened this issue Nov 13, 2019 · 3 comments
Assignees
Labels
comp:manager Related to Manager component type:feature Add new features
Projects
Milestone

Comments

@achimnol
Copy link
Member

achimnol commented Nov 13, 2019

Let's make the parameter sets for batch sessions (#42) to be reusable and referrable by task graph API (#43).

A template should include:

  • The kernel image
  • Resource specification
  • The batch command to execute
  • The vfolder mounts
  • Bootstrap script (encoded as base64) → Support for user-defined boostrap script #77
  • Timeout (maybe infinite)
  • Git repository auto-clone parameters (repo URL, credentials, target commit/branch)

A template can be used in the following contexts:

  • Just run a single session using the template
  • Run a task graph composed of multiple, staged tasks from multiple templates
    • In this case, each session will have /home/work/input and /home/work/output directories which are auto-created vfolders by the smanager for the input/output connection between different stages.
    • It may also have the task sequence number as a special environment variable so that each task may determine the partition of input data to process or the parameters to use with its computation, for parallelized tasks in the same stage.

┆Issue is synchronized with this Asana task by Unito

@achimnol achimnol added this to the 19.12 milestone Nov 13, 2019
@achimnol achimnol added this to Requirements in ML Pipeline via automation Nov 13, 2019
@kyujin-cho
Copy link
Member

kyujin-cho commented Dec 13, 2019

Initial design of the template:

---
api_version: v1
kind: taskTemplate
metadata:
  name: template1234
  tag: example-tag
spec:
  kernel:
    environ:
      MYCONFIG: XXX
    git:
      branch: '19.09'
      commit: 10daee9e328876d75e6d0fa4998d4456711730db
      repository: https://github.com/lablup/backend.ai-agent
      destinationDir: /home/work/baiagent
    image: python:3.6-ubuntu18.04
    run:
      bootstrap: IyEvYmluL3NoCmNkICRIT01FCm1rZGlyIHRtcDEKZWNobyAiMTIzNDUiID4gdG1wMS90ZXN0LnR4dAo=
  resources:
    cpu: '2'
    mem: 4g
  mounts:
    hostpath-test: /home/work/hostDesktop
    test-vfolder: 
  sessionType: interactive

Value of mount object's item means where to mount vFolder; this value is (of course) optional.
All other items are as-is.

@achimnol
Copy link
Member Author

achimnol commented Dec 17, 2019

I first thought to store the task template as a database record with concrete columns, but it would be better to store just the YAML as you suggested for forward compatibility.
Let's just add a task_templates table to the manager which contains the ownership information (user, group, domain) along with a minimal set of metadata (id, created_at, is_active) and a text column content which stores the YAML template. Please implement all CRUD operations as in the agents as REST APIs.

@achimnol achimnol moved this from Requirements to In progress in ML Pipeline Dec 20, 2019
achimnol added a commit to lablup/backend.ai-client-py that referenced this issue Jan 2, 2020
* Corresponds to lablup/backend.ai#70 and lablup/backend.ai-manager#213
* New "SessionTemplate" functional SDK APIs and "backend.ai sesstpl" command set.
* Documentation including CLI examples

Co-authored-by: Joongi Kim <me@daybreaker.info>
@achimnol achimnol added the comp:manager Related to Manager component label Jan 20, 2020
@achimnol achimnol added type:feature Add new features and removed feature-request labels Feb 6, 2020
@achimnol achimnol modified the milestones: 19.12, 20.03 Jul 28, 2020
@achimnol
Copy link
Member Author

We're finally done, but later I will revisit this to test more thoroughly.

ML Pipeline automation moved this from In progress to Done Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component type:feature Add new features
Projects
No open projects
ML Pipeline
  
Done
Development

No branches or pull requests

2 participants