<#1259 [WIP] Install python packages at runtime> P...
# flyte-github
c
#1259 [WIP] Install python packages at runtime Pull request opened by pingsutw TL;DR Install python package before running the task. It has some benefits, 1. Make development or iteration easier and faster because If we just want to update the Python package in the Docker image, we do not need to rebuild the Dockerfile. 2. Install python package only in a specific tasks (pods). 3. Install two different version of tensorflow respectively in the tasks for testing. t1 can install
TF1
and t2 can install
TF2
4. It can make size of base image smaller and reduce the times of pulling docker image. Due to the fact that we don't rebuild the image, nodes don't need to pull the new image. Example from flytekit import task, workflow, RuntimeEnv @task(runtime_env=RuntimeEnv(pip_packages=["tensorflow", "pandas==1.5.1"])) def t1(a: int) -> int: import tensorflow as tf print(tf.version) return a def t2(a: int) -> int: return a @workflow def my_wf(): t1(a=2) t2(a=3) if name == "__main__": my_wf() Type • Bug Fix • Feature • Plugin Are all requirements met? • Code completed • Smoke tested • Unit tests added • Code documentation added • Any pending items have an associated Issue Complete description ^^^ Tracking Issue flyteorg/flyte#2573 Follow-up issue • apt install or yum install • Add support Conda flyteorg/flytekit