Skip to content

Commit

Permalink
Goma places the platform properties in the command, so populate from …
Browse files Browse the repository at this point in the history
…there.

This is the deprecated way of populating properties, but it's required to
support Goma.
  • Loading branch information
chrisstaite-menlo committed Jul 10, 2023
1 parent 5f3e9f5 commit 69a9f5f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions cas/grpc_service/execution_server.rs
Expand Up @@ -30,7 +30,7 @@ use config::cas_server::{ExecutionConfig, InstanceName};
use error::{make_input_err, Error, ResultExt};
use platform_property_manager::PlatformProperties;
use proto::build::bazel::remote::execution::v2::{
execution_server::Execution, execution_server::ExecutionServer as Server, Action, ExecuteRequest,
execution_server::Execution, execution_server::ExecutionServer as Server, Action, Command, ExecuteRequest,
WaitExecutionRequest,
};
use proto::google::longrunning::Operation;
Expand Down Expand Up @@ -84,11 +84,26 @@ impl InstanceInfo {
.scheduler
.get_platform_property_manager()
.make_prop_value(&property.name, &property.value)
.err_tip(|| "Failed to convert platform property in queue_action")?;
.err_tip(|| "Failed to convert platform property in build_action_info")?;
platform_properties.insert(property.name.clone(), platform_property);
}
}

// Goma puts the properties in the Command.
if platform_properties.is_empty() {
let command = get_and_decode_digest::<Command>(self.cas_pin(), &command_digest).await?;
if let Some(platform) = &command.platform {
for property in &platform.properties {
let platform_property = self
.scheduler
.get_platform_property_manager()
.make_prop_value(&property.name, &property.value)
.err_tip(|| "Failed to convert command platform property in build_action_info")?;
platform_properties.insert(property.name.clone(), platform_property);
}
}
}

Ok(ActionInfo {
instance_name,
command_digest,
Expand Down

0 comments on commit 69a9f5f

Please sign in to comment.