-
Notifications
You must be signed in to change notification settings - Fork 394
Build cache not hit #694
Comments
Thanks for catching and reporting this. Attempting to reproduce it now. |
OK. I'm able to reproduce. I think the issue is the change to line #683 in core.py, where I include the service level defaults in the fingerprint. When I remove that change, and run the build for the first time, it runs role_a and role_b to build the service_a. As it moves to service_b, it recognizes that it already has a layer that can be used, and skips role_a. |
@chouseknecht |
I think we're OK there, because variables that are part of the role declaration at the service level are included in the fingerprint in get_role_fingerprint |
Ok, got it. Thank you. |
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
When using the same role in two services, the cached role should be used by both services. This doesn't work if the services are using additional roles with different default variables.
I think this is a side effect of #678 because it worked as expected before this change:
In
container/core.py
in line 665 the service default variables are now used to generate the hash forcaching:
The default variables of a service contain the default variables from all roles of a service.
see
container/config.py
line 332:So when there are different variables in two services coming form additional roles, than no cache of any role will be used in this service anymore.
STEPS TO REPRODUCE
Define two services which are sharing the same role
role_a
.Add at least a second role
role_b
with different variables in both services.EXPECTED RESULTS
The first role
role_a
should be cached and used for both services.The second role
role_b
shouldn't be cached because the variables are different.ACTUAL RESULTS
The cache for
role_a
isn't used.The text was updated successfully, but these errors were encountered: