You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by GitBox <gi...@apache.org> on 2021/02/04 07:40:10 UTC
[GitHub] [buildstream] BuildStream-Migration-Bot opened a new pull request #1431: Draft: Add remote cache support
BuildStream-Migration-Bot opened a new pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431
[See original merge request on GitLab](https://gitlab.com/BuildStream/buildstream/-/merge_requests/2095)
In GitLab by [[Gitlab user @juergbi]](https://gitlab.com/juergbi) on Oct 29, 2020, 17:07
This replaces the `pull-artifact-files` config option with a `remote-cache` config option to properly support remote execution without downloading blobs that are not needed locally.
With `pull-artifact-files` disabled, artifact file blobs are completely ignored in cache checks. While this allows remote execution builds without downloading build outputs, it can result in build failures when blobs expire on the server side. It also does not download missing blobs on demand. I.e. `bst artifact checkout` and other commands don't work with `pull-artifact-files` disabled.
This branch replaces the `pull-artifact-files` support with a new `remote-cache` config option. When that's configured, all blobs in that remote CAS server are considered cached and only downloaded to the local system when needed (e.g. `bst artifact checkout`). This works for build outputs with remote execution as well as sources in remote asset servers. Unlike `pull-artifact-files` this still checks whether the artifact file blobs are available (using `FindMissingBlobs` without actually downloading them).
- [ ] Add/update documentation for `remote-cache` configuration
- [ ] Improve test infrastructure to allow proper testing of remote cache (RE CAS server isolated per test case)
This depends on !2090.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on pull request #1431: Draft: Add remote cache support
Posted by GitBox <gi...@apache.org>.
juergbi commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-790624509
I've rebased this on top of PR #1450 and changed the cache query strategy. This branch now schedules cache queries as jobs for parallelization only if a remote cache is configured. If only a local cache is used and thus, the job overhead may not be worth it, cache query remains serialized in the main thread. Both cases are handled by `Stream.query_cache()`. This change is in a separate commit and it could be deferred to a follow-up (i.e. until we reduce the overhead to a point where we can enable it unconditionally).
Remote cache tests still need to be added to the test suite / CI.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
gtristan commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-870283890
Overall looks good, let's approve :)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] BuildStream-Migration-Bot commented on pull request #1431: Draft: Add remote cache support
Posted by GitBox <gi...@apache.org>.
BuildStream-Migration-Bot commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-773101547
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-870272939
> Do we get an appropriate error with the provenance to the remote execution configuration block specifying that the `storage-service` was left unspecified, explaining that it is required to specify the storage service if a `storage-service` has not been specified globally ?
There was already an error message with correct provenance, however, the message was generic:
> Dictionary did not contain expected key 'storage-service'
I've replaced this with a clearer error message:
> Remote execution requires 'storage-service' to be specified in the 'remote-execution' section if not already specified globally in the 'cache' section
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] BenjaminSchubert commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
BenjaminSchubert commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r651149380
##########
File path: doc/source/using_config.rst
##########
@@ -96,7 +96,7 @@ Attributes
.. _config_local_cache:
-Local cache control
+Cache control
-------------------
Review comment:
nit: you should remove the extra `-` here
--
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:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
gtristan commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r660323280
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
> I've added a warning when pulling/fetching with a configured cache storage-service. I've also expanded the documentation as per your input. Is this clear enough now?
The documentation is much improved thanks for that :)
> The reason for this is that CAS doesn't support transfers between two servers without going through the local client.
I guess I was overly optimistic to think this might not be the case, in which case I agree we don't need to change logging.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r659858295
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
Thanks for your comments.
I've added a warning when pulling/fetching with a configured cache `storage-service`. I've also expanded the documentation as per your input. Is this clear enough now?
> Beyond this, logging about pulling and pushing artifacts should be enhanced.
`bst artifact pull` will not pull anything if the specified artifact is already in the local cache or the cache storage-service. However, if the artifact is not cached yet, it will actually pull the blobs from the artifact server to the local cache. The reason for this is that CAS doesn't support transfers between two servers without going through the local client. Even though this is more of a side-effect of the protocol limitation, this means that one side of pulling/pushing is always localhost and thus, I'm not sure whether we even should adjust the log messages.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] juergbi merged pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi merged pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
gtristan commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r660323280
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
> I've added a warning when pulling/fetching with a configured cache storage-service. I've also expanded the documentation as per your input. Is this clear enough now?
The documentation is much improved thanks for that :)
> The reason for this is that CAS doesn't support transfers between two servers without going through the local client.
I guess I was overly optimistic to think this might not be the case, in which case I agree we don't need to change logging.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r655395343
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
The contents of the `storage-service` are considered part of the cache, so blobs are not guaranteed to exist locally with the current branch after `bst artifact pull` (or `bst source fetch`).
It could make sense in some cases. E.g. when the `storage-service` in the cache configuration is on a local network and you're pulling from an artifact server outside the local network. Or if you want to separately call `bst source fetch` before `bst build` with remote execution, you may not need the sources locally, you just want them in the cache `storage-service`, ready to be used for the remote execution build.
However, I can definitely see that this behavior could be confusing, especially if the cache `storage-service` is not on the local network. Technically it is consistent with other commands, though.
I'm not sure whether it would be ideal to simply ensure all blobs are in the local cache after `bst artifact pull` (and `bst source fetch`) as the behavior would be somewhat inconsistent. And with a low local cache quota it might even fail.
A possible alternative would be to print a warning/info message when running `bst artifact pull` with a cache `storage-service` configured and add a global CLI option to disable the cache `storage-service` without having to edit `buildstream.conf`.
I don't know whether it will be common for people to frequently switch between configurations with a cache `storage-service` and offline operations. My guess is that people who use remote execution will not frequently work offline (with the same project).
Any thoughts which solution makes most sense?
--
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r655502439
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
Review comment:
It is compatible with the *storage* service offered by cache servers, no index functionality is needed. I've added a sentence to clarify this.
I've also added a `.. tip::` block as suggested.
Does the documentation look ok now?
--
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r659858295
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
Thanks for your comments.
I've added a warning when pulling/fetching with a configured cache `storage-service`. I've also expanded the documentation as per your input. Is this clear enough now?
> Beyond this, logging about pulling and pushing artifacts should be enhanced.
`bst artifact pull` will not pull anything if the specified artifact is already in the local cache or the cache storage-service. However, if the artifact is not cached yet, it will actually pull the blobs from the artifact server to the local cache. The reason for this is that CAS doesn't support transfers between two servers without going through the local client. Even though this is more of a side-effect of the protocol limitation, this means that one side of pulling/pushing is always localhost and thus, I'm not sure whether we even should adjust the log messages.
##########
File path: src/buildstream/_frontend/widget.py
##########
@@ -483,24 +488,23 @@ def print_heading(self, toplevel_project, stream, *, log_file):
values["Maximum Build Tasks"] = context.sched_builders
values["Maximum Push Tasks"] = context.sched_pushers
values["Maximum Network Retries"] = context.sched_network_retries
+
+ if context.remote_cache_spec:
+ values["Cache Storage Service"] = format_spec(context.remote_cache_spec)
+
text += self._format_values(values)
if context.remote_execution_specs:
specs = context.remote_execution_specs
- def format_spec(spec):
- if spec.instance_name:
- return "{} (instance: {})".format(spec.url, spec.instance_name)
- return spec.url
-
text += "\n"
text += self.content_profile.fmt("Remote Execution Configuration\n", bold=True)
values = OrderedDict()
values["Execution Service"] = format_spec(specs.exec_spec)
- values["Storage Service"] = format_spec(specs.storage_spec)
+ if specs.storage_spec:
Review comment:
Done
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] BuildStream-Migration-Bot commented on pull request #1431: Draft: Add remote cache support
Posted by GitBox <gi...@apache.org>.
BuildStream-Migration-Bot commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-773101547
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi merged pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi merged pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r655488525
##########
File path: doc/source/using_config.rst
##########
@@ -96,7 +96,7 @@ Attributes
.. _config_local_cache:
-Local cache control
+Cache control
-------------------
Review comment:
Nit fixed. Thanks for the review.
--
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-870272939
> Do we get an appropriate error with the provenance to the remote execution configuration block specifying that the `storage-service` was left unspecified, explaining that it is required to specify the storage service if a `storage-service` has not been specified globally ?
There was already an error message with correct provenance, however, the message was generic:
> Dictionary did not contain expected key 'storage-service'
I've replaced this with a clearer error message:
> Remote execution requires 'storage-service' to be specified in the 'remote-execution' section if not already specified globally in the 'cache' section
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
gtristan commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-865681456
Are we testing erroneous configuration conditions ?
Do we get an appropriate error with the provenance to the remote execution configuration block specifying that the `storage-service` was left unspecified, explaining that it is required to specify the storage service if a `storage-service` has not been specified globally ?
--
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:
users@infra.apache.org
[GitHub] [buildstream] BuildStream-Migration-Bot commented on pull request #1431: Draft: Add remote cache support
Posted by GitBox <gi...@apache.org>.
BuildStream-Migration-Bot commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-773101729
In GitLab by [[Gitlab user @juergbi]](https://gitlab.com/juergbi) on Dec 7, 2020, 05:58
mentioned in merge request !2112
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r655395343
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
The contents of the `storage-service` are considered part of the cache, so blobs are not guaranteed to exist locally with the current branch after `bst artifact pull` (or `bst source fetch`).
It could make sense in some cases. E.g. when the `storage-service` in the cache configuration is on a local network and you're pulling from an artifact server outside the local network. Or if you want to separately call `bst source fetch` before `bst build` with remote execution, you may not need the sources locally, you just want them in the cache `storage-service`, ready to be used for the remote execution build.
However, I can definitely see that this behavior could be confusing, especially if the cache `storage-service` is not on the local network. Technically it is consistent with other commands, though.
I'm not sure whether it would be ideal to simply ensure all blobs are in the local cache after `bst artifact pull` (and `bst source fetch`) as the behavior would be somewhat inconsistent. And with a low local cache quota it might even fail.
A possible alternative would be to print a warning/info message when running `bst artifact pull` with a cache `storage-service` configured and add a global CLI option to disable the cache `storage-service` without having to edit `buildstream.conf`.
I don't know whether it will be common for people to frequently switch between configurations with a cache `storage-service` and offline operations. My guess is that people who use remote execution will not frequently work offline (with the same project).
Any thoughts which solution makes most sense?
##########
File path: doc/source/using_config.rst
##########
@@ -96,7 +96,7 @@ Attributes
.. _config_local_cache:
-Local cache control
+Cache control
-------------------
Review comment:
Nit fixed. Thanks for the review.
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
Review comment:
It is compatible with the *storage* service offered by cache servers, no index functionality is needed. I've added a sentence to clarify this.
I've also added a `.. tip::` block as suggested.
Does the documentation look ok now?
--
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:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
gtristan commented on pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#issuecomment-870283890
Overall looks good, let's approve :)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] juergbi commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
juergbi commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r659858559
##########
File path: src/buildstream/_frontend/widget.py
##########
@@ -483,24 +488,23 @@ def print_heading(self, toplevel_project, stream, *, log_file):
values["Maximum Build Tasks"] = context.sched_builders
values["Maximum Push Tasks"] = context.sched_pushers
values["Maximum Network Retries"] = context.sched_network_retries
+
+ if context.remote_cache_spec:
+ values["Cache Storage Service"] = format_spec(context.remote_cache_spec)
+
text += self._format_values(values)
if context.remote_execution_specs:
specs = context.remote_execution_specs
- def format_spec(spec):
- if spec.instance_name:
- return "{} (instance: {})".format(spec.url, spec.instance_name)
- return spec.url
-
text += "\n"
text += self.content_profile.fmt("Remote Execution Configuration\n", bold=True)
values = OrderedDict()
values["Execution Service"] = format_spec(specs.exec_spec)
- values["Storage Service"] = format_spec(specs.storage_spec)
+ if specs.storage_spec:
Review comment:
Done
--
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.
To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on a change in pull request #1431: Support `storage-service` in cache configuration
Posted by GitBox <gi...@apache.org>.
gtristan commented on a change in pull request #1431:
URL: https://github.com/apache/buildstream/pull/1431#discussion_r655956550
##########
File path: doc/source/using_config.rst
##########
@@ -178,6 +189,19 @@ Attributes
* ``auto``: Only cache the build trees where necessary (e.g. for failed builds)
* ``always``: Always cache the build tree.
+* ``storage-service``
+
+ An optional :ref:`service configuration <user_config_remote_execution_service>`
+ to use a *Content Addressable Storage* service as a remote cache. Write access
+ is required.
+
+ This allows operation with a small local cache even with large projects.
+ This is especially useful in combination with
+ :ref:`remote execution <user_config_remote_execution>` to minimize downloads
+ of build outputs, which may not be needed locally.
+
+ CAS objects will be downloaded on demand, e.g. on ``bst artifact checkout``.
Review comment:
> I'm not sure whether it would be ideal to simply ensure all blobs are in the local cache after `bst artifact pull` (and `bst source fetch`) as the behavior would be somewhat inconsistent. And with a low local cache quota it might even fail.
My thoughts were that this would only happen if pulling artifacts or sources was *explicitly* requested, i.e. the user explicitly typed `bst artifact pull` or `bst source fetch`, but not in the case that these activities were a side effect of building, where the user has not explicitly asked for sources or artifacts.
The premise of course being that if a user types either of those commands, it is *because* they want the data be available for offline use, and I can't imagine any other reason at the moment why a user would type `bst artifact pull` or `bst source pull`
> A possible alternative would be to print a warning/info message when running `bst artifact pull` with a cache `storage-service` configured and add a global CLI option to disable the cache `storage-service` without having to edit `buildstream.conf`.
I'd be happy with a warning without necessarily adding a CLI option, (if we were to add a CLI option it might be desirable to support a value like we do for `RemoteSpec` with an ability to specify the value as `local`)... I'm more concerned with messaging and clarity of what's going on than I am with flexibility here.
> I don't know whether it will be common for people to frequently switch between configurations with a cache `storage-service` and offline operations. My guess is that people who use remote execution will not frequently work offline (with the same project).
Interesting... first... I think my biggest concern with *"My guess is that people who use remote execution will not frequently work offline"*, is that we have not made it clear to the user that the purpose of this option is *for use with remote execution*, we have only recommended it for such use ~~without articulating it's usefulness in other contexts~~ (looking at the update patch, it seems we are a little bit closer to articulating this).
Orthogonal to the above concern, I don't really share this expectation about how people will use remote execution, I think that:
* People who use remote execution will probably use a `buildstream.conf` that is tightly coupled with each individual BuildStream project they work on on their workstation
* Even for projects which they use remote execution for, they will find themselves in situations where they will want to edit their `buildstream.conf` and download everything they need onto their laptop, so that they can run a few tests on their 14hrs flight on the way to the conference they are going to where the demo they have to prepared really has to work.
### Summary
* Let's make sure there is a warning when the user explicitly tries to pull things and those things are not actually being delivered to the user
* Let's still try to be more explicit in the documentation about `storage-service`, even if it demands the user be a bit more exposed to internals
* In this case, perhaps we should explain that by default all content is stored locally and that this option causes content to be stored remotely, and separately to this explanation, we can go on to outline how this can be useful with and without remote execution (while explicitly recommending it for remote execution)
### Separate enhancement
Beyond this, logging about pulling and pushing artifacts should be enhanced.
When displaying log lines which express where artifacts and sources are being pushed *to* or pulled *from*, we should explicitly also list the URI of the other side of the endpoint, since it might not be local anymore (while perhaps using the word "localhost" in the cases that `storage-service` is not configured).
This should help keep things clear about what is going on when things are pulled and pushed.
Maybe this is already done in your patch which I didn't review in depth, but if not... then I don't mind postponing this bit and would ask that you open a separate issue to track the logging adjustment.
##########
File path: src/buildstream/_frontend/widget.py
##########
@@ -483,24 +488,23 @@ def print_heading(self, toplevel_project, stream, *, log_file):
values["Maximum Build Tasks"] = context.sched_builders
values["Maximum Push Tasks"] = context.sched_pushers
values["Maximum Network Retries"] = context.sched_network_retries
+
+ if context.remote_cache_spec:
+ values["Cache Storage Service"] = format_spec(context.remote_cache_spec)
+
text += self._format_values(values)
if context.remote_execution_specs:
specs = context.remote_execution_specs
- def format_spec(spec):
- if spec.instance_name:
- return "{} (instance: {})".format(spec.url, spec.instance_name)
- return spec.url
-
text += "\n"
text += self.content_profile.fmt("Remote Execution Configuration\n", bold=True)
values = OrderedDict()
values["Execution Service"] = format_spec(specs.exec_spec)
- values["Storage Service"] = format_spec(specs.storage_spec)
+ if specs.storage_spec:
Review comment:
I think it would be better to have the summary redundantly specify the storage service, rather than make the user infer that is will be defaulted to the `storage-service`
--
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:
users@infra.apache.org