-
Notifications
You must be signed in to change notification settings - Fork 70
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
New image structure based on design document #166
Conversation
b063da2
to
966c509
Compare
…to humitos/build-images-design-doc
e4d90c4
to
9e57908
Compare
We decided to only use one `-base` image and install languages at build time.
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.
I wonder if it would be a good moment to try to optimize the Dockerfile: https://www.fromlatest.io/
in particular:
- Couple
apt-get update
withrm -rf /var/lib/apt/lists/*
in the same layer (although I don't think that plays along well with our multi-layeredapt-get install
- we would need to doupdate && install && rm -rf /var/lib/...
in every layer, which will slow down the builds a bit) - Use
--no-install-recommends
to be more explicit about what are we installing and why
Good feedback here!
I don't think we are spending a lot of disk space. However, I agree it could be a good optimization. As you already noticed, we will need to call On the other hands, packages (
I'm not sure about this one. I think it's a good idea to know exactly what we are installing. However, if add this option now, I wonder if all the PDFs will keep building correctly (e.g. the right font, or stylesheets). |
Minimal implementation for POC of #8447 It uses a Feature flag for now as a way to select the new `readthedocs/build:ubuntu20` image and install Python versions via `asdf` (readthedocs/readthedocs-docker-images#166) MinIO requires a new bucket called `languages` with a pre-compiled Python 3.9.6 version to work (*) (this version is hardcoded for now). However, if a different version is selected it will be downloaded from official mirrors, installed and used. Build times on `latest` version for `test-build`: * using the new image + cached Python version: 112s * using the new image + non cached Python version: 288s * using old image (current production): 87s > Note that all the parsing of the Config File to support `build.os` and > `build.languages` is not included in this PR on purpose. That work can be > split as a separate work and done in parallel with the rest of work required > here. (*) to pre-compile a Python version: ```bash docker run -it readthedocs/build:ubuntu20 /bin/bash asdf install python 3.9.6 asdf global python 3.9.6 python -m pip install -U pip setuptools virtualenv cd /home/docs/.asdf/installs/python tar -cfvz ubuntu20-python-3.9.6.tar.gz 3.9.6 docker cp <container id>:/home/docs/.asdf/installs/python/ubuntu20-python-3.9.6.tar.gz . ``` and upload the .tar.gz file to MinIO `languages` bucket using the web interface
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.
So much red!
I don't quite follow the need for additional version information on the build however, it seems like we only wanted a ubuntu20
and ubuntu22
image. The additional granularity probably won't be used anywhere.
@agjohnson I addressed all your comments and made the tests run on CircleCI. Is there any blocker to merge this PR? |
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.
This looks like a good step forward to me. I didn't look super deeply into the DockerFile packages that are installed, but assume we've tested those.
@@ -1,11 +1,14 @@ | |||
# Read the Docs - Environment base | |||
FROM ubuntu:20.04 | |||
LABEL mantainer="Read the Docs <support@readthedocs.com>" | |||
LABEL version="ubuntu-20.04-2021.09.23" |
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.
Can we automate this with date
or similar? Do we want to?
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.
I haven't try that. Honestly, I don't think LABEL version
is strictly needed; but I thought it could be useful to use with docker inspect
to know what's the version you have downloaded:
▶ docker inspect c54fcbdfb6c8 | jq '.[0].Config.Labels.version'
"ubuntu-20.04-2021.09.23"
It's a nice to have to me. If we can automate it, it would be 💯
|
||
`readthedocs/build:5.0` | ||
``stable`` | ||
Ubuntu 18.04 supporting Python 2.7, 3.6, 3.7 and pypy3.5-7.0.0. | ||
This is the **stable** image supported by Read the Docs. | ||
|
||
`readthedocs/build:6.0` | ||
``latest`` | ||
Ubuntu 18.04 supporting Python 2.7, 3.5, 3.6, 3.7, 3.8 and PyPy3.5-7.0.0. | ||
This is the **latest** default image used for documentation builds and supported by Read the Docs. | ||
|
||
`readthedocs/build:7.0` | ||
``testing`` | ||
Ubuntu 18.04 supporting Python 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, and PyPy3.5-7.0.0. | ||
Available for public usage as **testing** image. You should expect some breaking changes here. |
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.
Are these not still important to document, since they are still in use?
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.
This was a little (too much) opinionated 😄
- I think we shouldn't explain these images here "to the final user"
- I think users wanting to use these images should be pointed to the Read the Docs documentation instead (config file)
- I would try to keep this repository hidden from the regular users because it only generates confusion
- I wanted to only expose the newer image to avoid people finding this and using the old images
That said, it may make sense to remove the phrase "Available for public usage as build.os: ubuntu-20.04
" as well.
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.
I would try to keep this repository hidden from the regular users because it only generates confusion
Perhaps we should make it private, then? And move these docs to our public-facing docs & config file?
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.
Make it private may be too much. I think we will lose some issues/prs references linked everywhere.
Definitely, how to use the docker image and what it contains should be documented in the Read the Docs documentation for the config file.
Co-authored-by: Eric Holscher <25510+ericholscher@users.noreply.github.com>
Hurray! 🎉 |
Dockerfile
(s) required to build the new build images (ubuntu20-*
) that useasdf
to install languages requirements (python
,node
,rust
,go
)Design documents:
Implementation:
How to build this image
docker build -t readthedocs/build:ubuntu-20.04 .
TODO
asdf
is installed correctlyapt-get
(see libmysqlclient-dev is not installed? #158)jsdoc
andtypedoc
are required in the new images and in that case, how to handle them (see Supportjsdoc
andtypedoc
doctools #147)Closes #170
Closes #60
Closes #158
Closes #107
Closes #90
Closes #86
Closes #108
Closes #91
Closes #64
Closes #130
Closes #177
Closes #176
Closes #48