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

Refactor to enable mach bootstrap (and leaner Docker builds) - #577

Merged
bors-servo merged 6 commits into
servo:masterfrom
aneeshusa:enable-mach-bootstrap
Jan 17, 2017
Merged

bors-servo merged 6 commits into
servo:masterfrom
aneeshusa:enable-mach-bootstrap

Conversation

@aneeshusa

@aneeshusa aneeshusa commented Jan 12, 2017 •

Copy link
Copy Markdown
Contributor

This refactor will make it possible to run the states installing Salt build dependencies
without making other system level changes, for use in mach bootstrap.

This will also allow skipping unnecessary states for use in Docker image creation #560, for faster image builds and reduced image size.


This change is Reviewable

This information about the Homebrew user was needed for a workaround
which involved invoking Homebrew directly,
since Homebrew cannot be run as root.

However, the improved Homebrew versions support means this workaround
(to installing autoconf and [email protected] concurrently)
is no longer necessary and was removed in
commit a063248.

This code was inadvertently left dangling, and is now cleaned up.
@aneeshusa
aneeshusa force-pushed the enable-mach-bootstrap branch from de4b39e to a73281e Compare January 12, 2017 01:01
@aneeshusa aneeshusa changed the title WIP: Refactor to enable mach bootstrap (and leaner Docker builds) Refactor to enable mach bootstrap (and leaner Docker builds) Jan 12, 2017
@aneeshusa

aneeshusa commented Jan 12, 2017 •

Copy link
Copy Markdown
Contributor Author

OK, this is good enough to allow ./mach bootstrap for Ubuntu Trusty at least!

r? @larsbergstrom

@aneeshusa aneeshusa mentioned this pull request Jan 12, 2017
7 of 10 tasks
@aneeshusa aneeshusa changed the title Refactor to enable mach bootstrap (and leaner Docker builds) WIP: Refactor to enable mach bootstrap (and leaner Docker builds) Jan 12, 2017
@aneeshusa
aneeshusa force-pushed the enable-mach-bootstrap branch from d9501f0 to 76a1867 Compare January 12, 2017 01:54
@larsbergstrom

Copy link
Copy Markdown
Contributor

This looks pretty good to me. I think the machine <-> IP files might be a bit out of date (missing some macs, listing one that we don't use anymore) but otherwise it should be good to go. Thanks!

@aneeshusa
aneeshusa force-pushed the enable-mach-bootstrap branch from 76a1867 to d1f503b Compare January 12, 2017 17:35
@aneeshusa
aneeshusa force-pushed the enable-mach-bootstrap branch from d1f503b to 21f9d3d Compare January 12, 2017 19:22
@aneeshusa aneeshusa changed the title WIP: Refactor to enable mach bootstrap (and leaner Docker builds) Refactor to enable mach bootstrap (and leaner Docker builds) Jan 12, 2017
@aneeshusa

Copy link
Copy Markdown
Contributor Author

Oh, I totally forgot about that, I pulled in the code from #369 so we can get rid of those unused static hosts. Actually tested this in a VM, added some fixes to make it work and updated it to make it ready to add new OS support, r? @larsbergstrom (for real this time)

Fully managing the contents of the whole hosts file ensures that unused
or obsolete hosts entries are removed promptly.

Since we have setup DNS for our build machines,
remove the relevant static entries from the hosts file.
@aneeshusa
aneeshusa force-pushed the enable-mach-bootstrap branch from 4ab2df1 to e047350 Compare January 15, 2017 04:26
These states should only be run for fully managed nodes,
e.g. those under our administrative control,
so move them to the admin/init.sls file.

This is part of a refactor making it possible to run the states
installing Salt build dependencies without making other system level
changes, for use in mach bootstrap.

Use the `os` grain instead of the `kernel` grain for targeting,
for slightly better semantics.
Move the Python (2 and 3) related states into a separate SLS file,
so they can be reused without pulling in the servo user state,
which is in common.

Instead of adding this new SLS file to the top file,
include it from other SLS files that depend on a Python installation.

This makes it possible to `state.apply servo-build-dependencies`
independently, with is needed for `mach bootstrap`.

Note: No effort was made to separate Python 2 and Python 3,
as the virtualenv pip package will create executables for both.
The reference to /etc/apt/sources.list.d allows cleaning that directory
of extraneous sources files. This should only be done on fully managed
nodes, so guard this requisite with a pillar check.

The check defaults to True for backwards compatibility
(i.e. not having to change the production pillars).
This will make it easier to maintain these lists.
Additionally, be more strict about matching on OS type
to make it easier to support more OSes in the future.
@larsbergstrom

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit ef029a8 has been approved by larsbergstrom

@bors-servo

Copy link
Copy Markdown
Contributor

⚡ Test exempted - status

@bors-servo
bors-servo merged commit ef029a8 into servo:master Jan 17, 2017
bors-servo pushed a commit that referenced this pull request Jan 17, 2017
Refactor to enable mach bootstrap (and leaner Docker builds)

This refactor will make it possible to run the states installing Salt build dependencies
without making other system level changes, for use in mach bootstrap.

This will also allow skipping unnecessary states for use in Docker image creation #560, for faster image builds and reduced image size.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/577)
<!-- Reviewable:end -->
bors-servo pushed a commit to servo/servo that referenced this pull request Jan 20, 2017
Use Salt for mach bootstrap

<!-- Please describe your changes on the following line: -->

This is currently WIP, but allows Salt for `mach bootstrap`. Not looking for review yet, just posting for visibility. You can run `./mach bootstrap` and Salt will run, letting you know what changes it would make for bootstrapping (doesn't actually run yet though).

Currently, this reads from saltfs using gitfs, meaning it always tracks the master branch. (Note that this is blocked on servo/saltfs#577 landing; in the meantime, I've included a small workaround in this PR to pull from my updated saltfs branch, which will need to be removed.) In the future, the relevant Salt code may be merged in tree as part of Docker support for TC, and the bootstrapper should be updated to read from in tree.

Also, our Windows machines have not been Salted, so the existing Windows bootstrappers are retained.

TODO:
- [x] Hook into existing bootstrapping code less hackily
- [x] Actually bootstrap instead of always using `test=True` mode (includes sudo)
- [x] Default to interactive mode (test first, then ask), with a force flag
- [x] Don't require running from the repository root directory
- [x] Make it easy to add support for other distros

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should be verified manually

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14974)
<!-- Reviewable:end -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 4, 2017
…-mach-bootstrap); r=metajack

<!-- Please describe your changes on the following line: -->

This is currently WIP, but allows Salt for `mach bootstrap`. Not looking for review yet, just posting for visibility. You can run `./mach bootstrap` and Salt will run, letting you know what changes it would make for bootstrapping (doesn't actually run yet though).

Currently, this reads from saltfs using gitfs, meaning it always tracks the master branch. (Note that this is blocked on servo/saltfs#577 landing; in the meantime, I've included a small workaround in this PR to pull from my updated saltfs branch, which will need to be removed.) In the future, the relevant Salt code may be merged in tree as part of Docker support for TC, and the bootstrapper should be updated to read from in tree.

Also, our Windows machines have not been Salted, so the existing Windows bootstrappers are retained.

TODO:
- [x] Hook into existing bootstrapping code less hackily
- [x] Actually bootstrap instead of always using `test=True` mode (includes sudo)
- [x] Default to interactive mode (test first, then ask), with a force flag
- [x] Don't require running from the repository root directory
- [x] Make it easy to add support for other distros

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should be verified manually

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f76aa6ef7ec7db0a0c40223874a72e8f4059deb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…-mach-bootstrap); r=metajack

<!-- Please describe your changes on the following line: -->

This is currently WIP, but allows Salt for `mach bootstrap`. Not looking for review yet, just posting for visibility. You can run `./mach bootstrap` and Salt will run, letting you know what changes it would make for bootstrapping (doesn't actually run yet though).

Currently, this reads from saltfs using gitfs, meaning it always tracks the master branch. (Note that this is blocked on servo/saltfs#577 landing; in the meantime, I've included a small workaround in this PR to pull from my updated saltfs branch, which will need to be removed.) In the future, the relevant Salt code may be merged in tree as part of Docker support for TC, and the bootstrapper should be updated to read from in tree.

Also, our Windows machines have not been Salted, so the existing Windows bootstrappers are retained.

TODO:
- [x] Hook into existing bootstrapping code less hackily
- [x] Actually bootstrap instead of always using `test=True` mode (includes sudo)
- [x] Default to interactive mode (test first, then ask), with a force flag
- [x] Don't require running from the repository root directory
- [x] Make it easy to add support for other distros

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should be verified manually

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f76aa6ef7ec7db0a0c40223874a72e8f4059deb

UltraBlame original commit: 1383f4886eaa98d20f3581e7dcbaa09f50ecd0d8
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…-mach-bootstrap); r=metajack

<!-- Please describe your changes on the following line: -->

This is currently WIP, but allows Salt for `mach bootstrap`. Not looking for review yet, just posting for visibility. You can run `./mach bootstrap` and Salt will run, letting you know what changes it would make for bootstrapping (doesn't actually run yet though).

Currently, this reads from saltfs using gitfs, meaning it always tracks the master branch. (Note that this is blocked on servo/saltfs#577 landing; in the meantime, I've included a small workaround in this PR to pull from my updated saltfs branch, which will need to be removed.) In the future, the relevant Salt code may be merged in tree as part of Docker support for TC, and the bootstrapper should be updated to read from in tree.

Also, our Windows machines have not been Salted, so the existing Windows bootstrappers are retained.

TODO:
- [x] Hook into existing bootstrapping code less hackily
- [x] Actually bootstrap instead of always using `test=True` mode (includes sudo)
- [x] Default to interactive mode (test first, then ask), with a force flag
- [x] Don't require running from the repository root directory
- [x] Make it easy to add support for other distros

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should be verified manually

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f76aa6ef7ec7db0a0c40223874a72e8f4059deb

UltraBlame original commit: 1383f4886eaa98d20f3581e7dcbaa09f50ecd0d8
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…-mach-bootstrap); r=metajack

<!-- Please describe your changes on the following line: -->

This is currently WIP, but allows Salt for `mach bootstrap`. Not looking for review yet, just posting for visibility. You can run `./mach bootstrap` and Salt will run, letting you know what changes it would make for bootstrapping (doesn't actually run yet though).

Currently, this reads from saltfs using gitfs, meaning it always tracks the master branch. (Note that this is blocked on servo/saltfs#577 landing; in the meantime, I've included a small workaround in this PR to pull from my updated saltfs branch, which will need to be removed.) In the future, the relevant Salt code may be merged in tree as part of Docker support for TC, and the bootstrapper should be updated to read from in tree.

Also, our Windows machines have not been Salted, so the existing Windows bootstrappers are retained.

TODO:
- [x] Hook into existing bootstrapping code less hackily
- [x] Actually bootstrap instead of always using `test=True` mode (includes sudo)
- [x] Default to interactive mode (test first, then ask), with a force flag
- [x] Don't require running from the repository root directory
- [x] Make it easy to add support for other distros

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should be verified manually

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f76aa6ef7ec7db0a0c40223874a72e8f4059deb

UltraBlame original commit: 1383f4886eaa98d20f3581e7dcbaa09f50ecd0d8
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.

5 participants