|
|
|
@ -261,16 +261,17 @@ class ExperimentDefinition(object): |
|
|
|
|
) |
|
|
|
|
self._error = True |
|
|
|
|
return False |
|
|
|
|
is_dict = isinstance(rollout_attributes["default"], dict) |
|
|
|
|
for platform in allowed_platforms: |
|
|
|
|
if is_dict: |
|
|
|
|
if isinstance(rollout_attributes["default"], dict): |
|
|
|
|
value = rollout_attributes["default"].get(platform, False) |
|
|
|
|
else: |
|
|
|
|
value = rollout_attributes["default"] |
|
|
|
|
if isinstance(value, dict): |
|
|
|
|
# debug is assumed for all rollouts with additional constraints |
|
|
|
|
self._default[platform] = "debug" |
|
|
|
|
self._additional_constraints[platform] = value |
|
|
|
|
elif value not in allowed_defaults: |
|
|
|
|
continue |
|
|
|
|
else: |
|
|
|
|
value = rollout_attributes["default"] |
|
|
|
|
if value not in allowed_defaults: |
|
|
|
|
print( |
|
|
|
|
"ERROR: default for experiment %s on platform %s " |
|
|
|
|
"is of incorrect format" |
|
|
|
@ -278,7 +279,6 @@ class ExperimentDefinition(object): |
|
|
|
|
) |
|
|
|
|
self._error = True |
|
|
|
|
return False |
|
|
|
|
else: |
|
|
|
|
self._default[platform] = value |
|
|
|
|
self._additional_constraints[platform] = {} |
|
|
|
|
return True |
|
|
|
@ -637,6 +637,14 @@ class ExperimentsCompiler(object): |
|
|
|
|
s.add(req) |
|
|
|
|
return s |
|
|
|
|
|
|
|
|
|
def EnsureNoDebugExperiments(self): |
|
|
|
|
for name, exp in self._experiment_definitions.items(): |
|
|
|
|
for platform, default in exp._default.items(): |
|
|
|
|
if default == "debug": |
|
|
|
|
raise ValueError( |
|
|
|
|
f"Debug experiments are prohibited. '{name}' is configured with {exp._default}" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
def GenExperimentsBzl(self, mode, output_file): |
|
|
|
|
assert self._FinalizeExperiments() |
|
|
|
|
if self._bzl_list_for_defaults is None: |
|
|
|
|