Do not cap CPU in dev environment if using advertised resources
@@ -6,6 +6,7 @@ import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.Zone;
+import com.yahoo.vespa.flags.BooleanFlag;
import com.yahoo.vespa.flags.FetchVector;
import com.yahoo.vespa.flags.FlagSource;
import com.yahoo.vespa.flags.Flags;
@@ -22,10 +23,12 @@ import java.util.Optional;
public class CapacityPolicies {
private final Zone zone;
+ private final BooleanFlag useAdvertisedResourcesFlag;
private final JacksonFlag<com.yahoo.vespa.flags.custom.NodeResources> defaultResourcesFlag;
public CapacityPolicies(Zone zone, FlagSource flagSource) {
this.zone = zone;
+ this.useAdvertisedResourcesFlag = Flags.USE_ADVERTISED_RESOURCES.bindTo(flagSource);
this.defaultResourcesFlag = Flags.DEFAULT_RESOURCES.bindTo(flagSource);
}
@@ -52,7 +55,7 @@ public class CapacityPolicies {
resources = resources.withDiskSpeed(NodeResources.DiskSpeed.any);
// Dev does not cap the cpu of containers since usage is spotty: Allocate just a small amount exclusively
- if (zone.environment() == Environment.dev)
+ if (zone.environment() == Environment.dev && !useAdvertisedResourcesFlag.value())
resources = resources.withVcpu(0.1);
return resources;
