fairing
fairing copied to clipboard
docker created from fairing uses python2 even base docker image has python 3 as default
/kind bug
What steps did you take and what happened: I am using Trainjob API to deploy and run it remotely on GKE cluster. Following is the flow:
- After running Trainjob API it is first creating docker (working correctly)
- Then copying all the necessary dependencies and packaging it with docker (I am still not sure about this step) 3.Then pushing docker to specified registry (working correctly)
- Then using the same docker to run it on GKE cluster (from here the problem starts) In step no 4 folling is the problem
Traceback (most recent call last):
File "/app/function_shim.py", line 4, in <module>
from enum import Enum
ImportError: No module named enum
```
I looked up the problem & following is conclusion:
1. enum package generally gives problem in python2
2. So I made sure my base docker image will use python3 as default. So should the docker generated step 2, but I think this is not the case.
**What did you expect to happen:**
Function inside the docker should work just like the function working locally.
**Anything else you would like to add:**
Docker generated in step 2 i.e. by Faring should use python3 by default
I think so make change in Docker command python to python3. (below log may help)
`Docker command: ['python', '/app/function_shim.py', '--serialized_fn_file', '/app/pickled_fn.p']`
**Environment:**
- Fairing version: 0.5.3
- Kubeflow version: 0.5
Issue-Label Bot is automatically applying the label kind/bug
to this issue, with a confidence of 0.96. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
@Akashdesarda Pls see my suggestion in the https://github.com/kubeflow/fairing/pull/333 thanks.
Ok so it is because the environment in which fairing code is running, python is pointing to python2. Yes, @jinchihe suggestion to make python point to python3 will solve this issue.
/priority p2 /area engprod