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

remote caching support #10960

Merged
merged 9 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/python/pants/engine/internals/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def new_scheduler(
speculation_strategy=execution_options.process_execution_speculation_strategy,
use_local_cache=execution_options.process_execution_use_local_cache,
local_enable_nailgun=execution_options.process_execution_local_enable_nailgun,
remote_cache_read=execution_options.remote_cache_read,
remote_cache_write=execution_options.remote_cache_write,
)

return cast(
Expand Down
20 changes: 20 additions & 0 deletions src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class ExecutionOptions:
remote_execution_headers: Any
remote_execution_overall_deadline_secs: int
process_execution_local_enable_nailgun: bool
remote_cache_read: bool
remote_cache_write: bool

@classmethod
def from_bootstrap_options(cls, bootstrap_options):
Expand All @@ -112,6 +114,8 @@ def from_bootstrap_options(cls, bootstrap_options):
remote_execution_headers=bootstrap_options.remote_execution_headers,
remote_execution_overall_deadline_secs=bootstrap_options.remote_execution_overall_deadline_secs,
process_execution_local_enable_nailgun=bootstrap_options.process_execution_local_enable_nailgun,
remote_cache_read=bootstrap_options.remote_cache_read,
remote_cache_write=bootstrap_options.remote_cache_write,
)


Expand All @@ -138,6 +142,8 @@ def from_bootstrap_options(cls, bootstrap_options):
remote_execution_headers={},
remote_execution_overall_deadline_secs=60 * 60, # one hour
process_execution_local_enable_nailgun=False,
remote_cache_read=False,
remote_cache_write=False,
)


Expand Down Expand Up @@ -759,6 +765,20 @@ def register_bootstrap_options(cls, register):
help="Whether or not to use nailgun to run the requests that are marked as nailgunnable.",
advanced=True,
)
register(
"--remote-cache-read",
type=bool,
default=DEFAULT_EXECUTION_OPTIONS.remote_cache_read,
advanced=True,
help="Whether to enable reading from a remote cache",
)
register(
"--remote-cache-write",
type=bool,
default=DEFAULT_EXECUTION_OPTIONS.remote_cache_write,
advanced=True,
help="Whether to enable writing results to a remote cache",
)

@classmethod
def register_options(cls, register):
Expand Down
30 changes: 22 additions & 8 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/engine/process_execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authors = [ "Pants Build <[email protected]>" ]
publish = false

[dependencies]
env_logger = "0.6"
async-trait = "0.1"
walkdir = "2"
async_semaphore = { path = "../async_semaphore" }
Expand Down
4 changes: 4 additions & 0 deletions src/rust/engine/process_execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ pub mod remote;
#[cfg(test)]
pub mod remote_tests;

pub mod remote_cache;
#[cfg(test)]
mod remote_cache_tests;

pub mod speculate;
#[cfg(test)]
mod speculate_tests;
Expand Down
Loading