Skip to content

Get away from master/slave phrasing #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class InvalidRepositoryError(exceptions.Error):
"""Attempted to fetch or clone from a repository missing something basic.

This gets raised if we try to fetch or clone from a repo that is either
missing a HEAD or missing both a "latest" tag and a master branch.
missing a HEAD or missing both a "latest" tag and a main branch.
"""


Expand Down Expand Up @@ -145,7 +145,7 @@ def _PullTags(local_repo, client_wrapper, target_dir):

Returns:
(str, dulwich.objects.Commit) The tag that was actually pulled (we try to
get "latest" but fall back to "master") and the commit object
get "latest" but fall back to "main") and the commit object
associated with it.

Raises:
Expand All @@ -162,7 +162,7 @@ def _PullTags(local_repo, client_wrapper, target_dir):
# Try to get the "latest" tag (latest released version)
revision = None
tag = None
for tag in ('refs/tags/latest', 'refs/heads/master'):
for tag in ('refs/tags/latest', 'refs/heads/main'):
try:
log.debug('looking up ref %s', tag)
revision = local_repo[tag]
Expand All @@ -171,7 +171,7 @@ def _PullTags(local_repo, client_wrapper, target_dir):
log.warn('Unable to checkout branch %s', tag)

else:
raise AssertionError('No "refs/heads/master" tag found in repository.')
raise AssertionError('No "refs/heads/main" tag found in repository.')

return tag, revision

Expand Down Expand Up @@ -256,7 +256,7 @@ def InstallRuntimeDef(url, target_dir):
directory. At this time, the runtime definition url must be the URL of a
git repository and we identify the tree to checkout based on 1) the presence
of a "latest" tag ("refs/tags/latest") 2) if there is no "latest" tag, the
head of the "master" branch ("refs/heads/master").
head of the "main" branch ("refs/heads/main").

Args:
url: (str) A URL identifying a git repository. The HTTP, TCP and local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ class UpdateClusterOptions(object):

def __init__(self,
version=None,
update_master=None,
update_main=None,
update_nodes=None,
node_pool=None,
monitoring_service=None,
Expand All @@ -483,7 +483,7 @@ def __init__(self,
image_type=None,
locations=None):
self.version = version
self.update_master = bool(update_master)
self.update_main = bool(update_main)
self.update_nodes = bool(update_nodes)
self.node_pool = node_pool
self.monitoring_service = monitoring_service
Expand Down Expand Up @@ -548,7 +548,7 @@ def Zone(self, cluster_ref):
return cluster_ref.zone

def Version(self, cluster):
return cluster.currentMasterVersion
return cluster.currentMainVersion

def CreateCluster(self, cluster_ref, options):
node_config = self.messages.NodeConfig()
Expand Down Expand Up @@ -612,7 +612,7 @@ def CreateCluster(self, cluster_ref, options):
cluster = self.messages.Cluster(
name=cluster_ref.clusterId,
nodePools=pools,
masterAuth=self.messages.MasterAuth(username=options.user,
mainAuth=self.messages.MainAuth(username=options.user,
password=options.password))
if options.additional_zones:
cluster.locations = sorted([cluster_ref.zone] + options.additional_zones)
Expand Down Expand Up @@ -654,9 +654,9 @@ def UpdateCluster(self, cluster_ref, options):
desiredNodeVersion=options.version,
desiredNodePoolId=options.node_pool,
desiredImageType=options.image_type)
elif options.update_master:
elif options.update_main:
update = self.messages.ClusterUpdate(
desiredMasterVersion=options.version)
desiredMainVersion=options.version)
elif options.monitoring_service:
update = self.messages.ClusterUpdate(
desiredMonitoringService=options.monitoring_service)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"This will create a cluster with all Kubernetes Alpha features enabled.\n"
"- This cluster will not covered by the Container Engine SLA and should "
"not be used for production workloads.\n"
"- You will not be able to upgrade the master or nodes.\n"
"- You will not be able to upgrade the main or nodes.\n"
"- The cluster will be deleted after 30 days.\n"
)
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _AuthProvider(name='gcp'):

Constructs an auth provider config entry readable by kubectl. This tells
kubectl to call out to a specific gcloud command and parse the output to
retrieve access tokens to authenticate to the kubernetes master.
retrieve access tokens to authenticate to the kubernetes main.
Kubernetes gcp auth provider plugin at
https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/client/auth/gcp/gcp.go

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ def ParseExpireTime(s):
return expire_dt - times.Now(expire_dt.tzinfo)


def TransformMasterVersion(r, undefined=''):
"""Returns the formatted master version.
def TransformMainVersion(r, undefined=''):
"""Returns the formatted main version.

Args:
r: JSON-serializable object.
undefined: Returns this value if the resource cannot be formatted.
Returns:
The formatted master version.
The formatted main version.
"""
version = r.get('currentMasterVersion', None)
version = r.get('currentMainVersion', None)
if version is None:
return undefined
if r.get('enableKubernetesAlpha', False):
Expand All @@ -91,7 +91,7 @@ def TransformMasterVersion(r, undefined=''):


_TRANSFORMS = {
'master_version': TransformMasterVersion,
'main_version': TransformMainVersion,
}


Expand Down
6 changes: 3 additions & 3 deletions google-cloud-sdk/lib/googlecloudsdk/api_lib/container/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def has_ca_cert(self):

@staticmethod
def UseGCPAuthProvider(cluster):
return (cluster.currentMasterVersion and
dist_version.LooseVersion(cluster.currentMasterVersion) >=
return (cluster.currentMainVersion and
dist_version.LooseVersion(cluster.currentMainVersion) >=
dist_version.LooseVersion(MIN_GCP_AUTH_PROVIDER_VERSION) and
not properties.VALUES.container.use_client_certificate.GetBool())

Expand Down Expand Up @@ -211,7 +211,7 @@ def Persist(cls, cluster, project_id):
'project_id': project_id,
'server': 'https://' + cluster.endpoint,
}
auth = cluster.masterAuth
auth = cluster.mainAuth
if auth and auth.clusterCaCertificate:
kwargs['ca_data'] = auth.clusterCaCertificate
else:
Expand Down
12 changes: 6 additions & 6 deletions google-cloud-sdk/lib/googlecloudsdk/api_lib/dns/import_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _SOATranslation(rdata, origin):

Returns:
str, The translation of the given SOA rdata which includes all the required
SOA fields. Note that the master NS name is left in a substitutable form
SOA fields. Note that the main NS name is left in a substitutable form
because it is always provided by Cloud DNS.
"""
return ' '.join(
Expand Down Expand Up @@ -230,7 +230,7 @@ def RecordSetsFromZoneFile(zone_file, domain):
A (name, type) keyed dict of ResourceRecordSets that were obtained from the
zone file. Note that only A, AAAA, CNAME, MX, PTR, SOA, SPF, SRV, and TXT
record-sets are retrieved. Other record-set types are not supported by Cloud
DNS. Also, the master NS field for SOA records is discarded since that is
DNS. Also, the main NS field for SOA records is discarded since that is
provided by Cloud DNS.
"""
zone_contents = zone.from_file(zone_file, domain, check_origin=False)
Expand All @@ -252,7 +252,7 @@ def RecordSetsFromYamlFile(yaml_file):
A (name, type) keyed dict of ResourceRecordSets that were obtained from the
yaml file. Note that only A, AAAA, CNAME, MX, PTR, SOA, SPF, SRV, and TXT
record-sets are retrieved. Other record-set types are not supported by Cloud
DNS. Also, the master NS field for SOA records is discarded since that is
DNS. Also, the main NS field for SOA records is discarded since that is
provided by Cloud DNS.
"""
record_sets = {}
Expand All @@ -272,7 +272,7 @@ def RecordSetsFromYamlFile(yaml_file):
record_set.rrdatas = yaml_record_set['rrdatas']

if rdata_type is rdatatype.SOA:
# Make master NS name substitutable.
# Make main NS name substitutable.
record_set.rrdatas[0] = re.sub(r'\S+', '{0}', record_set.rrdatas[0],
count=1)

Expand Down Expand Up @@ -300,14 +300,14 @@ def _RecordSetCopy(record_set):


def _SOAReplacement(current_record, record_to_be_imported):
"""Returns the replacement SOA record with restored master NS name.
"""Returns the replacement SOA record with restored main NS name.

Args:
current_record: ResourceRecordSet, Current record-set.
record_to_be_imported: ResourceRecordSet, Record-set to be imported.

Returns:
ResourceRecordSet, the replacement SOA record with restored master NS name.
ResourceRecordSet, the replacement SOA record with restored main NS name.
"""
replacement = _RecordSetCopy(record_to_be_imported)
replacement.rrdatas[0] = replacement.rrdatas[0].format(
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-sdk/lib/googlecloudsdk/api_lib/sql/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ def ConstructInstanceFromArgs(cls, sql_messages, args,
instance_resource = sql_messages.DatabaseInstance(
region=region,
databaseVersion=database_version,
masterInstanceName=getattr(args, 'master_instance_name', None),
mainInstanceName=getattr(args, 'main_instance_name', None),
settings=settings)

if hasattr(args, 'master_instance_name'):
if args.master_instance_name:
if hasattr(args, 'main_instance_name'):
if args.main_instance_name:
replication = 'ASYNCHRONOUS'
activation_policy = 'ALWAYS'
if hasattr(args, 'replica_type') and args.replica_type == 'FAILOVER':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def AddImageTypeFlag(parser, target):
def AddClusterVersionFlag(parser, suppressed=False, help=None): # pylint: disable=redefined-builtin
"""Adds a --cluster-version flag to the given parser."""
help_text = argparse.SUPPRESS if suppressed else help or """\
The Kubernetes version to use for the master and nodes. Defaults to
The Kubernetes version to use for the main and nodes. Defaults to
server-specified.

The default Kubernetes version are available using the following command.
Expand Down
8 changes: 4 additions & 4 deletions google-cloud-sdk/lib/googlecloudsdk/command_lib/ml/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def GetUserArgs(local=False):
cluster specification. When you use this tier, set values to configure your
processing cluster according to these guidelines (using the --config flag):

* You _must_ set `TrainingInput.masterType` to specify the type of machine to
use for your master node. This is the only required setting.
* You _must_ set `TrainingInput.mainType` to specify the type of machine to
use for your main node. This is the only required setting.
* You _may_ set `TrainingInput.workerCount` to specify the number of workers to
use. If you specify one or more workers, you _must_ also set
`TrainingInput.workerType` to specify the type of machine to use for your
Expand All @@ -146,8 +146,8 @@ def GetUserArgs(local=False):
_must_ also set `TrainingInput.parameterServerType` to specify the type of
machine to use for your parameter servers. Note that all of your workers must
use the same machine type, which can be different from your parameter server
type and master type. Your parameter servers must likewise use the same
machine type, which can be different from your worker type and master type.\
type and main type. Your parameter servers must likewise use the same
machine type, which can be different from your worker type and main type.\
"""}
SCALE_TIER = base.Argument(
'--scale-tier',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def MakeProcess(module_name,
**extra_popen_args):
"""Make a Popen object that runs the module, with the correct env.

If task_type is 'master' instead replaces the current process with the
If task_type is 'main' instead replaces the current process with the
subprocess via execution_utils.Exec
Args:
module_name: str. Name of the module to run, e.g. trainer.task
Expand All @@ -46,7 +46,7 @@ def MakeProcess(module_name,
Returns:
a subprocess.Popen object corresponding to the subprocesses or an int
corresponding to the return value of the subprocess
(if task_type is 'master')
(if task_type is 'main')
"""
if args is None:
args = []
Expand All @@ -68,7 +68,7 @@ def MakeProcess(module_name,
# configuration options to the training module. the module specific
# arguments are passed as comand line arguments.
env['TF_CONFIG'] = json.dumps(config)
if task_type == 'master':
if task_type == 'main':
return execution_utils.Exec(
cmd, env=env, no_exit=True, cwd=package_root, **extra_popen_args)
else:
Expand Down Expand Up @@ -100,18 +100,18 @@ def RunDistributed(module_name,
user_args: [str]. Additional user args for the task. Any relative paths will
not work.
Returns:
int. the retval of 'master' subprocess
int. the retval of 'main' subprocess
"""
ports = range(start_port, start_port + num_ps + num_workers + 1)
cluster = {
'master': ['localhost:{port}'.format(port=ports[0])],
'main': ['localhost:{port}'.format(port=ports[0])],
'ps': ['localhost:{port}'.format(port=p)
for p in ports[1:num_ps + 1]],
'worker': ['localhost:{port}'.format(port=p)
for p in ports[num_ps + 1:]]
}
for task_type, addresses in cluster.items():
if task_type != 'master':
if task_type != 'main':
for i in range(len(addresses)):
MakeProcess(module_name,
package_root,
Expand All @@ -122,6 +122,6 @@ def RunDistributed(module_name,
return MakeProcess(module_name,
package_root,
args=user_args,
task_type='master',
task_type='main',
index=0,
cluster=cluster)
Loading