big-notebook-82371
05/22/2024, 2:51 PMancient-wolf-19325
05/22/2024, 2:51 PMImageSpec
with rebuild_always=True
, Flyte will rebuild the image every time regardless of changes. Additionally, if the task versioning does not consider changes in the container image, it might trigger unnecessary rebuilds.
Would you like more details on how to manage image caching and versioning in Flyte?
Sources:
- Flyte Community Discussion
- Flyte Community Discussion
- Flyte Package and Register Documentation π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.glamorous-carpet-83516
05/22/2024, 2:52 PMbig-notebook-82371
05/22/2024, 2:53 PMpyflyte register /path/to/pipeline.py
with project and domainglamorous-carpet-83516
05/22/2024, 2:54 PMbig-notebook-82371
05/22/2024, 2:55 PMglamorous-carpet-83516
05/22/2024, 2:55 PMglamorous-carpet-83516
05/22/2024, 2:55 PMbig-notebook-82371
05/22/2024, 2:57 PMDEFAULTS = [
DOTENV,
GCS,
BIGQUERY,
SECRETS,
DB_DTYPES,
PENDULUM,
PSUTIL,
TQDM,
YAML,
TYPEGUARD,
ML_ULTRA_CLIENT,
OPENCV_HEADLESS,
POLARS,
]
default_image_spec = ImageSpec(
name="default",
base_image="<http://ghcr.io/flyteorg/flytekit:py3.10-1.10.2|ghcr.io/flyteorg/flytekit:py3.10-1.10.2>",
packages=[*DEFAULTS],
apt_packages=["git"],
registry=DAI_ML_PIPELINES_REGISTRY,
)
glamorous-carpet-83516
05/22/2024, 2:59 PMglamorous-carpet-83516
05/22/2024, 3:02 PM(flytekit-3.10) β flytekit git:(master) β pyflyte run --remote flyte-example/improve_image_spec.py wf
Running Execution on Remote.
[2024-05-22T23:01:23.821+0800] {authenticator.py:249} INFO - Retrieved new token, expires in 86400
Image pingsutw/flytekit:DPW01P0tkuBYhsCIdr9fBA found. Skip building.
big-notebook-82371
05/22/2024, 3:03 PMbig-notebook-82371
05/22/2024, 3:07 PMglamorous-carpet-83516
05/22/2024, 3:09 PMglamorous-carpet-83516
05/22/2024, 3:09 PMbig-notebook-82371
05/22/2024, 3:14 PMglamorous-carpet-83516
05/22/2024, 3:14 PMbig-notebook-82371
05/22/2024, 3:15 PM1.10.2
big-notebook-82371
05/22/2024, 3:15 PMglamorous-carpet-83516
05/22/2024, 3:16 PMglamorous-carpet-83516
05/22/2024, 3:16 PMbig-notebook-82371
05/22/2024, 3:17 PMbig-notebook-82371
05/22/2024, 3:27 PMglamorous-carpet-83516
05/22/2024, 3:28 PM*DEFAULTS
?
packages=[*DEFAULTS]
instead of
packages=DEFAULTS
big-notebook-82371
05/22/2024, 3:29 PMbig-notebook-82371
05/22/2024, 4:46 PMCould not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
glamorous-carpet-83516
05/22/2024, 4:57 PMflaky-parrot-42438
05/22/2024, 5:13 PMglamorous-carpet-83516
05/22/2024, 5:13 PMbig-notebook-82371
05/22/2024, 5:13 PMglamorous-carpet-83516
05/22/2024, 5:15 PMdocker stop flyte-sandbox
to remove the envd buildkit daemonglamorous-carpet-83516
05/22/2024, 5:16 PMflaky-parrot-42438
05/22/2024, 5:19 PMdocker builder prune
to remove the build cache?big-notebook-82371
05/22/2024, 5:20 PMbig-notebook-82371
05/22/2024, 5:38 PMflaky-parrot-42438
05/22/2024, 5:53 PMpip install imagespec-fast-builder==0.0.17
big-notebook-82371
05/22/2024, 6:00 PM0.327 Reading package lists...
0.919 E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
0.919 E: Unable to lock directory /var/lib/apt/lists/
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y --no-install-recommends ca-certificates" did not complete successfully: exit code: 100
glamorous-carpet-83516
05/22/2024, 6:02 PMflaky-parrot-42438
05/22/2024, 6:13 PMbig-notebook-82371
05/22/2024, 6:14 PMbig-notebook-82371
05/22/2024, 6:18 PMflaky-parrot-42438
05/22/2024, 7:02 PMflytekit
into DEFAULT
? (It'll use debian:bookworm-slim
, which ends up to be a smaller image during runtime)
default_image_spec = ImageSpec(
name="default",
packages=DEFAULTS,
apt_packages=["git"],
registry=DAI_ML_PIPELINES_REGISTRY,
)
I also released one more fix: pip install imagespec-fast-builder==0.0.19
.big-notebook-82371
05/22/2024, 8:15 PMbig-notebook-82371
05/22/2024, 8:32 PMflaky-parrot-42438
05/22/2024, 8:58 PMDEFAULTS
? I'm doing some bigger improvements to my image builder and I want to make sure it works for you.big-notebook-82371
05/22/2024, 9:02 PM['python-dotenv==1.0.1', 'google-cloud-storage==2.15.0', 'google-cloud-bigquery==3.13.0', 'google-cloud-secret-manager==2.17.0', 'db-dtypes==1.1.1', 'pendulum==2.1.2', 'psutil==5.9.5', 'tqdm==4.65.0', 'pyyaml==5.3.1', 'typeguard==4.1.5', 'opencv-python-headless==4.7.0.72', 'polars==0.18.13']
I'm also still building some things. I got that failure again, but it was a different image, so I'm making sure I have them all setup right for the fast builder