Skip to content

Commit

Permalink
asdf: update asdf and all its plugins (#189)
Browse files Browse the repository at this point in the history
* asdf: update `asdf` and all its plugins

This will allow us to be smarter about _when to reshim_.

With this update, it will be handled automatically by `asdf` and we won't
require a custom chunk of code in our application:

https://github.com/readthedocs/readthedocs.org/blob/a5965129c61b9bcdff2f2098ff7ce7f8c093dc74/readthedocs/doc_builder/director.py#L373-L386

Currently, multi-lines commands that install something with `pip` and immediate
after that, inside the multi-line command try to use the executable installed,
fail because it's not automatically reshimed.

By reshiming at `asdf` level, this case will be solved.

Related: readthedocs/readthedocs.org#9150 (comment)
Related: asdf-community/asdf-python#136

* Docs: update readme to mention `ubuntu-22.04` and `buildx`

* Tests: update version to check
  • Loading branch information
humitos authored Mar 21, 2023
1 parent d962534 commit e4183c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Read the Docs - Environment base
FROM ubuntu:22.04
LABEL mantainer="Read the Docs <[email protected]>"
LABEL version="ubuntu-22.04-2022.03.15"
LABEL version="ubuntu-22.04-2023.03.09"

ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
Expand Down Expand Up @@ -112,7 +112,7 @@ USER docs
WORKDIR /home/docs

# Install asdf
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --depth 1 --branch v0.9.0
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --depth 1 --branch v0.11.2
RUN echo ". /home/docs/.asdf/asdf.sh" >> /home/docs/.bashrc
RUN echo ". /home/docs/.asdf/completions/asdf.bash" >> /home/docs/.bashrc

Expand Down
13 changes: 11 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ repository:
Ubuntu 20.04 supporting multiple versions of Python, PyPy, conda, mamba, nodejs, rust and go.
Available for public usage as ``build.os: ubuntu-20.04``

`readthedocs/build:ubuntu-22.04-YYYY.MM.DD`
Ubuntu 22.04 supporting multiple versions of Python, PyPy, conda, mamba, nodejs, rust and go.
Available for public usage as ``build.os: ubuntu-22.04``

Note that these images only contains the basic dependencies:

- ``asdf`` CLI manager to install the languages versions
Expand All @@ -31,11 +35,16 @@ Usage

To use the pre-built images, you can pull from Docker Hub:

docker pull readthedocs/build:ubuntu-20.04-YYYY.MM.DD
docker pull readthedocs/build:ubuntu-22.04-YYYY.MM.DD

.. note::

Docker has changed how the iamges are build and now ``buildx`` is required.
Read how to install it in your system at https://docs.docker.com/build/install-buildx/

You can also compile these images locally:

docker build -t readthedocs/build:ubuntu-20.04-YYYY.MM.DD .
docker build -t readthedocs/build:ubuntu-22.04-YYYY.MM.DD .

See `CONTRIBUTING`_ for more information on building and testing.

Expand Down
4 changes: 2 additions & 2 deletions tests/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
@pytest.mark.parametrize(
'command,expected_output',
[
('asdf version', 'v0.9.0-9ee24a3'),
('asdf version', 'v0.11.2-8eb11b8'),
('asdf plugin list', '\n'.join(['golang', 'nodejs', 'python', 'rust'])),
('git --version', 'git version 2.34.1'),
]
)
def test_command_versions_image_ubuntu20(command, expected_output):
def test_command_versions_image_ubuntu22(command, expected_output):
cmd_output = run_command_in_container(DOCKER_IMAGE, command)
assert cmd_output == expected_output

0 comments on commit e4183c1

Please sign in to comment.