Use custom built-in python with ch-backup
Added extra files for building ch-backup with built-in custom python version, currently it's compiling during the build (but later can be moved to a separate image/static archive. etc)
To build it with custom python we can run the following:
cd ch-backup
make build-python
./build_deb_with_python_in_docker.sh
with new env variables PYTHON_BUILD_NAME (eg: bionic-python-amd64) and TARGET_PYTHON_VERSION (eg: 3.12.3)
It will build and compile target python version with target image (OS and arch), and then copy the whole python directory to the end deb package and setup it's usage (to not overlap with system python and be able to install all ch-backup dependencies into temporary venv)
There were a couple of issues with current boto dependencies and python 3.12.3, that's why I've split them by python_version (see also https://github.com/yandex/ch-backup/pull/147). Currently it works well with S3, with python 3.12.3 and upgraded boto libs:
boto3 1.20.54
botocore 1.23.54
Do we actually need custom building instead of official images or installing from ppa ? Did you consider using venv --copies ?
Do we actually need custom building instead of official images or installing from ppa ? Did you consider using venv --copies ?
Also don't like to compile it from scratch, but I tried all of those 3 things before, and it didn't work as expected at least for me:
- copying just a binary (from the official image or via venv later) won't work without copying some shared libs and probably something else (I wasn't able to run python on bionic after that) - but seems like it's the most proper solution here
- ppa doesn't support bionic anymore, jammy will be suspended soon
So, maybe I just need to invest a bit more time to replace compiling step with just using a copy of python.
Support of py3.12 was added instead within https://github.com/yandex/ch-backup/pull/167, so will close this one for now