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

[WIP] Cached local process execution #7171

1 change: 1 addition & 0 deletions src/python/pants/engine/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ def tc(constraint):
self.context.utf8_buf(build_root),
self.context.utf8_buf(work_dir),
self.context.utf8_buf(local_store_dir),
self.context.utf8_buf(execution_options.local_execution_process_cache_namespace or ""),
self.context.utf8_buf_buf(ignore_patterns),
self.to_ids_buf(root_subject_types),
# Remote execution config.
Expand Down
2 changes: 2 additions & 0 deletions src/python/pants/engine/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def __init__(
self._tasks = native.new_tasks()
self._register_rules(rule_index)

# TODO: we REALLY need to have a datatype for all of these so that we don't mix up arguments by
# order.
self._scheduler = native.new_scheduler(
tasks=self._tasks,
root_subject_types=self._root_subject_types,
Expand Down
8 changes: 8 additions & 0 deletions src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class GlobMatchErrorBehavior(enum('failure_behavior', ['ignore', 'warn', 'error'


class ExecutionOptions(datatype([
'local_execution_process_cache_namespace',
'remote_store_server',
'remote_store_thread_count',
'remote_execution_server',
Expand All @@ -52,6 +53,7 @@ class ExecutionOptions(datatype([
@classmethod
def from_bootstrap_options(cls, bootstrap_options):
return cls(
local_execution_process_cache_namespace=bootstrap_options.local_execution_process_cache_namespace,
remote_store_server=bootstrap_options.remote_store_server,
remote_execution_server=bootstrap_options.remote_execution_server,
remote_store_thread_count=bootstrap_options.remote_store_thread_count,
Expand All @@ -68,6 +70,7 @@ def from_bootstrap_options(cls, bootstrap_options):


DEFAULT_EXECUTION_OPTIONS = ExecutionOptions(
local_execution_process_cache_namespace=None,
remote_store_server=[],
remote_store_thread_count=1,
remote_execution_server=None,
Expand Down Expand Up @@ -291,6 +294,11 @@ def register_bootstrap_options(cls, register):
# This default is also hard-coded into the engine's rust code in
# fs::Store::default_path
default=os.path.expanduser('~/.cache/pants/lmdb_store'))
register('--local-execution-process-cache-namespace', advanced=True,
help="The cache namespace for local process execution. "
"Bump this to invalidate every artifact's local execution. "
"This is the hermetic execution equivalent of the legacy cache-key-gen-version "
"flag.")
register('--remote-store-server', advanced=True, type=list, default=[],
help='host:port of grpc server to use as remote execution file store.')
register('--remote-store-thread-count', type=int, advanced=True,
Expand Down
1 change: 1 addition & 0 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/fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lazy_static = "1"
lmdb = { git = "https://github.com/pantsbuild/lmdb-rs.git", rev = "06bdfbfc6348f6804127176e561843f214fc17f8" }
log = "0.4"
parking_lot = "0.6"
prost = "0.4"
protobuf = { version = "2.0.4", features = ["with-bytes"] }
serverset = { path = "../serverset" }
sha2 = "0.8"
Expand Down
Loading