vatlab / sos

SoS workflow system for daily data analysis
http://vatlab.github.io/sos-docs
BSD 3-Clause "New" or "Revised" License
274 stars 45 forks source link

Template for variable for task or workflow id #1325

Closed BoPeng closed 4 years ago

BoPeng commented 4 years ago

Right now we use {task} for task_id in task_template, and {workflow_id} for workflow ID for workflow_template. These IDs are usually used for job name.

However, although this works all right if the variables are used in different templates, it does not work for submit_cmd, as in the example for task spooler where the ID should be specified from command line.

        submit_cmd: ts -L {workflow_id} sh {job_file}

In this case an template-neutral ID should be used for submit_cmd because submit_cmd, as defined, cannot be used for task submission.

gaow commented 4 years ago

How about calling both job_id and let the context decide if it is task_id or workflow_id?

We might have backwards compatibility issue ... but it wouldn't bother me.

BoPeng commented 4 years ago

job_id is currently used for

        status_cmd: ts -s {job_id}
        kill_cmd: ts -r {job_id}

but these two commands are not used at all right now for sos-pbs.

BTW, current job_id is the id returned from PBS system as in the output of submit_cmd.

gaow commented 4 years ago

Hmm is it true that a good solution here is to use one variable name to refer to both type of ID's? How about just job then?

BoPeng commented 4 years ago

Or job_name as it is used for such purpose anyway. It is also easy to keep backward compatibility (allow both job_name and task )

BoPeng commented 4 years ago

Use job_name now.