FNNDSC / pman

A process management system written in python
MIT License
22 stars 33 forks source link

Overhaul of command specification #203

Closed jennydaman closed 1 year ago

jennydaman commented 2 years ago

Currently pman's API accepts an object which looks like this:

{
    "cmd_args": "string",
    "cmd_path_flags": "string",
    "auid": "string",
    "number_of_workers": 1,
    "cpu_limit": 1000,
    "memory_limit": 200,
    "gpu_limit": 0,
    "image": "fnndsc/pl-bulk-rename:0.1.1",
    "selfexec": "bulkrename",
    "selfpath": "string",
    "execshell": "string",
    "type": "ds",
    "jid": "crispy-176"
}

A much simpler and more correct data type which would emcompass cmd_args, selfpath, selfexec, and execshell would just be to have one value command which is a list of strings. This is how everything else does it (Python subprocess, Dockerfile, Kubernetes container spec, ...)

I propose CUBE, pfcon, and pman should be changed so that:

  1. CUBE assembles selfpath, selfexec, execshell, and any arguments as one list of strings called command
  2. CUBE sends command to pfcon
  3. pfcon sends command to pman
  4. the AbstractManager of pman sends command to the runtime API (which, in every known case such as docker and kubernetes, accepts a list of strings)

This proposal would solve #202

jennydaman commented 1 year ago

Solved-ish https://github.com/FNNDSC/pman/commit/afc1be1ddc83095335efbc990b3c3cea8ce0d558