-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[llvm][docs] Expand HowToAddABuilder with guidance on testing locally #115024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f31341c
[docs] Expand HowToAddABuilder with guidance on testing locally
asb 15a98e1
Address review comments
asb 4950b7c
Missing blank lines
asb 9afcc29
Get rid of repeated use of 'configuration' in opening para
asb 2d02173
Reflect rename of BUILDMASTER_TEST to BUILDBOT_TEST
asb bb58bf8
Split out extra bullet point as per suggestion
asb 4c0a079
Clarify server_address
asb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,86 @@ Here are the steps you can follow to do so: | |
| buildbot.tac file to change the port number from 9994 to 9990 and start it | ||
| again. | ||
|
|
||
| Testing a Builder Config Locally | ||
| ================================ | ||
|
|
||
| It is possible to test a builder running against a local version of LLVM's | ||
| buildmaster setup. This allows you to test changes to builder, worker, and | ||
| buildmaster configuration. A buildmaster launched in this "local testing" mode | ||
| will: | ||
| * Bind only to local interfaces. | ||
| * Use SQLite as the database. | ||
| * Use a single fixed password for workers. | ||
| * Disable extras like GitHub authentication. | ||
|
|
||
| In order to use this "local testing" mode: | ||
|
|
||
| * Within a checkout of `llvm-zorg <https://github.com/llvm/llvm-zorg>`_, | ||
| create and activate a Python `venv | ||
| <https://docs.python.org/3/library/venv.html>`_ and install the necessary | ||
| dependencies. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python -m venv bbenv | ||
| source bbenv/bin/activate | ||
| pip install buildbot{,-console-view,-grid-view,-waterfall-view,-worker,-www}==3.11.7 urllib3 | ||
|
|
||
| * Initialise the necessary buildmaster files, link to the configuration in | ||
| ``llvm-zorg`` and ask ``buildbot`` to check the configuration. This step can | ||
| be run from any directory. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| buildbot create-master llvm-testbbmaster | ||
| cd llvm-testbbmaster | ||
| ln -s /path/to/checkout/of/llvm-zorg/buildbot/osuosl/master/master.cfg . | ||
| ln -s /path/to/checkout/of/llvm-zorg/buildbot/osuosl/master/config/ . | ||
| ln -s /path/to/checkout/of/llvm-zorg/zorg/ . | ||
| BUILDMASTER_TEST=1 buildbot checkconfig | ||
|
|
||
| * Start the buildmaster. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| BUILDMASTER_TEST=1 buildbot start --nodaemon . | ||
|
|
||
| * After waiting a few seconds for startup to complete, you should be able to | ||
| open the web UI at ``http://localhost:8011``. If there are any errors or | ||
| this isn't working, check ``twistd.log`` (within the current directory) for | ||
| more information. | ||
|
|
||
| * You can now create and start a buildbot worker. Ensure you pick the correct | ||
| name for the worker associated with the build configuration you want to test | ||
| in ``buildbot/osuosl/master/config/builders.py``. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| buildbot-worker create-worker <buildbot-worker-root-directory> \ | ||
| localhost:9990 \ | ||
| <buildbot-worker-name> \ | ||
| test | ||
| buildbot-worker start --nodaemon <buildbot-worker-root-directory> | ||
|
|
||
| * Either wait until the poller sets off a build, or alternatively force a | ||
| build to start in the web UI (which is also the best place to review the | ||
| build results). | ||
|
|
||
| This local testing configuration defaults to binding only to the loopback | ||
| interface for security reasons. | ||
|
|
||
| If you want to run the test worker on a different machine, or to run the | ||
| buildmaster on a remote server, ssh port forwarding can be used to make | ||
| connection possible. For instance, if running the buildmaster on a remote | ||
| server the following command will suffice to make the web UI accessible via | ||
| ``http://localhost:8011`` and make it possible for a local worker to connect | ||
| to the remote buildmaster by connecting to ``localhost:9900``: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| ssh -N -L 8011:localhost:8011 -L 9990:localhost:9990 username@server_address | ||
|
||
|
|
||
|
|
||
| Best Practices for Configuring a Fast Builder | ||
| ============================================= | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing the results seems like a step in itself to me so break out the parenthetical into its own bullet point.