Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base image resource does not get deployed due to missing image #6486

Open
samuliy opened this issue Jan 14, 2025 · 2 comments
Open

Base image resource does not get deployed due to missing image #6486

samuliy opened this issue Jan 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@samuliy
Copy link

samuliy commented Jan 14, 2025

Expected Behavior

Running two resources, first one using a Dockerfile extending from the second, second using Dockerfile that is the base for the first one. Both resources, the one using the base image and the one extending the base image should deploy without an error.

Current Behavior

  1. First resource builds the base image
STEP 1/5 — Building Dockerfile: [x/tilt-deployment-base]
Building Dockerfile for platform linux/amd64:
...
  1. First resource skips pushing the base image to repository:
STEP 2/5 — Pushing x/tilt-deployment-base:tilt-c284e86bc661040f
     Skipping push: base image does not need deploy
  1. The resource using the base image fails due to missing image (masked the registry and namespace from the log output):
Tracking new pod rollout (tilt-deployment-base-6dc4c5d649-pjncq):
     ┊ Scheduled       - <1s
     ┊ Initialized     - <1s
     ┃ Not Ready       - (ContainersNotReady): containers with unready status: [tilt-deployment-base]
[event: pod x/tilt-deployment-base-6dc4c5d649-pjncq] Pulling image "xxx/tilt-deployment-base:tilt-c284e86bc661040f"
[event: pod x/tilt-deployment-base-6dc4c5d649-pjncq] Failed to pull image "xxx/tilt-deployment-base:tilt-c284e86bc661040f": rpc error: code = NotFound desc = failed to pull and unpack image "xxx/tilt-deployment-base:tilt-c284e86bc661040f": failed to resolve reference "xxx/tilt-deployment-base:tilt-c284e86bc661040f": xxx/tilt-deployment-base:tilt-c284e86bc661040f: not found

Steps to Reproduce

This issue can be somewhat hard to reproduce, as it feels like it's related to some race-condition.
I can consistently reproduce it with the following steps, by adding a local_resource with a sleep command and setting the resource_deps in a way that the base-image resource builds later.

  1. Files to reproduce the issue with: test.tar.gz

  2. Run tilt up

Context

tilt doctor Output

$ tilt doctor
Tilt: v0.33.22, built 2025-01-03
System: linux-amd64
---
Docker
- Host: unix:///var/run/docker.sock
- Server Version: 27.4.1
- API Version: 1.47
- Builder: 2
- Compose Version: v2.28.1
---
Kubernetes
- Env: kind
- Context: kind-kind
- Cluster Name: kind-kind
- Namespace: default
- Container Runtime: containerd
- Version: v1.32.0
- Cluster Local Registry: &RegistryHosting{Host:localhost:5001,HostFromClusterNetwork:,HostFromContainerRuntime:,Help:https://kind.sigs.k8s.io/docs/user/local-registry/,SingleName:,}
---
Thanks for seeing the Tilt Doctor!
Please send the info above when filing bug reports. 💗

The info below helps us understand how you're using Tilt so we can improve,
but is not required to ask for help.
---
Analytics Settings
--> (These results reflect your personal opt in/out status and may be overridden by an `analytics_settings` call in your Tiltfile)
- User Mode: opt-out
- Machine: 8a6cac578b8f7d68ec08cb2f39a8a246
- Repo: IdDstfTxPu7tcDfMm9XZvA==

About Your Use Case

Use case is the ability to run the base image and see it live, while also being able to extend from it and have the changes into base image propagate into child-resources that use it.

During Tilt startup, this can be mitigated by defining resource_deps in a way that the images build in correct order, but when making changes to the images and updating the resources live, it's possible the build order is incorrect.

@samuliy samuliy added the bug Something isn't working label Jan 14, 2025
@nicks
Copy link
Member

nicks commented Jan 16, 2025

thanks for the report! as a temporary workaround, i think if you set up the resource_deps so that the manifest with the base image gets deployed first, i think it will work ok.

@samuliy
Copy link
Author

samuliy commented Jan 16, 2025

Thanks for the reply! Setting resource_deps does indeed help when running tilt up, but doesn't help when the resources are already up, and we make changes to files that cause image rebuilds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants