-
In one of my functions, I have set spec.runtime to python:3.8 in the config file. However, the base image that I provided for this function contains Python version 3.10.x. To test which Python interpreter is being used, I created a simple function that returns the Python version when invoked. Surprisingly, the function responds with 3.10.x, which is the Python interpreter inside the base image. My question is: How is the runtime exactly determined? My hypothesis is that when spec.runtime is set to python:x.x, the version specified (x.x) may not matter. Instead, the function might use the Python interpreter invoked by the python command. Could someone clarify this behavior for me? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @csong16 I ran a test just like you described, with the
And I receive the following response:
Please let me know if this still happens, and perhaps provide more details to reproduce. |
Beta Was this translation helpful? Give feedback.
-
@csong16 When setting a custom base image, the runtime version is determined by the runtime that's pre-installed in the given image. I agree that this is a bit confusing, and we will add a log that communicates this information when deployed a function with a custom image. Bottom line - if you want to use a custom base image and a specific runtime version, make sure your given image has this version already installed. |
Beta Was this translation helpful? Give feedback.
@csong16
I have managed to reproduce with a different bas image.
When setting a custom base image, the runtime version is determined by the runtime that's pre-installed in the given image.
Meaning - when a custom image is given, the value in
spec.runtime
is essentially ignored.This is done because we can't (and won't) install the required runtime version on the given base image.
I agree that this is a bit confusing, and we will add a log that communicates this information when deployed a function with a custom image.
Bottom line - if you want to use a custom base image and a specific runtime version, make sure your given image has this version already installed.