summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorJosh Smith <qinusty@gmail.com>2018-09-19 10:14:00 +0100
committerJosh Smith <qinusty@gmail.com>2018-09-20 09:30:23 +0100
commitbb66744d654ae02087b0866061d25da317c592d5 (patch)
tree4a3375039387c38a11c677bc804860683ff5fac8 /buildstream
parent0a314bb84a7615113f73786aa1f83eb294fb0be6 (diff)
downloadbuildstream-bb66744d654ae02087b0866061d25da317c592d5.tar.gz
cascache.py: Move push/pull messaging to cascache
Pulled/Pushed messages will no longer be produced from within element.py, instead they will be produced during CasCache push() and pull() appropriately. Message consistency has also been improved.
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/_artifactcache/cascache.py12
-rw-r--r--buildstream/element.py4
2 files changed, 8 insertions, 8 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 7d090e228..97bdedf56 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -225,8 +225,8 @@ class CASCache(ArtifactCache):
for remote in self._remotes[project]:
try:
remote.init()
-
- element.info("Pulling {} <- {}".format(element._get_brief_display_key(), remote.spec.url))
+ display_key = element._get_brief_display_key()
+ element.status("Pulling artifact {} <- {}".format(display_key, remote.spec.url))
request = buildstream_pb2.GetReferenceRequest()
request.key = ref
@@ -240,6 +240,7 @@ class CASCache(ArtifactCache):
self.set_ref(ref, tree)
+ element.info("Pulled artifact {} <- {}".format(display_key, remote.spec.url))
# no need to pull from additional remotes
return True
@@ -273,11 +274,11 @@ class CASCache(ArtifactCache):
push_remotes = [r for r in self._remotes[project] if r.spec.push]
pushed = False
-
+ display_key = element._get_brief_display_key()
for remote in push_remotes:
remote.init()
skipped_remote = True
- element.info("Pushing {} -> {}".format(element._get_brief_display_key(), remote.spec.url))
+ element.status("Pushing artifact {} -> {}".format(display_key, remote.spec.url))
try:
for ref in refs:
@@ -354,6 +355,9 @@ class CASCache(ArtifactCache):
pushed = True
+ if not skipped_remote:
+ element.info("Pushed artifact {} -> {}".format(display_key, remote.spec.url))
+
except grpc.RpcError as e:
if e.code() != grpc.StatusCode.RESOURCE_EXHAUSTED:
raise ArtifactError("Failed to push artifact {}: {}".format(refs, e), temporary=True) from e
diff --git a/buildstream/element.py b/buildstream/element.py
index 1fefd6562..260762cf1 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1672,8 +1672,6 @@ class Element(Plugin):
return False
# Notify successfull download
- display_key = self._get_brief_display_key()
- self.info("Downloaded artifact {}".format(display_key))
return True
# _skip_push():
@@ -1718,8 +1716,6 @@ class Element(Plugin):
return False
# Notify successful upload
- display_key = self._get_brief_display_key()
- self.info("Pushed artifact {}".format(display_key))
return True
# _shell():