-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Restructure of Docker command execution and large build refactor #1524
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 22 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ff43236
Encapsulate command execution inside build environment state objects
agjohnson 74d4391
Add test
agjohnson 875624a
Testing environments and addressing some design issues
agjohnson 176742b
Cleanup and fix tests
agjohnson 8300741
Drop unused docker command, move functionality to update_api command
agjohnson 2f545a0
Correct call on mkdocs json and some cleanup on mkdocs backend
agjohnson 11866e0
Handle PDF builds better, clean up build tests
agjohnson 6543a96
Lint fixes
agjohnson e40018d
Handle non-ascii characters from build commands
agjohnson d2df335
Make error output show up first on build output page, hide stdout
agjohnson e6e928f
Add some error output for top-level failure reporting
agjohnson d4d63dc
Handle build env container exit states with error messages
agjohnson 0b40d63
More aggressive linting
agjohnson 1722890
Add existing container detection and handling to docker build env
agjohnson e6a67d1
Clean up mkdocs backend a bit
agjohnson 33c0078
Alter pattern for update_docs tasks to include task instance
agjohnson cc8f83d
Provide build test envs with build object to determine done-ness
agjohnson d0fb52f
Add tests for timeout and memory failures in containers
agjohnson 66f1552
Improved build response recording and cleaned up tests
agjohnson 55938bb
Remove old fixtures for ddf fixtures
agjohnson e90f854
Forgot to clock the nonblock lock mock
agjohnson caea61e
Add docs, move standards due to naming
agjohnson 709faf6
Fix test undone in rebase
agjohnson 8db0d31
Protect against py3 __iter__ check
agjohnson 39ee22c
Documentation fixes
agjohnson a592aa0
Make build backend docs_dir resolution absolute
agjohnson bd64667
Default autodetect type to Sphinx type on project build
agjohnson 1476bbb
Make sure PDF/ePub types aren't built if type is not sphinx
agjohnson 467d240
Lint cleanup
agjohnson 2356621
Update refactor misses
agjohnson 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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
================== | ||
Build Environments | ||
================== | ||
|
||
Read the Docs uses container virtualization to encapsulate documentation build | ||
processes. Each build spins up a new virtual machinge using our base image, | ||
which is an image with the minimum necessary components required to build | ||
documentation. Virtual machines are limiting in CPU time and memory, which aims | ||
to reduce excessive usage of build resources. | ||
|
||
Setup | ||
----- | ||
|
||
Build environments use `Docker`_ to handle container virtualization. To perform | ||
any development on the Docker build system, you will need to set up `Docker`_ on | ||
your host system. Setup of Docker will vary by system, and so is out of the | ||
scope of this documentation. | ||
|
||
Once you have Docker set up, you will need to create the base image used for | ||
container creation. The ``base`` image is found in our `container images repo`_. | ||
It is the basic container image supported by our community site. | ||
|
||
To get started, create the image using the `docker` command line tool. You can | ||
name the image whatever you like here, ``rtfd-build`` is the default name, but | ||
can be configured in your settings -- see `Configuration`_:: | ||
|
||
docker build -t rtfd-build base/ | ||
|
||
When this process has completed, you should have a working image that Read the | ||
Docs can use to start containers. | ||
|
||
.. _`Docker`: http://docker.com | ||
.. _`container images repo`: https://github.com/rtfd/readthedocs-docker-images | ||
|
||
Configuration | ||
------------- | ||
|
||
There are several settings used to configure usage of virtual machines: | ||
|
||
DOCKER_ENABLED | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intending the definition list here will make it live inside a blockquote. The definition list should start in column 0. |
||
True/False value used to enable the Docker build environment. Default: | ||
False | ||
|
||
DOCKER_LIMITS | ||
A dictionary of limits to virtual machines. These limits include: | ||
|
||
time | ||
An integer representing the total allowed time limit (in | ||
seconds) of build processes. This time limit affects the parent | ||
process to the virtual machine and will force a virtual machine | ||
to die if a build is still running after the alloted time | ||
expires. | ||
|
||
memory | ||
The maximum memory allocated to the virtual machine. If this | ||
limit is hit, build processes will be automatically killed. | ||
Examples: '200m' for 200MB of total memory, or '2g' for 2GB of | ||
total memory. | ||
|
||
DOCKER_IMAGE | ||
Tag of a Docker image to use as a base image. | ||
|
||
DOCKER_SOCKET | ||
URI of the socket to connect to the Docker daemon. Examples include: | ||
``unix:///var/run/docker.sock`` and ``tcp://127.0.0.1:2375`` | ||
|
||
DOCKER_VERSION | ||
Version of the API to use for the Docker API client. |
File renamed without changes.
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
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
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
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.
type: "machinge" -> "machine"