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

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

Merged
merged 6 commits into from Jan 17, 2017

Conversation

@aneeshusa
Copy link
Member

aneeshusa commented Jan 12, 2017

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 autoconf@2.13 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 aneeshusa:enable-mach-bootstrap branch from de4b39e to a73281e Jan 12, 2017
@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
Member Author

aneeshusa commented Jan 12, 2017

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 complete
@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 aneeshusa:enable-mach-bootstrap branch from d9501f0 to 76a1867 Jan 12, 2017
@larsbergstrom
Copy link
Contributor

larsbergstrom commented Jan 12, 2017

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 aneeshusa:enable-mach-bootstrap branch from 76a1867 to d1f503b Jan 12, 2017
@aneeshusa aneeshusa force-pushed the aneeshusa:enable-mach-bootstrap branch from d1f503b to 21f9d3d Jan 12, 2017
@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
Member Author

aneeshusa commented Jan 12, 2017

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 aneeshusa:enable-mach-bootstrap branch from 4ab2df1 to e047350 Jan 15, 2017
aneeshusa added 4 commits Jan 12, 2017
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
Contributor

larsbergstrom commented Jan 17, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jan 17, 2017

📌 Commit ef029a8 has been approved by larsbergstrom

@bors-servo
Copy link
Contributor

bors-servo commented Jan 17, 2017

Test exempted - status

@bors-servo bors-servo merged commit ef029a8 into servo:master Jan 17, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test exempted
Details
bors-servo added 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 added 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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.