RFC: recipes.py remote_run -> remote

9 views
Skip to first unread message

Paweł Hajdan, Jr.

unread,
Jun 20, 2016, 8:18:47 AM6/20/16
to infr...@chromium.org
tl;dr: I'd like to rename recipes.py remote_run command to remote, and remove the hardcoded run part.

Context: last month's https://codereview.chromium.org/1997023002 added remote_run command to the recipe engine, intended to replace kitchen.

While debugging https://bugs.chromium.org/p/chromium/issues/detail?id=618127 I realized it'd be really useful to have more info in the logs, and while adding --verbose switch to remote_run command is easy (https://codereview.chromium.org/2083523003), it isn't for the actual run part.


    cmd = [
        sys.executable,
        os.path.join(
            checkout_dir,
            recipes_cfg.read().recipes_path,
            'recipes.py'),
        'run'
    ] + args.run_args

run_args are appended after "run", but --verbose is only valid before run. Otherwise the following error message is generated:

INFO:root:Running ['/usr/bin/python', u'/b/rr/tmpYNRx0s/rw/checkout/recipes/recipes.py', 'run', '--verbose', '--properties-file', '/b/rr/tmpYNRx0s/remote_run_properties.json', '--workdir', '/b/rr/tmpYNRx0s/w', 'infra_continuous']
Cloning into '/b/rr/tmpYNRx0s/rw/checkout/recipes/.recipe_deps/recipe_engine'...
usage: recipes.py [-h] [--package PACKAGE] [--deps-path DEPS_PATH] [--verbose]
                  [--no-fetch] [--bootstrap-script BOOTSTRAP_SCRIPT]
                  [-O ID=PATH] [--use-bootstrap]
                  {fetch,simulation_test,lint,run,remote_run,autoroll,depgraph,doc,info}
                  ...
recipes.py: error: unrecognized arguments: --verbose

What I could do is just make recipe_engine/remote_run.py prepend --verbose before 'run' if it itself was run with --verbose. I expect that would be a straightforward change not raising any concerns.

However, what I'd really prefer to do, is introduce a "remote" command instead. The caller would then explicitly specify "run" after "--". The caller could specify arguments for recipes.py before the command (such as --verbose), or use a command different than run.

That interface would be more generic.

The way such migration could be performed is first add "remote" command, migrate callers (remote_run.py in build + restart masters), and remove remote_run command from recipe engine.

WDYT?

Paweł

Paweł Hajdan, Jr.

unread,
Jun 21, 2016, 8:50:56 AM6/21/16
to infr...@chromium.org, Robbie Iannucci, Stephen Martinis, Erik Staab
I've discussed this with Erik and uploaded https://codereview.chromium.org/2080343005 .

Paweł

Stephen

unread,
Jun 21, 2016, 1:26:57 PM6/21/16
to infra-dev, iann...@chromium.org, mart...@chromium.org, est...@chromium.org
SGTM

I'll review the CL
Reply all
Reply to author
Forward
0 new messages