Skip to content

Commit

Permalink
Allow setting a uses_bulkdata default
Browse files Browse the repository at this point in the history
In global paasta config, so we can set it on a per ecosystem/region level in
puppet to enable us to roll this out without having to modify every
instance in yelpsoa_configs to set uses_bulkdata: true

This is part of the [new proposed rollout
plan](https://docs.google.com/document/d/1RwcJ5JVi2G0Sc2IAXA6tze2CNj2NR8WHN3-rFLjxuOU/edit#bookmark=id.edii46zhxpmu)
  • Loading branch information
timmow committed Aug 7, 2024
1 parent aa1171b commit dc8f323
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions paasta_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ def get_disk(self, default: float = 1024) -> float:
Defaults to 1024 (1GiB) if no value is specified in the config.
:returns: The amount of disk space specified by the config, 1024 MiB if not specified"""
:returns: The amount of disk space specified by the config, 1024 MiB if not specified
"""
disk = self.config_dict.get("disk", default)
return disk

Expand Down Expand Up @@ -979,7 +980,8 @@ def get_pool(self) -> str:
Eventually this may be implemented with Mesos roles, once a framework can register under multiple roles.
:returns: the "pool" attribute in your config dict, or the string "default" if not specified."""
:returns: the "pool" attribute in your config dict, or the string "default" if not specified.
"""
return self.config_dict.get("pool", "default")

def get_pool_constraints(self) -> List[Constraint]:
Expand All @@ -1001,7 +1003,11 @@ def get_net(self) -> str:
def has_bulkdata(
self,
) -> bool:
return self.config_dict.get("uses_bulkdata", True)
paasta_system_config = load_system_paasta_config()
return self.config_dict.get(
"uses_bulkdata",
paasta_system_config.config_dict.get("uses_bulkdata_default", True),
)

def get_volumes(self, system_volumes: Sequence[DockerVolume]) -> List[DockerVolume]:
volumes = list(system_volumes) + list(self.get_extra_volumes())
Expand Down Expand Up @@ -1038,7 +1044,8 @@ def get_dependencies(self) -> Optional[Dict]:
Defaults to None if not specified in the config.
:returns: A list of dictionaries specified in the dependencies_dict, None if not specified"""
:returns: A list of dictionaries specified in the dependencies_dict, None if not specified
"""
dependencies = self.config_dict.get("dependencies")
if not dependencies:
return None
Expand Down Expand Up @@ -1119,7 +1126,6 @@ def composed(*args: Any, **kwargs: Any) -> _ComposeRetT:


class PaastaColors:

"""Collection of static variables and methods to assist in coloring text."""

# ANSI color codes
Expand Down Expand Up @@ -2419,7 +2425,8 @@ def get_synapse_haproxy_url_format(self) -> str:
"""Get a format string for the URL to query for haproxy-synapse state. This format string gets two keyword
arguments, host and port. Defaults to "http://{host:s}:{port:d}/;csv;norefresh".
:returns: A format string for constructing the URL of haproxy-synapse's status page."""
:returns: A format string for constructing the URL of haproxy-synapse's status page.
"""
return self.config_dict.get(
"synapse_haproxy_url_format", DEFAULT_SYNAPSE_HAPROXY_URL_FORMAT
)
Expand All @@ -2434,7 +2441,8 @@ def get_cluster_fqdn_format(self) -> str:
"""Get a format string that constructs a DNS name pointing at the paasta masters in a cluster. This format
string gets one parameter: cluster. Defaults to 'paasta-{cluster:s}.yelp'.
:returns: A format string for constructing the FQDN of the masters in a given cluster."""
:returns: A format string for constructing the FQDN of the masters in a given cluster.
"""
return self.config_dict.get("cluster_fqdn_format", "paasta-{cluster:s}.yelp")

def get_paasta_status_version(self) -> str:
Expand Down

0 comments on commit dc8f323

Please sign in to comment.