Skip to content
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

Document how to set the Buildbarn PATH #584

Conversation

stagnation
Copy link

Following the discussion in #532 .

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 28, 2024
Comment on lines 20 to 23
Add the environment variables to the worker config you want
`docker-compose/config/worker-fuse-ubuntu22-04.jsonnet` or
`docker-compose/config/worker-hardlinking-ubuntu22-04.jsonnet`
`.buildDirectories[].runners[]`, after the `workerId:` dictionary.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm having some trouble parsing this sentence, did a part of it get cut out?

Copy link
Author

@stagnation stagnation Feb 29, 2024

Choose a reason for hiding this comment

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

Good point, thanks! I will revise it.

What I try to say (concisely) is: update whichever of the two paths you use, as you can choose either hardlinking or FUSE. Which for the sake of the example is problably bad. Hardlinking is the simplest but a little slower, we could clarify the example by dropping FUSE. Next, to update the proto file, which is a simple insertion but in a big structure, so here is a jq-style path for where to add it. Unfortunately this cannot be done with yq or jq.
And then, there is the big diff listing because it is still annoying to describe what to do :S.

I hope this is better:


Add the environment variables to the worker configs: worker-fuse-ubuntu22-04.jsonnet and worker-hardlinking-ubuntu22-04.jsonnet. The proto configuration specifies a buildDirectories list, with a runner list inside. There is only one runner in each config file. That runner should be modified to have the environment variables values:

environment_variables: {
  PATH: '/bin:/usr/bin:/usr/local/bin',
},

They can be put anywhere in the runner. The example diff below adds them at the end, after workerId.

It is also possible to make a crude insertion with sed:

sed -i \
    '/workerId/i \      environment_variables: { PATH: \'/bin:/usr/bin:/usr/local/bin\'},' \
    docker-compose/config/worker-*-ubuntu22-04.jsonnet

Copy link
Contributor

Choose a reason for hiding this comment

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

I think your original explanation was fine in principle, I just didn't quite understand the grammatical structure. Something like this would clear it up for me if it's accurate

Add the environment variables to the worker config you want - normally either path1 or path2 - after the workerId field like this:

But the more detailed one is just as good, completely up to you

@stagnation stagnation force-pushed the feature/document-path-in-buildbarn-example branch from ecf54ef to 7e3bb16 Compare March 1, 2024 14:07
@JakobDegen
Copy link
Contributor

Thanks!

@facebook-github-bot
Copy link
Contributor

@JakobDegen has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@stagnation stagnation deleted the feature/document-path-in-buildbarn-example branch March 8, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants