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

chore: Upgrade the base runtime version (CPython: 3.11.6 -> 3.12.2) #1994

Merged
merged 13 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/timeline-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
check-latest: true
- name: Install dependencies
run: |
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,12 @@ or native SSH connection to kernels via our client SDK or desktop apps.
Python Version Compatibility
----------------------------

| Backend.AI Core Version | Compatible Python Version |
|:---------------------------:|:-------------------------:|
| 23.03.x / 23.09.x / 24.03.x | 3.11.x |
| 22.03.x / 22.09.x | 3.10.x |
| 21.03.x / 21.09.x | 3.8.x |
| Backend.AI Core Version | Compatible Python Version |
|:-----------------------:|:-------------------------:|
| 24.03.x / 24.09.x | 3.12.x |
| 23.03.x / 23.09.x | 3.11.x |
| 22.03.x / 22.09.x | 3.10.x |
| 21.03.x / 21.09.x | 3.8.x |


License
Expand Down
1 change: 1 addition & 0 deletions changes/1994.deps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade the base runtime (CPython) version from 3.11.6 to 3.12.2
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Developer guide for Backend.AI documentation
Then, follow the instructions below:

```console
$ pyenv virtualenv $(pyenv latest 3.11) bai-docs
$ pyenv virtualenv $(pyenv latest 3.12) bai-docs
$ git clone https://github.com/lablup/backend.ai bai-dev
$ cd ./bai-dev/docs
$ pyenv local bai-docs
Expand Down
22 changes: 11 additions & 11 deletions docs/dev/daily-workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ To (re-)generate the virtualenv(s), run:

$ pants export --resolve=RESOLVE_NAME # you may add multiple --resolve options

You may display the available resolve names by (the command works with Python 3.11 or later):
You may display the available resolve names by (the command works with Python 3.12 or later):

.. code-block:: console

Expand Down Expand Up @@ -209,7 +209,7 @@ you should also configure ``PYTHONPATH`` to include the repository root's ``src`
For linters and formatters, configure the tool executable paths to indicate
``dist/export/python/virtualenvs/RESOLVE_NAME/PYTHON_VERSION/bin/EXECUTABLE``.
For example, ruff's executable path is
``dist/export/python/virtualenvs/ruff/3.11.6/bin/ruff``.
``dist/export/python/virtualenvs/ruff/3.12.2/bin/ruff``.

Currently we have the following Python tools to configure in this way:

Expand Down Expand Up @@ -259,7 +259,7 @@ Set the workspace settings for the Python extension for code navigation and auto
* - ``python.analysis.autoSearchPaths``
- true
* - ``python.analysis.extraPaths``
- ``["dist/export/python/virtualenvs/python-default/3.11.6/lib/python3.11/site-packages"]``
- ``["dist/export/python/virtualenvs/python-default/3.12.2/lib/python3.12/site-packages"]``
* - ``python.analysis.importFormat``
- ``"relative"``
* - ``editor.formatOnSave``
Expand All @@ -275,11 +275,11 @@ Set the following keys in the workspace settings to configure Python tools:
* - Setting ID
- Example value
* - ``mypy-type-checker.interpreter``
- ``["dist/export/python/virtualenvs/mypy/3.11.6/bin/python"]``
- ``["dist/export/python/virtualenvs/mypy/3.12.2/bin/python"]``
* - ``mypy-type-checker.importStrategy``
- ``"fromEnvironment"``
* - ``ruff.interpreter``
- ``["dist/export/python/virtualenvs/ruff/3.11.6/bin/python"]``
- ``["dist/export/python/virtualenvs/ruff/3.12.2/bin/python"]``
* - ``ruff.importStrategy``
- ``"fromEnvironment"``

Expand Down Expand Up @@ -309,8 +309,8 @@ Then put the followings in ``.vimrc`` (or ``.nvimrc`` for NeoVim) in the build r
.. code-block:: vim

let s:cwd = getcwd()
let g:ale_python_mypy_executable = s:cwd . '/dist/export/python/virtualenvs/mypy/3.11.6/bin/mypy'
let g:ale_python_ruff_executable = s:cwd . '/dist/export/python/virtualenvs/ruff/3.11.6/bin/ruff'
let g:ale_python_mypy_executable = s:cwd . '/dist/export/python/virtualenvs/mypy/3.12.2/bin/mypy'
let g:ale_python_ruff_executable = s:cwd . '/dist/export/python/virtualenvs/ruff/3.12.2/bin/ruff'
let g:ale_linters = { "python": ['ruff', 'mypy'] }
let g:ale_fixers = {'python': ['ruff']}
let g:ale_fix_on_save = 1
Expand All @@ -328,11 +328,11 @@ just like VSCode (see `the official reference <https://www.npmjs.com/package/coc
"ruff.enabled": true,
"ruff.autoFixOnSave": true,
"ruff.useDetectRuffCommand": false,
"ruff.builtin.pythonPath": "dist/export/python/virtualenvs/ruff/3.11.6/bin/python",
"ruff.serverPath": "dist/export/python/virtualenvs/ruff/3.11.6/bin/ruff-lsp",
"python.pythonPath": "dist/export/python/virtualenvs/python-default/3.11.6/bin/python",
"ruff.builtin.pythonPath": "dist/export/python/virtualenvs/ruff/3.12.2/bin/python",
"ruff.serverPath": "dist/export/python/virtualenvs/ruff/3.12.2/bin/ruff-lsp",
"python.pythonPath": "dist/export/python/virtualenvs/python-default/3.12.2/bin/python",
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "dist/export/python/virtualenvs/mypy/3.11.6/bin/mypy",
"python.linting.mypyPath": "dist/export/python/virtualenvs/mypy/3.12.2/bin/mypy",
}

To activate Ruff (a Python linter and fixer), run ``:CocCommand ruff.builtin.installServer``
Expand Down
12 changes: 6 additions & 6 deletions docs/install/install-from-package/os-preparation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ using a standalone static built Python.
Use a standalone static built Python (Recommended)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Obtain distribution of `a standalone static built Python <https://github.com/indygreg/python-build-standalone/releases>`_ according to required
python version, target machine architecture and etc. Then extract the distribution
Obtain distribution of `a standalone static built Python <https://github.com/indygreg/python-build-standalone/releases>`_ according to required
python version, target machine architecture and etc. Then extract the distribution
to a directory of your choice.

.. code-block:: console
Expand All @@ -133,10 +133,10 @@ For example,

.. code-block:: console

$ curl -L "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz" > cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz
$ tar -xf "cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz"
$ curl -L "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.12.2+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz" > cpython-3.12.2+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz
$ tar -xf "cpython-3.12.2+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz"
$ mkdir -p "/home/bai/.static-python/versions"
$ mv python "/home/bai/.static-python/versions/3.11.6"
$ mv python "/home/bai/.static-python/versions/3.12.2"

Then, you can create multiple virtual environments per service. To create a
virtual environment for Backend.AI Manager and activate it, for example, you may run:
Expand All @@ -145,7 +145,7 @@ virtual environment for Backend.AI Manager and activate it, for example, you may

$ mkdir "${HOME}/manager"
$ cd "${HOME}/manager"
$ ~/.static-python/versions/3.11.6/bin/python3 -m venv .venv
$ ~/.static-python/versions/3.12.2/bin/python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -U pip setuptools wheel

Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ko/LC_MESSAGES/README.po
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ msgstr ""

#: ../../README.md:18 5564b6e3c712470388f16d777160759d
msgid ""
"```console $ pyenv virtualenv $(pyenv latest 3.11) bai-docs $ git clone "
"```console $ pyenv virtualenv $(pyenv latest 3.12) bai-docs $ git clone "
"https://github.com/lablup/backend.ai bai-dev $ cd ./bai-dev/docs $ pyenv "
"local bai-docs $ pip install -U pip setuptools wheel $ pip install -U \\ "
"> --find-links=https://dist.backend.ai/pypi/simple/grpcio \\ > "
Expand Down
17 changes: 8 additions & 9 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ enable_resolves = true
# * Let other developers do:
# - Run `./pants export` again
# - Update their local IDE/editor's interpreter path configurations
interpreter_constraints = ["CPython==3.11.6"]
interpreter_constraints = ["CPython==3.12.2"]
tailor_pex_binary_targets = false

[python-bootstrap]
Expand All @@ -80,19 +80,18 @@ towncrier = "tools/towncrier.lock"
# first_party_depenency_version_scheme = "exact"

[pex-cli]
version = "v2.1.148"
known_versions = [
"v2.1.148|macos_arm64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
"v2.1.148|macos_x86_64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
"v2.1.148|linux_arm64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
"v2.1.148|linux_x86_64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
]
# version = "v2.1.148"
# known_versions = [
# "v2.1.148|macos_arm64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
# "v2.1.148|macos_x86_64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
# "v2.1.148|linux_arm64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
# "v2.1.148|linux_x86_64|5b1dee5a89fff25747753e917f96b8707ea62eed404d037d5f8cf8f2e80a13b7|4197604",
# ]
# When trying a new pex version, you could find out the hash and size-in-bytes as follows:
# $ curl -s -L https://github.com/pantsbuild/pex/releases/download/v2.1.99/pex | tee >(wc -c) >(shasum -a 256) >/dev/null

[black]
install_from_resolve = "black"
interpreter_constraints = ["CPython==3.11.6"] # don't know why this is required... (maybe a Pants bug?)

[ruff]
install_from_resolve = "ruff"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
requires-python = "~=3.11.6"
requires-python = "~=3.12.2"

[tool.towncrier]
package = "ai.backend.manager" # reference point for getting __version__
Expand Down Expand Up @@ -105,5 +105,5 @@ implicit_optional = true # FIXME: remove after adding https://github.com/haunts
mypy_path = "stubs:src:tools/pants-plugins"
namespace_packages = true
explicit_package_bases = true
python_executable = "dist/export/python/virtualenvs/python-default/3.11.6/bin/python"
python_executable = "dist/export/python/virtualenvs/python-default/3.12.2/bin/python"
disable_error_code = ["typeddict-unknown-key"]
Loading
Loading