Page MenuHomePhabricator

Allow customizing the out/err files with toolforge-jobs
Closed, DuplicatePublicFeature

Description

With jsub, you could use -e and -o to redirect stdout and stderr to some custom files (e.g. the same file for both). This is not possible when using the newer toolforge-jobs command, which will always use jobname.out and jobname.err.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Is this a duplicate of T301901? See also T302211 regarding the out/err merge option.

Is this a duplicate of T301901? See also T302211 regarding the out/err merge option.

I'd say related to both, but not a duplicate.

It does feel like this creates some kind of conflict with T301901 which already have two patches addressing it.

  1. should this ( --out and --err) take precedence over --logdir being introduced by T301901 ?
  2. What happens when one of --out or --err is not explicitly provided? my assumption is that we fallback to whatever path supplied by --logdir if present, or to the default 1>>{jobname}.out 2>>{jobname}.err

Is --logdir documented somewhere? The online man pages does not show it. Option -help does not show it too.

Its hard to decide any precedence when there is nothing to decide on.

Is --logdir documented somewhere? The online man pages does not show it. Option -help does not show it too.

Its hard to decide any precedence when there is nothing to decide on.

Not yet documented but we currently have two patches pending review that introduces --logdir. And since there is already some kind of consensus regarding the introduction of --logdir (no one is yet to prove that it is not a necessary change), it is reasonable to conclude that it is only are matter of time before this is satisfactorily reviewed and merged. In that sense, it makes sense to talk about precedence of the coming --logdir relative to T304421 and T302211

Okay.

For me(!) --logdir would be enough. I just want to have a (relative) clean home directory.

To clarify: I have currently ~50 scripts, a few are running day by day, the others run once per week or once per month. So without any option for redirecting I would end up with 100 additional files in the home-directory.

Yes, what bothers me is maybe providing too many options for customizing the handling of log files it too much overload?
perhaps --log-dir is enough? if so then maybe we should close this task. T302211 appears distinct enough so should be left as it is. what are your thoughts on this @bd808?

I feel we should probably close this if we are not trying to address a specific usecase with it and just focus on T302211 and T301901 . this is because the difference between T301901 and this task is just a matter of deciding on what level of granular control users should be given over controlling the destination of stdout and stderr logs. Making up up our minds on that decision invalidates either T301901 or this task.

@Daimona was this task created because you need to have this specific granular control over where stdout and stderr logs are stored, or can something like --log-dir be enough for your usecase?

@Daimona was this task created because you need to have this specific granular control over where stdout and stderr logs are stored, or can something like --log-dir be enough for your usecase?

I do need the granular control over where to store stdout and stderr. It's not a mission-critical feature, but it was there with jsub and it would come in handy sometimes.

Change 827592 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[cloud/toolforge/jobs-framework-cli@master] jobs-framework-cli: add --stdout and --stderr args to cli

https://gerrit.wikimedia.org/r/827592

Change 827594 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[cloud/toolforge/jobs-framework-api@main] jobs-framework-api: add --stdout and --stderr args to cli

https://gerrit.wikimedia.org/r/827594

My proposal is that we leave the current filelog option as is. I think the investment that will really benefit us is trying to work on the root problem: T127367: [toolforge,jobs-api,webservice,storage] Provide modern, non-NFS log solution for Toolforge webservices and bots

Change 867591 had a related patch set uploaded (by Arturo Borrero Gonzalez; author: Arturo Borrero Gonzalez):

[cloud/toolforge/jobs-framework-api@main] tjf: separate command management into its own file

https://gerrit.wikimedia.org/r/867591

Change 868076 had a related patch set uploaded (by Arturo Borrero Gonzalez; author: Arturo Borrero Gonzalez):

[cloud/toolforge/jobs-framework-api@main] command: move log redirections to the wrapper sh call

https://gerrit.wikimedia.org/r/868076

Change 867591 merged by jenkins-bot:

[cloud/toolforge/jobs-framework-api@main] tjf: separate command management into its own file

https://gerrit.wikimedia.org/r/867591

Change 868076 merged by jenkins-bot:

[cloud/toolforge/jobs-framework-api@main] command: move log redirections to the wrapper sh call

https://gerrit.wikimedia.org/r/868076

Change 871171 had a related patch set uploaded (by Arturo Borrero Gonzalez; author: Arturo Borrero Gonzalez):

[cloud/toolforge/jobs-framework-api@main] command: introduce filelog_std{out,err} parameters

https://gerrit.wikimedia.org/r/871171

Change 827594 merged by jenkins-bot:

[cloud/toolforge/jobs-framework-api@main] jobs-framework-api: add filelog_stdout and filelog_stderr arguments

https://gerrit.wikimedia.org/r/827594

Change 827592 merged by jenkins-bot:

[cloud/toolforge/jobs-framework-cli@master] jobs-framework-cli: add --filelog-stdout and --filelog-stderr args to cli

https://gerrit.wikimedia.org/r/827592