From 1b741c56f9f9c842520aeabf5aa4da30d5e06bf4 Mon Sep 17 00:00:00 2001 From: JosepSampe Date: Wed, 6 May 2026 14:44:00 +0200 Subject: [PATCH] Update runtimes --- docs/Dockerfile | 2 +- .../backends/aliyun_fc/aliyun_fc.py | 2 +- .../serverless/backends/aliyun_fc/config.py | 1 - .../backends/aws_batch/aws_batch.py | 2 +- .../serverless/backends/aws_lambda/config.py | 2 -- .../azure_containers/azure_containers.py | 2 +- .../backends/azure_functions/config.py | 2 +- .../backends/code_engine/code_engine.py | 2 +- .../backends/gcp_cloudrun/cloudrun.py | 2 +- .../backends/gcp_functions/config.py | 1 - lithops/serverless/backends/ibm_cf/config.py | 2 -- lithops/serverless/backends/knative/config.py | 4 +-- .../serverless/backends/knative/knative.py | 2 +- .../knative/tekton/Dockerfile.python36 | 27 ------------------- .../knative/tekton/Dockerfile.python37 | 27 ------------------- .../knative/tekton/Dockerfile.python38 | 2 +- .../serverless/backends/openwhisk/config.py | 2 -- .../serverless/backends/oracle_f/config.py | 2 +- .../serverless/backends/oracle_f/oracle_f.py | 2 +- .../backends/singularity/singularity.py | 2 +- runtime/README.md | 6 ++--- runtime/aliyun_fc/README.md | 8 +++--- runtime/aws_batch/Dockerfile | 12 +++------ runtime/aws_batch/conda.Dockerfile | 8 ------ runtime/aws_ec2/README.md | 2 +- runtime/aws_lambda/Dockerfile | 4 --- runtime/aws_lambda/README.md | 6 ++--- runtime/azure_containers/Dockerfile | 10 +++---- runtime/azure_containers/README.md | 10 +++---- runtime/azure_functions/README.md | 8 +++--- runtime/code_engine/Dockerfile | 12 +++------ runtime/code_engine/Dockerfile.conda | 8 ------ runtime/code_engine/Dockerfile.mamba | 14 ++++------ runtime/code_engine/Dockerfile.opencv | 10 +++---- runtime/code_engine/README.md | 12 ++++----- runtime/gcp_cloudrun/Dockerfile | 10 +++---- runtime/gcp_cloudrun/Dockerfile.conda | 12 ++------- runtime/gcp_cloudrun/README.md | 6 ++--- runtime/gcp_functions/README.md | 6 ++--- runtime/ibm_vpc/README.md | 12 ++++----- runtime/knative/Dockerfile | 10 +++---- runtime/knative/Dockerfile.conda | 8 ------ runtime/knative/README.md | 8 +++--- runtime/kubernetes/Dockerfile.conda | 8 ------ runtime/kubernetes/README.md | 8 +++--- runtime/openwhisk/Dockerfile | 10 +++---- runtime/openwhisk/Dockerfile.conda | 8 ------ runtime/openwhisk/Dockerfile.dlib | 10 ------- runtime/openwhisk/Dockerfile.dso | 5 ---- runtime/openwhisk/Dockerfile.slim | 10 +++---- runtime/openwhisk/README.md | 8 +++--- runtime/oracle_f/Dockerfile | 8 ++---- runtime/singularity/README.md | 6 ++--- runtime/singularity/singularity-template.def | 12 ++++----- 54 files changed, 109 insertions(+), 276 deletions(-) delete mode 100644 lithops/serverless/backends/knative/tekton/Dockerfile.python36 delete mode 100644 lithops/serverless/backends/knative/tekton/Dockerfile.python37 delete mode 100644 runtime/openwhisk/Dockerfile.dlib delete mode 100644 runtime/openwhisk/Dockerfile.dso diff --git a/docs/Dockerfile b/docs/Dockerfile index 97bc4eb7e..cf8b9ad10 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-buster +FROM python:3.10-slim-bookworm RUN apt-get update \ && apt-get install --no-install-recommends -y \ diff --git a/lithops/serverless/backends/aliyun_fc/aliyun_fc.py b/lithops/serverless/backends/aliyun_fc/aliyun_fc.py index 8728b8e2e..5592b4a8e 100644 --- a/lithops/serverless/backends/aliyun_fc/aliyun_fc.py +++ b/lithops/serverless/backends/aliyun_fc/aliyun_fc.py @@ -108,7 +108,7 @@ def download_requirements(): if docker_path: # Build the runtime in a docker cmd = 'python3 -m pip install -U -t . -r requirements.txt' - cmd = f'docker run -w /tmp -v {build_dir}:/tmp python:{utils.CURRENT_PY_VERSION}-slim-buster {cmd}' + cmd = f'docker run -w /tmp -v {build_dir}:/tmp python:{utils.CURRENT_PY_VERSION}-slim-bookworm {cmd}' utils.run_command(cmd) else: logger.warning('Aliyun Functions use a Linux environment. Building' diff --git a/lithops/serverless/backends/aliyun_fc/config.py b/lithops/serverless/backends/aliyun_fc/config.py index 3a6123924..60b01554a 100644 --- a/lithops/serverless/backends/aliyun_fc/config.py +++ b/lithops/serverless/backends/aliyun_fc/config.py @@ -33,7 +33,6 @@ BUILD_DIR = os.path.join(TEMP_DIR, 'AliyunRuntimeBuild') AVAILABLE_PY_RUNTIMES = { - '3.6': 'python3', '3.9': 'python3.9', '3.10': 'python3.10' } diff --git a/lithops/serverless/backends/aws_batch/aws_batch.py b/lithops/serverless/backends/aws_batch/aws_batch.py index d0ca74b49..d566dbd23 100644 --- a/lithops/serverless/backends/aws_batch/aws_batch.py +++ b/lithops/serverless/backends/aws_batch/aws_batch.py @@ -117,7 +117,7 @@ def _build_default_runtime(self, runtime_name): python_version = utils.version_str(sys.version_info) dockerfile = "Dockerfile.default-batch-runtime" with open(dockerfile, 'w') as f: - f.write(f"FROM python:{python_version}-slim-buster\n") + f.write(f"FROM python:{python_version}-slim-bookworm\n") f.write(batch_config.DOCKERFILE_DEFAULT) try: self.build_runtime(runtime_name, dockerfile) diff --git a/lithops/serverless/backends/aws_lambda/config.py b/lithops/serverless/backends/aws_lambda/config.py index 4e8b45dc1..af4f6fe8f 100644 --- a/lithops/serverless/backends/aws_lambda/config.py +++ b/lithops/serverless/backends/aws_lambda/config.py @@ -32,8 +32,6 @@ ] AVAILABLE_PY_RUNTIMES = { - '3.6': 'python3.6', - '3.7': 'python3.7', '3.8': 'python3.8', '3.9': 'python3.9', '3.10': 'python3.10', diff --git a/lithops/serverless/backends/azure_containers/azure_containers.py b/lithops/serverless/backends/azure_containers/azure_containers.py index 6463c648d..d29a1b674 100644 --- a/lithops/serverless/backends/azure_containers/azure_containers.py +++ b/lithops/serverless/backends/azure_containers/azure_containers.py @@ -98,7 +98,7 @@ def _build_default_runtime(self, runtime_name): # Build default runtime using local dokcer dockerfile = "Dockefile.default-az-runtime" with open(dockerfile, 'w') as f: - f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-buster\n") + f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-bookworm\n") f.write(config.DEFAULT_DOCKERFILE) try: self.build_runtime(runtime_name, dockerfile) diff --git a/lithops/serverless/backends/azure_functions/config.py b/lithops/serverless/backends/azure_functions/config.py index 8c5265785..438d145f1 100644 --- a/lithops/serverless/backends/azure_functions/config.py +++ b/lithops/serverless/backends/azure_functions/config.py @@ -35,7 +35,7 @@ 'trigger': 'pub/sub' } -AVAILABLE_PY_RUNTIMES = ['3.7', '3.8', '3.9', '3.10', '3.11'] +AVAILABLE_PY_RUNTIMES = ['3.8', '3.9', '3.10', '3.11'] REQUIRED_AZURE_STORAGE_PARAMS = ('storage_account_name', 'storage_account_key') REQUIRED_AZURE_FUNCTIONS_PARAMS = ('resource_group', 'region') diff --git a/lithops/serverless/backends/code_engine/code_engine.py b/lithops/serverless/backends/code_engine/code_engine.py index ce5eb59a9..d48fcfcb3 100644 --- a/lithops/serverless/backends/code_engine/code_engine.py +++ b/lithops/serverless/backends/code_engine/code_engine.py @@ -284,7 +284,7 @@ def _build_default_runtime(self, default_runtime_img_name): # Build default runtime using local dokcer dockerfile = "Dockefile.default-ce-runtime" python_version = utils.CURRENT_PY_VERSION - base_image = "slim-buster" if int(python_version.split('.')[1]) < 13 else "bookworm" + base_image = "slim-bookworm" with open(dockerfile, 'w') as f: f.write(f"FROM python:{python_version}-{base_image}\n") f.write(config.DOCKERFILE_DEFAULT) diff --git a/lithops/serverless/backends/gcp_cloudrun/cloudrun.py b/lithops/serverless/backends/gcp_cloudrun/cloudrun.py index 758385cd4..0d483705c 100644 --- a/lithops/serverless/backends/gcp_cloudrun/cloudrun.py +++ b/lithops/serverless/backends/gcp_cloudrun/cloudrun.py @@ -145,7 +145,7 @@ def _build_default_runtime(self, runtime_name): # Build default runtime using local dokcer dockerfile = "Dockefile.default-kn-runtime" with open(dockerfile, 'w') as f: - f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-buster\n") + f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-bookworm\n") f.write(config.DEFAULT_DOCKERFILE) try: self.build_runtime(runtime_name, dockerfile) diff --git a/lithops/serverless/backends/gcp_functions/config.py b/lithops/serverless/backends/gcp_functions/config.py index 4963ee7c0..4d774b1d8 100644 --- a/lithops/serverless/backends/gcp_functions/config.py +++ b/lithops/serverless/backends/gcp_functions/config.py @@ -30,7 +30,6 @@ RUNTIME_MEMORY_OPTIONS = {128, 256, 512, 1024, 2048, 4096, 8192} AVAILABLE_PY_RUNTIMES = { - '3.7': 'python37', '3.8': 'python38', '3.9': 'python39', '3.10': 'python310', diff --git a/lithops/serverless/backends/ibm_cf/config.py b/lithops/serverless/backends/ibm_cf/config.py index 2e4a6b184..0c1e2707e 100644 --- a/lithops/serverless/backends/ibm_cf/config.py +++ b/lithops/serverless/backends/ibm_cf/config.py @@ -18,8 +18,6 @@ import os AVAILABLE_PY_RUNTIMES = { - '3.6': 'docker.io/lithopscloud/ibmcf-python-v36', - '3.7': 'docker.io/lithopscloud/ibmcf-python-v37', '3.8': 'docker.io/lithopscloud/ibmcf-python-v38', '3.9': 'docker.io/lithopscloud/ibmcf-python-v39', '3.10': 'docker.io/lithopscloud/ibmcf-python-v310', diff --git a/lithops/serverless/backends/knative/config.py b/lithops/serverless/backends/knative/config.py index 755f85cd6..81c7b4aa0 100644 --- a/lithops/serverless/backends/knative/config.py +++ b/lithops/serverless/backends/knative/config.py @@ -164,9 +164,9 @@ name: lithops-git params: - name: pathToDockerFile - value: lithops/compute/backends/knative/tekton/Dockerfile.python36 + value: lithops/compute/backends/knative/tekton/Dockerfile.python38 - name: imageUrl - value: docker.io/jsampe/lithops-knative-v36 + value: docker.io/jsampe/lithops-knative-v38 - name: imageTag value: latest """ diff --git a/lithops/serverless/backends/knative/knative.py b/lithops/serverless/backends/knative/knative.py index 03cfa67a5..e05297110 100644 --- a/lithops/serverless/backends/knative/knative.py +++ b/lithops/serverless/backends/knative/knative.py @@ -373,7 +373,7 @@ def _build_default_runtime(self, default_runtime_img_name): # Build default runtime using local dokcer dockerfile = "Dockefile.default-kn-runtime" with open(dockerfile, 'w') as f: - f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-buster\n") + f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-bookworm\n") f.write(config.DEFAULT_DOCKERFILE) try: self.build_runtime(default_runtime_img_name, dockerfile) diff --git a/lithops/serverless/backends/knative/tekton/Dockerfile.python36 b/lithops/serverless/backends/knative/tekton/Dockerfile.python36 deleted file mode 100644 index 2fcee8e10..000000000 --- a/lithops/serverless/backends/knative/tekton/Dockerfile.python36 +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.6-slim-buster - -RUN apt-get update && apt-get install -y \ - zip \ - && rm -rf /var/lib/apt/lists/* - -RUN pip install --upgrade setuptools six \ - && pip install --no-cache-dir \ - gunicorn==19.9.0 \ - pika==0.13.1 \ - flask \ - gevent \ - ibm-cos-sdk \ - redis \ - requests \ - PyYAML \ - kubernetes \ - numpy - -# Copy Lithops proxy and lib to the container image. -ENV APP_HOME /lithops -WORKDIR $APP_HOME - -COPY lithops ./lithops -COPY lithops/serverless/backends/knative/entry_point.py lithopsproxy.py - -CMD exec gunicorn --bind :$PORT --workers 1 --timeout 600 lithopsproxy:proxy diff --git a/lithops/serverless/backends/knative/tekton/Dockerfile.python37 b/lithops/serverless/backends/knative/tekton/Dockerfile.python37 deleted file mode 100644 index 77541e82a..000000000 --- a/lithops/serverless/backends/knative/tekton/Dockerfile.python37 +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.7-slim-buster - -RUN apt-get update && apt-get install -y \ - zip \ - && rm -rf /var/lib/apt/lists/* - -RUN pip install --upgrade setuptools six \ - && pip install --no-cache-dir \ - gunicorn==19.9.0 \ - pika==0.13.1 \ - flask \ - gevent \ - ibm-cos-sdk \ - redis \ - requests \ - PyYAML \ - kubernetes \ - numpy - -# Copy Lithops proxy and lib to the container image. -ENV APP_HOME /lithops -WORKDIR $APP_HOME - -COPY lithops ./lithops -COPY lithops/serverless/backends/knative/entry_point.py lithopsproxy.py - -CMD exec gunicorn --bind :$PORT --workers 1 --timeout 600 lithopsproxy:proxy diff --git a/lithops/serverless/backends/knative/tekton/Dockerfile.python38 b/lithops/serverless/backends/knative/tekton/Dockerfile.python38 index ab90342a0..186ea7d4b 100644 --- a/lithops/serverless/backends/knative/tekton/Dockerfile.python38 +++ b/lithops/serverless/backends/knative/tekton/Dockerfile.python38 @@ -1,4 +1,4 @@ -FROM python:3.8.2-slim-buster +FROM python:3.8.2-slim-bookworm RUN apt-get update && apt-get install -y \ zip \ diff --git a/lithops/serverless/backends/openwhisk/config.py b/lithops/serverless/backends/openwhisk/config.py index d182fd821..bc4b39d2d 100644 --- a/lithops/serverless/backends/openwhisk/config.py +++ b/lithops/serverless/backends/openwhisk/config.py @@ -17,8 +17,6 @@ import os AVAILABLE_PY_RUNTIMES = { - '3.6': 'docker.io/lithopscloud/openwhisk-python-v36', - '3.7': 'docker.io/lithopscloud/openwhisk-python-v37', '3.8': 'docker.io/lithopscloud/openwhisk-python-v38', '3.9': 'docker.io/lithopscloud/openwhisk-python-v39', '3.10': 'docker.io/lithopscloud/openwhisk-python-v310', diff --git a/lithops/serverless/backends/oracle_f/config.py b/lithops/serverless/backends/oracle_f/config.py index b667afbef..c2a29854c 100644 --- a/lithops/serverless/backends/oracle_f/config.py +++ b/lithops/serverless/backends/oracle_f/config.py @@ -76,7 +76,7 @@ ENTRYPOINT ["/usr/local/bin/fdk", "handler/entry_point.py", "handler"] """ -AVAILABLE_PY_RUNTIMES = ['3.6', '3.7', '3.8', '3.9', '3.11'] +AVAILABLE_PY_RUNTIMES = ['3.8', '3.9', '3.11'] REQ_PARAMS_1 = ('compartment_id', 'user', 'key_file', 'region', 'tenancy', 'fingerprint') REQ_PARAMS_2 = ('subnet_id', ) diff --git a/lithops/serverless/backends/oracle_f/oracle_f.py b/lithops/serverless/backends/oracle_f/oracle_f.py index 637b5ffb0..0c52a4af6 100644 --- a/lithops/serverless/backends/oracle_f/oracle_f.py +++ b/lithops/serverless/backends/oracle_f/oracle_f.py @@ -227,7 +227,7 @@ def _build_default_runtime(self, runtime_name): # Build default runtime using local dokcer dockerfile = "Dockefile.default-oracle-runtime" with open(dockerfile, 'w') as f: - f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-buster\n") + f.write(f"FROM python:{utils.CURRENT_PY_VERSION}-slim-bookworm\n") f.write(config.DEFAULT_DOCKERFILE) try: self.build_runtime(runtime_name, dockerfile) diff --git a/lithops/serverless/backends/singularity/singularity.py b/lithops/serverless/backends/singularity/singularity.py index 10c62882b..79ed5f570 100644 --- a/lithops/serverless/backends/singularity/singularity.py +++ b/lithops/serverless/backends/singularity/singularity.py @@ -108,7 +108,7 @@ def _create_default_runtime(self): with open(singularityfile, 'w') as f: f.write("Bootstrap: docker\n") - f.write(f"From: python:{utils.CURRENT_PY_VERSION}-slim-buster\n") + f.write(f"From: python:{utils.CURRENT_PY_VERSION}-slim-bookworm\n") f.write(config.SINGULARITYFILE_DEFAULT) return singularityfile diff --git a/runtime/README.md b/runtime/README.md index 34cda20d3..a7e77b6b5 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -6,10 +6,10 @@ Choose your compute backend: 2. [IBM VPC](ibm_vpc/) 3. [AWS Lambda](aws_lambda/) 4. [AWS EC2](aws_ec2/) -2. [Google Cloud Functions](gcp_functions/) -3. [Google Cloud Run](gcp_cloudrun/) +5. [Google Cloud Functions](gcp_functions/) +6. [Google Cloud Run](gcp_cloudrun/) 7. [Azure Functions](azure_functions/) -8. [Azure Container APPs](azure_containers/) +8. [Azure Container Apps](azure_containers/) 9. [Aliyun Functions Compute](aliyun_fc/) 10. [Kubernetes](kubernetes/) 11. [OpenWhisk](openwhisk/) diff --git a/runtime/aliyun_fc/README.md b/runtime/aliyun_fc/README.md index 55fe8b8f9..e7e640106 100644 --- a/runtime/aliyun_fc/README.md +++ b/runtime/aliyun_fc/README.md @@ -2,7 +2,7 @@ The runtime is the place where your functions are executed. The default runtime is automatically created the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. -Currently, Aliyun Functions Compute supports Python 3.6, 3.9 and 3.10. You can find the list of pre-installed modules [here](https://www.alibabacloud.com/help/en/function-compute/latest/python-event-functions). In addition, the Lithops default runtimes are built with the packages included in this [requirements.txt](requirements.txt) file: +Currently, Aliyun Functions Compute supports Python 3.9 and 3.10. You can find the list of pre-installed modules [here](https://www.alibabacloud.com/help/en/function-compute/latest/python-event-functions). In addition, the Lithops default runtimes are built with the packages included in this [requirements.txt](requirements.txt) file: To run a function with the default runtime you don't need to specify anything in the code, since everything is handled internally by Lithops: @@ -30,7 +30,7 @@ pw = lithops.FunctionExecutor(runtime_memory=512) If you require additional Python modules not included in the default runtime, you can create your own custom Lithops runtime incorporating them. To create a custom runtime, compile all the necessary modules into a `requirements.txt` file. -For instance, if you wish to integrate the `matplotlib` module into your runtime, which isn't part of the default setup, you need to append it to the existing [requirements.txt](requirements.txt) file. Note that this `requirements.txt` contains the mandatory pakcges required by lithops, so you don't have to remove any of them from the list, but just add your packages at the end. +For instance, if you wish to integrate the `matplotlib` module into your runtime, which isn't part of the default setup, you need to append it to the existing [requirements.txt](requirements.txt) file. Note that this `requirements.txt` contains the mandatory packages required by lithops, so you don't have to remove any of them from the list, but just add your packages at the end. After updating the file accordingly, you can proceed to build the custom runtime by specifying the modified `requirements.txt` file along with a chosen runtime name: @@ -38,7 +38,7 @@ After updating the file accordingly, you can proceed to build the custom runtime $ lithops runtime build -b aliyun_fc -f requirements.txt my_matplotlib_runtime ``` -This command will built and deploy a runtime called `my_matplotlib_runtime` to the available Aliyun FUnctions Compute runtimes. +This command will build and deploy a runtime called `my_matplotlib_runtime` to the available Aliyun Functions Compute runtimes. Finally, we can specify this new runtime when creating a Lithops Function Executor: @@ -55,4 +55,4 @@ res = lith.get_result() print(res) ``` -Note that both the client and the runtime must have the same python version. If you are running Lithops, for example, with Python 3.8, `my_matplotlib_runtime` will be a Python 3.8 runtime with the extra modules specified installed. +Note that both the client and the runtime must have the same Python version. If you are running Lithops, for example, with Python 3.8, `my_matplotlib_runtime` will be a Python 3.8 runtime with the extra modules specified installed. diff --git a/runtime/aws_batch/Dockerfile b/runtime/aws_batch/Dockerfile index 2d54e8aa0..c6923f831 100644 --- a/runtime/aws_batch/Dockerfile +++ b/runtime/aws_batch/Dockerfile @@ -1,17 +1,13 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -FROM python:3.10-slim-buster +FROM python:3.10-slim-bookworm RUN apt-get update && apt-get install -y \ zip \ @@ -40,4 +36,4 @@ WORKDIR $APP_HOME COPY lithops_aws_batch.zip . RUN unzip lithops_aws_batch.zip && rm lithops_aws_batch.zip -ENTRYPOINT python entry_point.py \ No newline at end of file +ENTRYPOINT python entry_point.py diff --git a/runtime/aws_batch/conda.Dockerfile b/runtime/aws_batch/conda.Dockerfile index 2b671bfe1..f186cced0 100644 --- a/runtime/aws_batch/conda.Dockerfile +++ b/runtime/aws_batch/conda.Dockerfile @@ -1,9 +1,3 @@ -# Python 3.6 -#FROM continuumio/miniconda3:4.5.4 - -# Python 3.7 -#FROM continuumio/miniconda3:4.7.12 - # Python 3.8 #FROM continuumio/miniconda3:4.9.2 @@ -11,8 +5,6 @@ FROM continuumio/miniconda3:4.10.3 # YOU MUST PIN THE PYTHON VERSION TO PREVENT IT TO BE UPDATED -# For python 3.6 use "python==3.6.5" -# For python 3.7 use "python==3.7.4" # For python 3.8 use "python==3.8.5" # For python 3.9 use "python==3.9.5" RUN echo "python==3.9.13" >> /opt/conda/conda-meta/pinned diff --git a/runtime/aws_ec2/README.md b/runtime/aws_ec2/README.md index 824336589..152640162 100644 --- a/runtime/aws_ec2/README.md +++ b/runtime/aws_ec2/README.md @@ -31,7 +31,7 @@ If you want to upload local files to the custom VM Image, you can include them u lithops image build -b aws_ec2 -f myscript.sh -i /home/user/test.bin:/home/ubuntu/test.bin custom-lithops-runtime ``` -In the case of using using a custom name, you must provide the `target_ami`, printed at the end of the build command, in your lithops config, for example: +In the case of using a custom name, you must provide the `target_ami`, printed at the end of the build command, in your lithops config, for example: ```yaml aws_ec2: diff --git a/runtime/aws_lambda/Dockerfile b/runtime/aws_lambda/Dockerfile index 1f999b4ad..935f6f0fb 100644 --- a/runtime/aws_lambda/Dockerfile +++ b/runtime/aws_lambda/Dockerfile @@ -1,8 +1,4 @@ -# Python 3.6 -#FROM python:3.6-slim-trixie -# Python 3.7 -#FROM python:3.7-slim-trixie # Python 3.8 #FROM python:3.8-slim-trixie diff --git a/runtime/aws_lambda/README.md b/runtime/aws_lambda/README.md index 471df70e0..13ffddaec 100644 --- a/runtime/aws_lambda/README.md +++ b/runtime/aws_lambda/README.md @@ -5,7 +5,7 @@ The runtime is the place where your functions are executed. AWS Lambda provides two methods for packaging the function code and dependencies of a runtime: ## Using predefined **runtimes** and **layers** -An AWS Lambda *runtime* is a predefined environment to run code on Lambda. For example, for Lithops we use runtimes for python >= 3.6 that come with already preinstalled modules. A *layer* is a set of packaged dependencies that can be used by multiple runtimes. For example, Lithops dependencies are deployed as a layer, so if multiple runtimes are created with different memory values, they can mount the same layer containing the dependencies, instead +An AWS Lambda *runtime* is a predefined environment to run code on Lambda. For example, for Lithops we use runtimes for Python >= 3.8 that come with already preinstalled modules. A *layer* is a set of packaged dependencies that can be used by multiple runtimes. For example, Lithops dependencies are deployed as a layer, so if multiple runtimes are created with different memory values, they can mount the same layer containing the dependencies, instead of deploying them separately for each runtime. [In this link](https://gist.github.com/gene1wood/4a052f39490fae00e0c3#gistcomment-3131227) you can find which modules are preinstalled by default in an AWS Lambda Python runtime. Moreover, Lithops runtime also ships with the following packages: @@ -56,13 +56,13 @@ so that they can be used in the Lambda code. To build your own runtime, first install [Docker CE](https://docs.docker.com/get-docker/) in your client machine. Update the [template Dockerfile](Dockerfile) that better fits to your requirements with your required system packages and Python modules. -You can add a container layer (`RUN ...`) to install additional Python modules using `pip` or system libraries using `apt`, or even change Python version to a older/newer one. +You can add a container layer (`RUN ...`) to install additional Python modules using `pip` or system libraries using `apt`, or even change to an older or newer Python version. If you plan to use the **ARM64** architecture, you should consider creating a new dockerfile with an arm image from [https://gallery.ecr.aws/lambda/python](https://gallery.ecr.aws/lambda/python), in the tab "image tags". For example, you should start the dockerfile with the line `FROM public.ecr.aws/lambda/python:3.9-arm64` Then, to build the custom runtime, use `lithops runtime build` CLI specifying the modified `Dockerfile` file and a runtime name. Note that you only need to specify the container name: `my-container-runtime-name`. -As far as possible, avoid using 'points' ('.') in the runtime name. +Avoid using dots ('.') in the runtime name when possible. ``` lithops runtime build -f MyDockerfile -b aws_lambda my-container-runtime-name diff --git a/runtime/azure_containers/Dockerfile b/runtime/azure_containers/Dockerfile index 5f3a71a79..8d89825ee 100644 --- a/runtime/azure_containers/Dockerfile +++ b/runtime/azure_containers/Dockerfile @@ -1,17 +1,13 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -FROM python:3.9-slim-buster +FROM python:3.9-slim-bookworm # Python 3.10 -#FROM python:3.10-slim-buster +#FROM python:3.10-slim-bookworm RUN apt-get update && apt-get install -y \ zip \ diff --git a/runtime/azure_containers/README.md b/runtime/azure_containers/README.md index d677c0bf8..d86075c05 100644 --- a/runtime/azure_containers/README.md +++ b/runtime/azure_containers/README.md @@ -1,8 +1,8 @@ # Lithops runtime for Azure Container Apps -The runtime is the place where the functions are executed. In Azure Container Apps, runtimes are based on docker images, in this sense you can run functions using any Python version > 3.6. +The runtime is the place where the functions are executed. In Azure Container Apps, runtimes are based on Docker images, so you can run functions with modern Python versions supported by your base image. -For running lithops on Azure Container Apps, you need a runtime build on the docker hub (or any other container registry), or you need a docker hub account for placing the runtimes created by lithops. +For running lithops on Azure Container Apps, you need a runtime built on Docker Hub (or any other container registry), or you need a Docker Hub account for placing the runtimes created by lithops. If you don't have an already built runtime, the default runtime is built the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. @@ -39,7 +39,7 @@ azure_containers: If you need some Python modules (or other system libraries) which are not included in the default docker images (see table above), it is possible to build your own Lithops runtime with all of them. - This alternative usage is based on to build a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. + This option is based on building a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. Project provides some skeletons of Docker images, for example: * [Dockerfile](Dockerfile) @@ -51,7 +51,7 @@ azure_containers: $ docker login Update the Dockerfile that better fits to your requirements with your required system packages and Python modules. - If you need another Python version, for example Python 3.12, you must change the initial line of the Dockefile: + If you need another Python version, for example Python 3.12, you must change the initial line of the Dockerfile: $ lithops runtime build -b azure_containers docker_username/runtimename:tag @@ -71,7 +71,7 @@ azure_containers: fexec = lithops.FunctionExecutor(runtime='myaccount/lithops-ca-custom-v312:01') ``` - *NOTE: In this previous example shows how to build a Docker image based on Python 3.12, this means that now you also need Python 3.12 in the client machine.* + *Note: if you build a Docker image based on Python 3.12, your client should also run Python 3.12.* 2. **Use an already built runtime from a public repository** diff --git a/runtime/azure_functions/README.md b/runtime/azure_functions/README.md index 4980ccf63..255ef5670 100644 --- a/runtime/azure_functions/README.md +++ b/runtime/azure_functions/README.md @@ -2,7 +2,7 @@ The runtime is the place where your functions are executed. The default runtime is automatically created the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. -Currently, Azure Functions supports Python 3.6, 3.7, 3.8 and 3.9. You can find the list of pre-installed modules [here](https://github.com/Azure/azure-functions-python-worker/wiki/Preinstalled-Python-Libraries). In addition, the Lithops default runtimes are built with the packages included in this [requirements.txt](requirements.txt) file +Currently, Azure Functions supports Python 3.8, 3.9, 3.10 and 3.11. You can find the list of pre-installed modules [here](https://github.com/Azure/azure-functions-python-worker/wiki/Preinstalled-Python-Libraries). In addition, the Lithops default runtimes are built with the packages included in this [requirements.txt](requirements.txt) file To run a function with the default runtime you don't need to specify anything in the code, since everything is handled internally by Lithops: @@ -25,16 +25,16 @@ result = lithops.get_result() If you require additional Python modules not included in the default runtime, you can create your own custom Lithops runtime incorporating them. To create a custom runtime, compile all the necessary modules into a `requirements.txt` file. -For instance, if you wish to integrate the `matplotlib` module into your runtime, which isn't part of the default setup, you need to append it to the existing [requirements.txt](requirements.txt) file. Note that this `requirements.txt` contains the mandatory pakcges required by lithops, so you don't have to remove any of them from the list, but just add your packages at the end. +For instance, if you wish to integrate the `matplotlib` module into your runtime, which isn't part of the default setup, you need to append it to the existing [requirements.txt](requirements.txt) file. Note that this `requirements.txt` contains the mandatory packages required by lithops, so you don't have to remove any of them from the list, but just add your packages at the end. -**IMPORTANT**: Note that the runtime is built using your local machine, and some libraries, like Numpy, compile some *C* code based on the Operating System you are using. Azure functions run on a Linux machine, this mean that if you use **MacOS** or **Windows** for building the runtime, those libraries that compiled *C* code cannot be executed from within the function. In this case, you must use a Linux machine for building the runtime. +**IMPORTANT**: Note that the runtime is built using your local machine, and some libraries, like Numpy, compile some *C* code based on the Operating System you are using. Azure functions run on a Linux machine, this means that if you use **macOS** or **Windows** for building the runtime, libraries that compile *C* code may not run correctly inside the function. In this case, you must use a Linux machine for building the runtime. After updating the file accordingly, you can proceed to build the custom runtime by specifying the modified `requirements.txt` file along with a chosen runtime name: ``` $ lithops runtime build -b azure_functions -f requirements.txt matplotlib-runtime ``` -This command will built a runtime called `matplotlib-runtime` in your local machine. Then, to deploy the runtime to the available Azure Functions runtimes, execute: +This command will build a runtime called `matplotlib-runtime` in your local machine. Then, to deploy the runtime to the available Azure Functions runtimes, execute: ``` $ lithops runtime deploy -b azure_functions -s azure_storage matplotlib-runtime ``` diff --git a/runtime/code_engine/Dockerfile b/runtime/code_engine/Dockerfile index d0e3a38be..2a809f0b0 100644 --- a/runtime/code_engine/Dockerfile +++ b/runtime/code_engine/Dockerfile @@ -1,20 +1,16 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -FROM python:3.10-slim-buster +FROM python:3.10-slim-bookworm # Python 3.11 -# FROM python:3.11-slim-buster +# FROM python:3.11-slim-bookworm RUN apt-get update \ # add the required packages diff --git a/runtime/code_engine/Dockerfile.conda b/runtime/code_engine/Dockerfile.conda index fe1d7985a..2eb41121f 100644 --- a/runtime/code_engine/Dockerfile.conda +++ b/runtime/code_engine/Dockerfile.conda @@ -1,9 +1,3 @@ -# Python 3.6 -#FROM docker.io/continuumio/miniconda3:4.5.4 - -# Python 3.7 -#FROM docker.io/continuumio/miniconda3:4.7.12 - # Python 3.8 #FROM docker.io/continuumio/miniconda3:4.9.2 @@ -17,8 +11,6 @@ FROM docker.io/continuumio/miniconda3:23.3.1-0 #FROM docker.io/continuumio/miniconda3:23.10.0-1 # YOU MUST PIN THE PYTHON VERSION TO PREVENT IT TO BE UPDATED -# For python 3.6 use "python==3.6.5" -# For python 3.7 use "python==3.7.4" # For python 3.8 use "python==3.8.5" # For python 3.9 use "python==3.9.5" # For python 3.10 use "python==3.10.10" diff --git a/runtime/code_engine/Dockerfile.mamba b/runtime/code_engine/Dockerfile.mamba index 04c4b80b1..012dad98a 100644 --- a/runtime/code_engine/Dockerfile.mamba +++ b/runtime/code_engine/Dockerfile.mamba @@ -1,20 +1,16 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -FROM python:3.10-slim-buster +FROM python:3.10-slim-bookworm # Python 3.11 -# FROM python:3.11-slim-buster +# FROM python:3.11-slim-bookworm RUN apt-get update \ # add the required packages @@ -78,4 +74,4 @@ COPY lithops_codeengine.zip . RUN unzip lithops_codeengine.zip && rm lithops_codeengine.zip CMD exec gunicorn --bind :$PORT --workers $CONCURRENCY --timeout $TIMEOUT lithopsentry:proxy - \ No newline at end of file + diff --git a/runtime/code_engine/Dockerfile.opencv b/runtime/code_engine/Dockerfile.opencv index 3174a06a2..4944f702f 100644 --- a/runtime/code_engine/Dockerfile.opencv +++ b/runtime/code_engine/Dockerfile.opencv @@ -1,17 +1,13 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -FROM python:3.8-slim-buster +FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -#FROM python:3.10-slim-buster +#FROM python:3.10-slim-bookworm RUN apt-get update \ # add some packages required for the pip install diff --git a/runtime/code_engine/README.md b/runtime/code_engine/README.md index 04639a4fa..2cb62ae88 100644 --- a/runtime/code_engine/README.md +++ b/runtime/code_engine/README.md @@ -1,8 +1,8 @@ # Lithops runtime for IBM Code Engine -The runtime is the place where the functions are executed. In IBM Code Engine, runtimes are based on docker images, in this sense you can run functions using any Python version > 3.6. +The runtime is the place where the functions are executed. In IBM Code Engine, runtimes are based on docker images, in this sense you can run functions using modern Python versions supported by your base image. -For running lithops on Code Engine, you need a runtime build on the docker hub (or any other container registry), or you need a docker hub account for placing the runtimes automatically created by lithops. +For running lithops on Code Engine, you need a runtime built on Docker Hub (or any other container registry), or you need a Docker Hub account for placing the runtimes automatically created by lithops. If you don't have an already built runtime, the default runtime is built the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. @@ -28,7 +28,7 @@ result = fexec.get_result() By default, Lithops uses 256MB as runtime memory size and 0.125vCPU for the Code Engine runtimes. However, you can change it in the `config` by setting the appropriate vCPU and memory sizes: ```yaml -code_enigne: +code_engine: runtime_memory: 256 runtime_cpu: 0.5 ``` @@ -40,7 +40,7 @@ code_enigne: If you need some Python modules (or other system libraries) which are not included in the default docker images (see table above), it is possible to build your own Lithops runtime with all of them. - This alternative usage is based on to build a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. + This option is based on building a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. Project provides some skeletons of Docker images, for example: * [Dockerfile](Dockerfile) @@ -52,7 +52,7 @@ code_enigne: $ docker login Update the Dockerfile that better fits to your requirements with your required system packages and Python modules. - If you need another Python version, for example Python 3.12, you must change the initial line of the Dockefile: + If you need another Python version, for example Python 3.12, you must change the initial line of the Dockerfile: $ lithops runtime build docker_username/runtimename:tag -b code_engine @@ -72,7 +72,7 @@ code_enigne: fexec = lithops.FunctionExecutor(runtime='myaccount/lithops-ce-custom-v312:01') ``` - *NOTE: In this previous example shows how to build a Docker image based on Python 3.12, this means that now you also need Python 3.12 in the client machine.* + *Note: if you build a Docker image based on Python 3.12, your client should also run Python 3.12.* 2. **Use an already built runtime from a public repository** diff --git a/runtime/gcp_cloudrun/Dockerfile b/runtime/gcp_cloudrun/Dockerfile index 9c02809cc..4f71a8030 100644 --- a/runtime/gcp_cloudrun/Dockerfile +++ b/runtime/gcp_cloudrun/Dockerfile @@ -1,17 +1,13 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -FROM python:3.10-slim-buster +FROM python:3.10-slim-bookworm RUN apt-get update && apt-get install -y \ zip \ diff --git a/runtime/gcp_cloudrun/Dockerfile.conda b/runtime/gcp_cloudrun/Dockerfile.conda index e2fd1da4b..d374bc6bf 100644 --- a/runtime/gcp_cloudrun/Dockerfile.conda +++ b/runtime/gcp_cloudrun/Dockerfile.conda @@ -1,17 +1,9 @@ -# Python 3.6 -FROM continuumio/miniconda3:4.5.4 - -# Python 3.7 -#FROM continuumio/miniconda3:4.7.12 - # Python 3.8 -#FROM continuumio/miniconda3:4.9.2 +FROM continuumio/miniconda3:4.9.2 # YOU MUST PIN THE PYTHON VERSION TO PREVENT IT TO BE UPDATED -# For python 3.6 use "python==3.6.5" -# For python 3.7 use "python==3.7.4" # For python 3.8 use "python==3.8.5" -RUN echo "python==3.6.5" >> /opt/conda/conda-meta/pinned +RUN echo "python==3.8.5" >> /opt/conda/conda-meta/pinned RUN apt-get update && apt-get install -y \ diff --git a/runtime/gcp_cloudrun/README.md b/runtime/gcp_cloudrun/README.md index 1ff6c117e..7daf34ebd 100644 --- a/runtime/gcp_cloudrun/README.md +++ b/runtime/gcp_cloudrun/README.md @@ -34,7 +34,7 @@ import lithops pw = lithops.FunctionExecutor(runtime_memory=512) ``` -By default, Lithops uses 1vCPU for the Google Cloud Run runtimes. However, you can change it in the `config` by setting the appropiate vCPU size in vCPUs units. +By default, Lithops uses 1 vCPU for Google Cloud Run runtimes. You can change it in the `config` by setting `runtime_cpu`. ```yaml gcp_cloudrun: @@ -47,7 +47,7 @@ gcp_cloudrun: If you need some Python modules (or other system libraries) which are not included in the default container image, it is possible to build your own Lithops runtime with all of them. - This alternative usage is based on to build a local container image, deploy it to GCR and use it as a Lithops base runtime. + This option is based on building a local container image, deploy it to GCR and use it as a Lithops base runtime. Project provides some skeletons of Docker images, for example: * [Dockerfile](Dockerfile) @@ -55,7 +55,7 @@ gcp_cloudrun: To build your own runtime, first install the Docker CE version in your client machine. You can find the instructions [here](https://docs.docker.com/get-docker/). If you already have Docker installed omit this step. Update the Dockerfile that better fits to your requirements with your required system packages and Python modules. - If you need another Python version, for example Python 3.12, you must change the initial line of the Dockefile. + If you need another Python version, for example Python 3.12, you must change the initial line of the Dockerfile. For example, we will add `PyTorch` to our Lithops runtime. The Dockerfile would look like this: ```dockerfile diff --git a/runtime/gcp_functions/README.md b/runtime/gcp_functions/README.md index e80016859..8d0525dde 100644 --- a/runtime/gcp_functions/README.md +++ b/runtime/gcp_functions/README.md @@ -1,8 +1,8 @@ # Lithops runtime for Google Cloud Functions -Google Cloud Functions operate within a runtime environment distinct from other serverless platforms like Google Cloud Run, as they do not rely on containers from the user prespective. Consequently, specifying a container image as the function's runtime isn't feasible. However, you can enhance the default package set by providing a custom `requirements.txt` file, allowing for the inclusion of additional Python modules automatically installable via `pip`. +Google Cloud Functions operate within a runtime environment distinct from other serverless platforms like Google Cloud Run, as they do not rely on containers from the user perspective. Consequently, specifying a container image as the function's runtime isn't feasible. However, you can enhance the default package set by providing a custom `requirements.txt` file, allowing for the inclusion of additional Python modules automatically installable via `pip`. -Currently, Google Cloud Functions supports Python >= 3.7. You can find the list of pre-installed modules [here](https://cloud.google.com/functions/docs/writing/specifying-dependencies-python#pre-installed_packages). In addition, the Lithops default runtimes are built with the packages included in this [requirements.txt](requirements.txt) file: +Currently, Google Cloud Functions supports Python >= 3.8. You can find the list of pre-installed modules [here](https://cloud.google.com/functions/docs/writing/specifying-dependencies-python#pre-installed_packages). In addition, the Lithops default runtimes are built with the packages included in this [requirements.txt](requirements.txt) file: The default runtime is created automatically the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. In this sense, to run a function with the default runtime you don't need to specify anything in the code, since everything is managed internally by Lithops: @@ -30,7 +30,7 @@ pw = lithops.FunctionExecutor(runtime_memory=512) If you require additional Python modules not included in the default runtime, you can create your own custom Lithops runtime incorporating them. To create a custom runtime, compile all the necessary modules into a `requirements.txt` file. -For instance, if you wish to integrate the `matplotlib` module into your runtime, which isn't part of the default setup, you need to append it to the existing [requirements.txt](requirements.txt) file. Note that this `requirements.txt` contains the mandatory pakcges required by lithops, so you don't have to remove any of them from the list, but just add your packages at the end. +For instance, if you wish to integrate the `matplotlib` module into your runtime, which isn't part of the default setup, you need to append it to the existing [requirements.txt](requirements.txt) file. Note that this `requirements.txt` contains the mandatory packages required by lithops, so you don't have to remove any of them from the list, but just add your packages at the end. After updating the file accordingly, you can proceed to build the custom runtime by specifying the modified `requirements.txt` file along with a chosen runtime name: diff --git a/runtime/ibm_vpc/README.md b/runtime/ibm_vpc/README.md index ec97b3be4..53806c84f 100644 --- a/runtime/ibm_vpc/README.md +++ b/runtime/ibm_vpc/README.md @@ -11,7 +11,7 @@ lithops image build -b ibm_vpc ``` This command will create an image called "lithops-ubuntu-22-04-3-minimal-amd64-1" in the target region. -If the image already exists, and you want to updete it, use the `--overwrite` or `-o` parameter: +If the image already exists, and you want to update it, use the `--overwrite` or `-o` parameter: ``` lithops image build -b ibm_vpc --overwrite @@ -31,7 +31,7 @@ If you want to upload local files to the custom VM Image, you can include them u lithops image build -b ibm_vpc -f myscript.sh -i /home/user/test.bin:/home/ubuntu/test.bin custom-lithops-runtime ``` -In the case of using using a custom name, you must provide the Image ID, printed at the end of the build command, in your lithops config, for eaxmple: +In the case of using a custom name, you must provide the Image ID, printed at the end of the build command, in your lithops config, for example: ```yaml ibm_vpc: @@ -42,7 +42,7 @@ ibm_vpc: ## Option 2: -You can create a VM image manually. For example, you can create a VM in you AWS region, access the VM, install all the dependencies in the VM itself (apt-get, pip3 install, ...), stop the VM, create a VM Image, and then put the image_id in your lithops config, for example: +You can create a VM image manually. For example, you can create a VM in your IBM Cloud region, access the VM, install all the dependencies in the VM itself (apt-get, pip3 install, ...), stop the VM, create a VM Image, and then put the image_id in your lithops config, for example: ```yaml ibm_vpc: @@ -64,14 +64,14 @@ and make it executable with ### Build the Image with Docker runtime -If you plan to run your function within a **docker runtime** in the VM, it is preferable to include the docker image into the VM image. In this way, you will avoid the initial `docker pull ` command, thus reducing the overall execution time. To do so, add the `-d` flag followed by the docker image name you plant to use, for example: +If you plan to run your function within a **docker runtime** in the VM, it is preferable to include the docker image into the VM image. In this way, you will avoid the initial `docker pull ` command, thus reducing the overall execution time. To do so, add the `-d` flag followed by the docker image name you plan to use, for example: ``` $ ./build_lithops_vm_image.sh -d lithopscloud/ibmcf-python-v38 lithops-ubuntu-20.04.qcow2 ``` **Important** -Lithops will include all the local Docker images together with the Lithops runtime. To avoid this and include only Lithops runtime, it's adviced to delete all local Docker images or run the script in a vanilla Ubuntu 20.04 VM. To delete all local images and include only Lithops runtime you need to execute +Lithops will include all the local Docker images together with the Lithops runtime. To avoid this and include only Lithops runtime, it's advised to delete all local Docker images or run the script in a vanilla Ubuntu 20.04 VM. To delete all local images and include only Lithops runtime you need to execute ``` $ ./build_lithops_vm_image.sh -p prune -d lithopscloud/ibmcf-python-v38 lithops-ubuntu-20.04.qcow2 @@ -80,7 +80,7 @@ Lithops will include all the local Docker images together with the Lithops runti In this example the script generates a VM image named `lithops-ubuntu-20.04.qcow2` that contains all dependencies required by Lithops. ### Build the Image without a Docker runtime -Alternative is to build a VM image without a Docker runtime. This approach is mainly focused to run Lithops functions within the VM in the python3 interpreter, without using a docker runtime. If you plant to use a docker runtime to run the functions within the VM, consider to follow the previous approach. The default `build_lithops_vm_image.sh` file contains contains all required dependencies for Lithops. If you need extra linux packages and python libraries, you must edit the `build_lithops_vm_image.sh` file and include all them. +Alternative is to build a VM image without a Docker runtime. This approach is mainly focused to run Lithops functions within the VM in the python3 interpreter, without using a docker runtime. If you plan to use a docker runtime to run the functions within the VM, consider to follow the previous approach. The default `build_lithops_vm_image.sh` file contains contains all required dependencies for Lithops. If you need extra linux packages and python libraries, you must edit the `build_lithops_vm_image.sh` file and include all them. ``` $ ./build_lithops_vm_image.sh lithops-ubuntu-20.04.qcow2 diff --git a/runtime/knative/Dockerfile b/runtime/knative/Dockerfile index dc4d7592d..be600ca42 100644 --- a/runtime/knative/Dockerfile +++ b/runtime/knative/Dockerfile @@ -1,17 +1,13 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -FROM python:3.10-slim-buster +FROM python:3.10-slim-bookworm RUN apt-get update && apt-get install -y \ zip \ diff --git a/runtime/knative/Dockerfile.conda b/runtime/knative/Dockerfile.conda index 17113e876..92797818e 100644 --- a/runtime/knative/Dockerfile.conda +++ b/runtime/knative/Dockerfile.conda @@ -1,9 +1,3 @@ -# Python 3.6 -#FROM continuumio/miniconda3:4.5.4 - -# Python 3.7 -#FROM continuumio/miniconda3:4.7.12 - # Python 3.8 FROM continuumio/miniconda3:4.9.2 @@ -11,8 +5,6 @@ FROM continuumio/miniconda3:4.9.2 #FROM continuumio/miniconda3:4.10.3 # YOU MUST PIN THE PYTHON VERSION TO PREVENT IT TO BE UPDATED -# For python 3.6 use "python==3.6.5" -# For python 3.7 use "python==3.7.4" # For python 3.8 use "python==3.8.5" # For python 3.9 use "python==3.9.5" RUN echo "python==3.8.5" >> /opt/conda/conda-meta/pinned diff --git a/runtime/knative/README.md b/runtime/knative/README.md index 8ca56ef12..5ef6cb074 100644 --- a/runtime/knative/README.md +++ b/runtime/knative/README.md @@ -2,7 +2,7 @@ The runtime is the place where the functions are executed. In Knative, runtimes are based on docker images. -For running lithops on knative, you need a runtime build on the docker hub (or any other container registry), or you need a docker hub account for placing the runtimes created by lithops. +For running lithops on knative, you need a runtime built on Docker Hub (or any other container registry), or you need a Docker Hub account for placing the runtimes created by lithops. If you don't have an already built runtime, the default runtime is built the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. @@ -45,7 +45,7 @@ knative: If you need some Python modules (or other system libraries) which are not included in the default docker images (see table above), it is possible to build your own Lithops runtime with all of them. - This alternative usage is based on to build a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. + This option is based on building a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. Project provides some skeletons of Docker images, for example: * [Dockerfile](Dockerfile) @@ -57,7 +57,7 @@ knative: $ docker login Update the Dockerfile that better fits to your requirements with your required system packages and Python modules. - If you need another Python version, for example Python 3.12, you must change the initial line of the Dockefile: + If you need another Python version, for example Python 3.12, you must change the initial line of the Dockerfile: $ lithops runtime build -b knative docker.io/username/runtimename:tag @@ -77,7 +77,7 @@ knative: fexec = lithops.FunctionExecutor(runtime='docker.io/username/lithops-kn-custom-v312:01') ``` - *NOTE: In this previous example shows how to build a Docker image based on Python 3.12, this means that now you also need Python 3.12 in the client machine.* + *Note: if you build a Docker image based on Python 3.12, your client should also run Python 3.12.* 2. **Use an already built runtime from a public repository** diff --git a/runtime/kubernetes/Dockerfile.conda b/runtime/kubernetes/Dockerfile.conda index 37ddcc14c..98e0d0ca0 100644 --- a/runtime/kubernetes/Dockerfile.conda +++ b/runtime/kubernetes/Dockerfile.conda @@ -1,9 +1,3 @@ -# Python 3.6 -#FROM continuumio/miniconda3:4.5.4 - -# Python 3.7 -#FROM continuumio/miniconda3:4.7.12 - # Python 3.8 FROM continuumio/miniconda3:4.9.2 @@ -11,8 +5,6 @@ FROM continuumio/miniconda3:4.9.2 #FROM continuumio/miniconda3:4.10.3 # YOU MUST PIN THE PYTHON VERSION TO PREVENT IT TO BE UPDATED -# For python 3.6 use "python==3.6.5" -# For python 3.7 use "python==3.7.4" # For python 3.8 use "python==3.8.5" # For python 3.9 use "python==3.9.5" RUN echo "python==3.9.5" >> /opt/conda/conda-meta/pinned diff --git a/runtime/kubernetes/README.md b/runtime/kubernetes/README.md index ebfb373bc..29c17dfd5 100644 --- a/runtime/kubernetes/README.md +++ b/runtime/kubernetes/README.md @@ -2,7 +2,7 @@ The runtime is the place where the functions are executed. In Kubernetes, runtimes are based on docker images. -For running lithops on kubernetes, you need a runtime build on the docker hub (or any other container registry), or you need a docker hub account for placing the runtimes created by lithops. +For running lithops on kubernetes, you need a runtime built on Docker Hub (or any other container registry), or you need a Docker Hub account for placing the runtimes created by lithops. If you don't have an already built runtime, the default runtime is built the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. @@ -21,7 +21,7 @@ k8s: If you need some Python modules (or other system libraries) which are not included in the default docker images (see table above), it is possible to build your own Lithops runtime with all of them. - This alternative usage is based on to build a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. + This option is based on building a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) and use it as a Lithops base runtime. Project provides some skeletons of Docker images, for example: * [Dockerfile](Dockerfile) @@ -33,7 +33,7 @@ k8s: $ docker login Update the Dockerfile that better fits to your requirements with your required system packages and Python modules. - If you need another Python version, for example Python 3.12, you must change the initial line of the Dockefile: + If you need another Python version, for example Python 3.12, you must change the initial line of the Dockerfile: $ lithops runtime build -b k8s docker_username/runtimename:tag @@ -53,7 +53,7 @@ k8s: fexec = lithops.FunctionExecutor(runtime='myaccount/lithops-k8s-custom-v312:01') ``` - *NOTE: In this previous example shows how to build a Docker image based on Python 3.12, this means that now you also need Python 3.12 in the client machine.* + *Note: if you build a Docker image based on Python 3.12, your client should also run Python 3.12.* 2. **Use an already built runtime from a public repository** diff --git a/runtime/openwhisk/Dockerfile b/runtime/openwhisk/Dockerfile index 0ef00df2a..751645f96 100644 --- a/runtime/openwhisk/Dockerfile +++ b/runtime/openwhisk/Dockerfile @@ -1,9 +1,7 @@ -#FROM python:3.6-slim-buster -#FROM python:3.7-slim-buster -#FROM python:3.8-slim-buster -#FROM python:3.9-slim-buster -#FROM python:3.10-slim-buster -FROM python:3.11-slim-buster +#FROM python:3.8-slim-bookworm +#FROM python:3.9-slim-bookworm +#FROM python:3.10-slim-bookworm +FROM python:3.11-slim-bookworm ENV FLASK_PROXY_PORT 8080 diff --git a/runtime/openwhisk/Dockerfile.conda b/runtime/openwhisk/Dockerfile.conda index 2b35c4914..4e52e706e 100644 --- a/runtime/openwhisk/Dockerfile.conda +++ b/runtime/openwhisk/Dockerfile.conda @@ -1,9 +1,3 @@ -# Python 3.6 -#FROM continuumio/miniconda3:4.5.4 - -# Python 3.7 -#FROM continuumio/miniconda3:4.7.12 - # Python 3.8 #FROM continuumio/miniconda3:4.9.2 @@ -17,8 +11,6 @@ FROM continuumio/miniconda3:23.10.0-1 # YOU MUST PIN THE PYTHON VERSION TO PREVENT IT TO BE UPDATED -# For python 3.6 use "python==3.6.5" -# For python 3.7 use "python==3.7.4" # For python 3.8 use "python==3.8.5" # For python 3.9 use "python==3.9.5" # For python 3.10 use "python==3.10.10" diff --git a/runtime/openwhisk/Dockerfile.dlib b/runtime/openwhisk/Dockerfile.dlib deleted file mode 100644 index ee58b404b..000000000 --- a/runtime/openwhisk/Dockerfile.dlib +++ /dev/null @@ -1,10 +0,0 @@ -FROM lithopscloud/ibmcf-python-v36 - -RUN apt-get update && apt-get install -y \ - wget build-essential cmake pkg-config \ - && rm -rf /var/lib/apt/lists/* \ - && apt-cache search linux-headers-generic - -RUN pip install opencv-contrib-python-headless opencv-python-headless dlib \ - && wget https://github.com/cmusatyalab/openface/archive/0.2.1.tar.gz \ - && tar -zxvf 0.2.1.tar.gz && cd openface-0.2.1/ && python setup.py install diff --git a/runtime/openwhisk/Dockerfile.dso b/runtime/openwhisk/Dockerfile.dso deleted file mode 100644 index cf792329e..000000000 --- a/runtime/openwhisk/Dockerfile.dso +++ /dev/null @@ -1,5 +0,0 @@ -FROM openjdk:slim -COPY --from=lithopscloud/ibmcf-python-v36 / / - -RUN pip install --upgrade pip setuptools six \ - && pip install --no-cache-dir dso==0.0.4 diff --git a/runtime/openwhisk/Dockerfile.slim b/runtime/openwhisk/Dockerfile.slim index 407a1cffa..9771dc8a9 100644 --- a/runtime/openwhisk/Dockerfile.slim +++ b/runtime/openwhisk/Dockerfile.slim @@ -1,11 +1,9 @@ # Minimal Docker image for Lithops -#FROM python:3.6-slim-buster -#FROM python:3.7-slim-buster -#FROM python:3.8-slim-buster -#FROM python:3.9-slim-buster -#FROM python:3.10-slim-buster -FROM python:3.11-slim-buster +#FROM python:3.8-slim-bookworm +#FROM python:3.9-slim-bookworm +#FROM python:3.10-slim-bookworm +FROM python:3.11-slim-bookworm #FROM python:3.12-slim-bookworm ENV FLASK_PROXY_PORT 8080 diff --git a/runtime/openwhisk/README.md b/runtime/openwhisk/README.md index 0432f4056..e194d0050 100644 --- a/runtime/openwhisk/README.md +++ b/runtime/openwhisk/README.md @@ -1,6 +1,6 @@ # Lithops runtime for OpenWhisk -The runtime is the place where your functions are executed. In Lithops, runtimes are based on docker images, and it includes by default three different runtimes that allows you to run functions with Python >= 3.6 environments. Lithops main runtime is responsible to execute Python functions within OpenWhisk. The strong requirement here is to match Python versions between the client and the runtime. The runtime may also contain additional packages which your code depends on. +The runtime is the place where your functions are executed. In Lithops, runtimes are based on docker images, and it includes default runtimes that allow you to run functions with Python >= 3.8 environments. Lithops main runtime is responsible to execute Python functions within OpenWhisk. The strong requirement here is to match Python versions between the client and the runtime. The runtime may also contain additional packages which your code depends on. The default runtime is created the first time you execute a function. Lithops automatically detects the Python version of your environment and deploys the default runtime based on it. @@ -39,7 +39,7 @@ fexec = lithops.FunctionExecutor(runtime_memory=512) This alternative usage is based on to build a local Docker image, deploy it to the docker hub (you need a [Docker Hub account](https://hub.docker.com)) (or another registry) and use it as a Lithops base runtime. - In this folder you will finde some Dockerfile skeletons that you can use to build your runtimes. To build your own runtime, first install the Docker CE version in your client machine. You can find the instructions [here](https://docs.docker.com/get-docker/). If you already have Docker installed omit this step. + In this folder you will find some Dockerfile skeletons that you can use to build your runtimes. To build your own runtime, first install the Docker CE version in your client machine. You can find the instructions [here](https://docs.docker.com/get-docker/). If you already have Docker installed omit this step. Login to your Docker hub account by running in a terminal the next command. @@ -60,14 +60,14 @@ fexec = lithops.FunctionExecutor(runtime_memory=512) $ lithops runtime build -b openwhisk -f openwhisk/Dockerfile.conda username/lithops-conda-runtime-v312:0.1 Once you have built your runtime with all of your necessary packages, you can already use it with Lithops. - To do so, you have to specify the full docker image name in the configuration or when you create the **ibm_cf_executor** instance, for example: + To do so, specify the full Docker image name in the configuration or when you create a `FunctionExecutor`, for example: ```python import lithops fexec = lithops.FunctionExecutor(runtime='jsampe/lithops-custom-runtime-v312:0.1') ``` - *NOTE: In this previous example we built a Docker image based on Python v312, this means that now we also need Python v312 in the client machine.* + *Note: In this example, the image uses Python 3.12, so your client environment should also use Python 3.12.* 2. **Use an already built runtime from a public repository** diff --git a/runtime/oracle_f/Dockerfile b/runtime/oracle_f/Dockerfile index af667fec3..430874eb7 100644 --- a/runtime/oracle_f/Dockerfile +++ b/runtime/oracle_f/Dockerfile @@ -1,14 +1,10 @@ -# Python 3.6 -#FROM python:3.6-slim-buster -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -FROM python:3.9-slim-buster +FROM python:3.9-slim-bookworm RUN apt-get update \ && apt-get install -y \ diff --git a/runtime/singularity/README.md b/runtime/singularity/README.md index 57c8a4dc7..6155ac9fd 100644 --- a/runtime/singularity/README.md +++ b/runtime/singularity/README.md @@ -1,7 +1,7 @@ # Lithops runtime for Singularity This document describes how to use Singularity containers as runtimes for your Lithops functions. -The runtime provides a pre-configured environment to execute your Lithops functions within Singularity containers. It includes the necessary and dependencies to execute your lithops code. +The runtime provides a pre-configured environment to execute your Lithops functions within Singularity containers. It includes the necessary dependencies to execute your lithops code. **Note:** This backend requires a RabbitMQ server for communication. @@ -13,7 +13,7 @@ Use the `lithops runtime build` command to create a `.sif` image containing the $ lithops runtime build -b singularity singularity-runtime-name --fakeroot --force - This command creates the a new `singularity-runtime-name.sif` file with the necessary libraries. + This command creates a new `singularity-runtime-name.sif` file with the necessary libraries. 2. **Building a custom runtime from a definition file** @@ -59,7 +59,7 @@ singularity: runtime: singularity-runtime-name ``` -Also, to execute the Singularity backend, you need to set the RabbitMQ AMPQ URL in your configuration file: +Also, to execute the Singularity backend, you need to set the RabbitMQ AMQP URL in your configuration file: ```yaml rabbitmq: diff --git a/runtime/singularity/singularity-template.def b/runtime/singularity/singularity-template.def index 424995cf3..e16a22642 100644 --- a/runtime/singularity/singularity-template.def +++ b/runtime/singularity/singularity-template.def @@ -1,19 +1,17 @@ Bootstrap: docker -# Python 3.7 -#FROM python:3.7-slim-buster # Python 3.8 -#FROM python:3.8-slim-buster +#FROM python:3.8-slim-bookworm # Python 3.9 -#FROM python:3.9-slim-buster +#FROM python:3.9-slim-bookworm # Python 3.10 -#FROM: python:3.10-slim-buster +#FROM: python:3.10-slim-bookworm # Python 3.11 -FROM: python:3.11-slim-buster +FROM: python:3.11-slim-bookworm %post apt-get update && apt-get install -y \ @@ -43,4 +41,4 @@ FROM: python:3.11-slim-buster unzip lithops_singularity.zip && rm lithops_singularity.zip %runscript - python3 /lithops/lithopsentry.py $AMQP_URL \ No newline at end of file + python3 /lithops/lithopsentry.py $AMQP_URL