Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Bug 316 - Load steps YAML from Servo repo#368

Merged
bors-servo merged 1 commit intoservo:masterfrom
shinglyu:yaml
Jun 26, 2016
Merged

Bug 316 - Load steps YAML from Servo repo#368
bors-servo merged 1 commit intoservo:masterfrom
shinglyu:yaml

Conversation

@shinglyu
Copy link
Copy Markdown
Contributor

@shinglyu shinglyu commented May 10, 2016

This should fix #316

I only tested it with buildbot checkconfig master (in the servo-master1 VM). I did try to execute the step in the python interactive console, but some part requires extensive mocking, so I gave up and submit a PR first.


This change is Reviewable

@shinglyu
Copy link
Copy Markdown
Contributor Author

r? @aneeshusa @edunham

@edunham
Copy link
Copy Markdown
Contributor

edunham commented May 11, 2016

Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


buildbot/master/files/config/master.cfg, line 141 [r1] (raw file):

    """
    Builder which uses DynamicServoIntreeYAMLFactory to run steps from a 
    yaml file in the Servo source tree.

This comment is unclear to me -- I expect that the yaml builder would only parse the YAML file from the Servo repo then hand that config back to the master, yet the comment makes it sound like the yaml builder will be what then runs the loaded steps.


Comments from Reviewable

yaml_path = ""

def __init__(self, builder_name, environment, yaml_path):
print(yaml_path)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to print this.

@aneeshusa
Copy link
Copy Markdown
Contributor

aneeshusa commented May 13, 2016

Since we're just testing the YAML loading, let's get rid of linux-rel-yaml and rename linux-yaml to linux-dev-yaml. Using the debug build will be faster and use less extra resources.

You'll also need to make a PR to servo/servo to add a linux-dev-yaml section in the etc/ci/buildbot_steps.yml file, which will need to land before this does.

DynamicServoIntreeYAMLFactory is a pretty long name - once we confirm this is working we should rename it to DynamicServoFactory to replace the current version in a follow-up, but we may want to use something shorter now as well.

I believe we need to create and invoke a Buildbot RemoteCommand(http://docs.buildbot.net/current/developer/cls-remotecommands.html) (or possibly RemoteShellCommand?). From my understanding, steps are run on the master, and use BuildStep.runCommand(https://docs.buildbot.net/current/developer/cls-buildsteps.html#buildbot.process.buildstep.BuildStep.runCommand) to actually run commands on the worker. (N.B.: RemoteCommand is just a Buildbot class representing a command to run on the worker, not a Buildbot Step, i.e. it's not a special type of ShellCommand. Same for RemoteShellCommand. This tripped me up a bunch.) Because the buildbot_steps.yml file is on the worker, we need to invoke runCommand to extract the contents of the file on the worker and send them back. I haven't looked into this 100%, but https://github.com/isotoma/buildbot_travis/blob/master/buildbot_travis/steps/base.py should be a decent example. I'll try to look into this more to provide more concrete advice.

Please also address the test suite failures from Travis.

@shinglyu
Copy link
Copy Markdown
Contributor Author

@aneeshusa So in my StepsYAMLParsingStep::run(), I should run a RemoteCommand to get the content of the YAML file. (Something like cat /etc/ci/buildbot_steps.yml), then parse it and generate the dynamic steps?

@shinglyu
Copy link
Copy Markdown
Contributor Author

@anneeshusa Also I have a question regarding @edunham 's comment. If I change the StepsYAMLParsingStep::run() to get the YAML back with RemoteCommand, and then I call the self.build.steps += ..., does that effectively make the DynamicServoYAMLBuilder (the old DynamicServoIntreeYAMLBuilder) run the parsed step? Or the self.build.steps is run by other Builders?

Or perhaps I should just return the parsed YAML content back to the master, and let the master start another builder with the parsed steps? But I don't see a clear place in the master.cfg to do this?

@aneeshusa
Copy link
Copy Markdown
Contributor

As far as I understand, you're correct that you'll need to runCommand a RemoteCommand (or maybe RemoteShellCommand), then parse the output and generate the dynamic steps. I highly recommend cloning the buildbot source tree, checking out the eight branch, and reading the Buildbot code to figure out exactly how this works - I'm not 100% sure.

DynamicServoYAMLBuilder should pick up on the new steps and continue to run them. Buildbot 9 (next major version) explicitly adds support for this behavior: docs here and code here.

I think the end result should look pretty close to the GenerateStagesCommand in the linked docs.

@bors-servo
Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #373) made this pull request unmergeable. Please resolve the merge conflicts.

@shinglyu
Copy link
Copy Markdown
Contributor Author

@aneeshusa Thanks! Let me read that and get back to you.

@shinglyu
Copy link
Copy Markdown
Contributor Author

@aneeshusa I ran the script throught REPL and didn't see any error, but I might need a full setup to varify it works.


class StepsYAMLParsingStep(buildstep.ShellMixin, buildstep.BuildStep):
"""
Step which resolves the in-tree YAML and dynamically add test steps.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar nit: add -> adds

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move buildbot logic to scripts in /etc/ci

4 participants