marcoabreu commented on a change in pull request #19654:
URL: https://github.com/apache/incubator-mxnet/pull/19654#discussion_r541216287
##########
File path: ci/build.py
##########
@@ -58,7 +60,11 @@ def get_docker_tag(platform: str, registry: str) -> str:
platform = platform if any(x in platform for x in ['build.', 'publish.'])
else 'build.{}'.format(platform)
if not registry:
registry = "mxnet_local"
- return "{0}/{1}".format(registry, platform)
+ dockerfile_hash = 'unk'
+ with open(get_dockerfile(platform),"rb") as f:
+ bytes = f.read()
+ dockerfile_hash = hashlib.sha256(bytes).hexdigest()[:12]
Review comment:
Also, be aware that this method will result in a 100% cache miss once
anything under that hash changed since there will simply be no image with that
particular hash. Thus I'd recommend to write a fallback method which first
tries to pull the hashed cache and in case it does not exist, pull the branch
cache - which obviously requires images pushed by the branch jobs to be
appropriately tagged as such.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]