Skip to content

Commit

Permalink
Build: add support for Ubuntu 24.04 LTS (#11421)
Browse files Browse the repository at this point in the history
* Build: add support for Ubuntu 24.04 LTS

Closes #11072
Requires:
* readthedocs/readthedocs-docker-images#207
* readthedocs/readthedocs-ops#1494

* Update scripts/compile_version_upload_s3.sh

Co-authored-by: Eric Holscher <[email protected]>

* Don't update Ubuntu latest yet

---------

Co-authored-by: Eric Holscher <[email protected]>
  • Loading branch information
humitos and ericholscher authored Jun 18, 2024
1 parent 44b2732 commit bc50f97
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/user/config-file/v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Image names refer to the operating system Read the Docs uses to build them.
Arbitrary Docker images are not supported.

:Type: ``string``
:Options: ``ubuntu-20.04``, ``ubuntu-22.04``, ``ubuntu-lts-latest``
:Options: ``ubuntu-20.04``, ``ubuntu-22.04``, ``ubuntu-24.04``, ``ubuntu-lts-latest``
:Required: ``true``

.. note::
Expand Down
5 changes: 5 additions & 0 deletions readthedocs/builds/constants_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"os": {
"ubuntu-20.04": f"{DOCKER_DEFAULT_IMAGE}:ubuntu-20.04",
"ubuntu-22.04": f"{DOCKER_DEFAULT_IMAGE}:ubuntu-22.04",
"ubuntu-24.04": f"{DOCKER_DEFAULT_IMAGE}:ubuntu-24.04",
},
# Mapping of build.tools options to specific versions.
"tools": {
Expand Down Expand Up @@ -75,7 +76,11 @@
# Set latest aliases for OS and tools.
_OS = RTD_DOCKER_BUILD_SETTINGS["os"]
_TOOLS = RTD_DOCKER_BUILD_SETTINGS["tools"]

# TODO: point ``ubuntu-lts-latest`` to Ubuntu 24.04 LTS once we have tested it
# in production after some weeks
_OS["ubuntu-lts-latest"] = _OS["ubuntu-22.04"]

_TOOLS["python"]["3"] = _TOOLS["python"]["3.12"]
_TOOLS["python"]["latest"] = _TOOLS["python"]["3"]
_TOOLS["python"]["miniconda-latest"] = _TOOLS["python"]["miniconda3-3.12-24.1"]
Expand Down
1 change: 1 addition & 0 deletions readthedocs/rtd_tests/fixtures/spec/v2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"enum": [
"ubuntu-20.04",
"ubuntu-22.04",
"ubuntu-24.04",
"ubuntu-lts-latest"
]
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/compile_version_upload_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ set -x # Echo commands

# Define variables
SLEEP=900 # Container timeout
OS="${OS:-ubuntu-22.04}" # Docker image name
OS="${OS:-ubuntu-24.04}" # Docker image name

TOOL=$1
VERSION=$2

# https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Spin up a container with the Ubuntu 20.04 LTS image
# Spin up a container with the latest Ubuntu LTS image
CONTAINER_ID=$(docker run --user docs --rm --detach --volume ${SCRIPT_DIR}/python-build.diff:/tmp/python-build.diff readthedocs/build:$OS sleep $SLEEP)
echo "Running all the commands in Docker container: $CONTAINER_ID"

Expand Down

0 comments on commit bc50f97

Please sign in to comment.