Skip to content

Commit

Permalink
chore: update naming (#211)
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Epp <[email protected]>
  • Loading branch information
epmog authored Mar 15, 2024
1 parent 2405084 commit f5ee600
Show file tree
Hide file tree
Showing 27 changed files with 68 additions and 67 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

__pycache__/

.DS_Store
/.attach_pid*
.vscode/
*_version.py
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ This contains logic for the startup phase in the Worker Agent's lifecycle.

### `src/deadline_worker_agent/log_sync`

This Python sub-package contains code responsible for synchronizing logs emitted by Amazon Deadline Cloud tasks to their destination(s) in S3 and CloudWatch Logs, and synchronizing logs emitted by agent to CloudWatch Logs.
This Python sub-package contains code responsible for synchronizing logs emitted by AWS Deadline Cloud tasks to their destination(s) in S3 and CloudWatch Logs, and synchronizing logs emitted by agent to CloudWatch Logs.

### `src/deadline_worker_agent/scheduler`

This contains an impementation of the Worker Agent's scheduler. This works with the Amazon Deadline Cloud farm's scheduler via `UpdateWorkerSchedule` to synchronize the assignment, completion, and status reporting of work.
This contains an impementation of the Worker Agent's scheduler. This works with the AWS Deadline Cloud farm's scheduler via `UpdateWorkerSchedule` to synchronize the assignment, completion, and status reporting of work.

### `src/deadline_worker_agent/sessions`

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This package has two active branches:
## Overview

The DeadlineWorkerAgent package contains the worker agent software that is installed on worker nodes
to interact with Amazon Deadline Cloud and perform tasks.
to interact with AWS Deadline Cloud and perform tasks.

## Security

Expand Down
4 changes: 2 additions & 2 deletions docs/worker_api_contract.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Amazon Deadline Cloud Worker API Workflows Contract
# AWS Deadline Cloud Worker API Workflows Contract

This document outlines the various workflows that a Worker Agent for Amazon Deadline Cloud
This document outlines the various workflows that a Worker Agent for AWS Deadline Cloud
must perform, and the formal requirement for how those workflows are implemented in terms
of the service APIs.

Expand Down
10 changes: 5 additions & 5 deletions scripts/create_service_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ then
echo "Enter a name for your Farm: "
read farm_name

echo "Creating Amazon Deadline Cloud Farm $farm_name"
echo "Creating AWS Deadline Cloud Farm $farm_name"
FARM_ID=$(aws deadline create-farm --display-name $farm_name | jq -r ".farmId")
echo "Created Farm: ${FARM_ID}"
fi
Expand Down Expand Up @@ -82,7 +82,7 @@ EOF
EOF
fi

echo "Creating Amazon Deadline Cloud Queue $queue_name"
echo "Creating AWS Deadline Cloud Queue $queue_name"
QUEUE_ID_1=$(aws deadline create-queue --cli-input-json file://create-queue-config.json | jq -r ".queueId")
rm create-queue-config.json

Expand Down Expand Up @@ -145,7 +145,7 @@ EOF
EOF
fi

echo "Creating Amazon Deadline Cloud Queue $queue_name"
echo "Creating AWS Deadline Cloud Queue $queue_name"
QUEUE_ID_2=$(aws deadline create-queue --cli-input-json file://create-queue-config.json | jq -r ".queueId")
rm create-queue-config.json

Expand Down Expand Up @@ -192,7 +192,7 @@ then
}
EOF

echo "Creating Amazon Deadline Cloud Fleet $fleet_name"
echo "Creating AWS Deadline Cloud Fleet $fleet_name"
FLEET_ID=$(aws deadline create-fleet --cli-input-json file://create-fleet-config.json | jq -r ".fleetId")
rm create-fleet-config.json

Expand All @@ -219,4 +219,4 @@ echo "export QUEUE_ID=\$QUEUE_ID_1" >> .deployed_resources.sh
echo "export FLEET_ID=$FLEET_ID" >> .deployed_resources.sh
cat .deployed_resources.sh
echo
echo "Amazon Deadline Cloud setup complete!"
echo "AWS Deadline Cloud setup complete!"
4 changes: 2 additions & 2 deletions scripts/run_posix_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fi

if ! test -d ${HOME}/.aws/models/deadline
then
echo "ERROR: Amazon Deadline Cloud service model must be installed to ~/.aws/models/deadline"
echo "ERROR: AWS Deadline Cloud service model must be installed to ~/.aws/models/deadline"
exit 1
fi

Expand Down Expand Up @@ -92,7 +92,7 @@ fi

if test "${FARM_ID:-}" == "" || test "${FLEET_ID:-}" == ""
then
echo "ERROR: Amazon Deadline Cloud Farm & Fleet Ids must be available in the environment as FARM_ID and FLEET_ID"
echo "ERROR: AWS Deadline Cloud Farm & Fleet Ids must be available in the environment as FARM_ID and FLEET_ID"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion src/deadline_worker_agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

"""Amazon Deadline Cloud Worker Agent"""
"""AWS Deadline Cloud Worker Agent"""

from ._version import __version__ # noqa
from .installer import install
Expand Down
4 changes: 2 additions & 2 deletions src/deadline_worker_agent/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class JobDetailsError(TypedDict):

class JobAttachmentQueueSettings(TypedDict):
"""
Contains the configuration of job attachments for a Amazon Deadline Cloud queue. This includes the name of
Contains the configuration of job attachments for a AWS Deadline Cloud queue. This includes the name of
the S3 bucket as well as the object key structure. The structure of the objects with respect to
this structure's fields is illustrated below:
Expand Down Expand Up @@ -435,7 +435,7 @@ class CreateWorkerResponse(TypedDict):


class WorkerStatus(str, Enum):
"""Amazon Deadline Cloud Worker states"""
"""AWS Deadline Cloud Worker states"""

STARTED = "STARTED"
"""The Worker is online and ready to begin work"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TemporaryCredentials:
"""
A model class representing temporary AWS credentials and accompanying logic for:
- converting to/from Amazon Deadline Cloud and botocore credential formats
- converting to/from AWS Deadline Cloud and botocore credential formats
- checking whether the credentials are expired
"""

Expand Down Expand Up @@ -77,7 +77,7 @@ def from_cache(
return cls.from_file_format(credentials)

def to_deadline(self) -> AwsCredentials:
"""Converts the temporary credentials to a dictionary as returned from Amazon Deadline Cloud APIs"""
"""Converts the temporary credentials to a dictionary as returned from AWS Deadline Cloud APIs"""
return AwsCredentials(
accessKeyId=self.access_key_id,
secretAccessKey=self.secret_access_key,
Expand Down Expand Up @@ -160,7 +160,7 @@ def from_deadline(
data: AwsCredentials,
) -> TemporaryCredentials:
"""
Creates a TemporaryCredentials instance from a credentials dictionary as returned by Amazon Deadline Cloud
Creates a TemporaryCredentials instance from a credentials dictionary as returned by AWS Deadline Cloud
APIs
"""
return cls(
Expand All @@ -176,7 +176,7 @@ def validate_deadline_credentials(
data: dict[str, Any],
) -> AwsCredentials:
"""
Validates that a dictionary conforms to the structure expected to be returned by Amazon Deadline Cloud
Validates that a dictionary conforms to the structure expected to be returned by AWS Deadline Cloud
APIs via botocore
"""

Expand Down Expand Up @@ -208,7 +208,7 @@ def from_deadline_assume_role_response(
cls, *, response: dict[str, Any], credentials_required: bool, api_name: str
) -> Optional[TemporaryCredentials]:
"""
Converts the response as returned by a boto3 method for Amazon Deadline Cloud's Assume*RoleForWorker
Converts the response as returned by a boto3 method for AWS Deadline Cloud's Assume*RoleForWorker
methods into a TemporaryCredentials instance.
This performs basic key and type validation on the response before returning the result.
Expand Down
4 changes: 2 additions & 2 deletions src/deadline_worker_agent/boto/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
user_agent_extra=f"deadline_worker_agent/{worker_agent_version}",
)
"""
Botocore client configuration for Amazon Deadline Cloud. This overrides to:
- botocore retries - the worker agent has its own retry logic for Amazon Deadline Cloud
Botocore client configuration for AWS Deadline Cloud. This overrides to:
- botocore retries - the worker agent has its own retry logic for AWS Deadline Cloud
API requests. See the `aws/deadline` sub-package for that retry logic.
- add deadline-worker-agent version to user User-Agent request header
"""
Expand Down
16 changes: 8 additions & 8 deletions src/deadline_worker_agent/installer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def install() -> None:
"""Installer entrypoint for the Amazon Deadline Cloud Worker Agent"""
"""Installer entrypoint for the AWS Deadline Cloud Worker Agent"""

if sys.platform not in ["linux", "win32"]:
print(f"ERROR: Unsupported platform {sys.platform}")
Expand Down Expand Up @@ -107,33 +107,33 @@ class ParsedCommandLineArguments(Namespace):


def get_argument_parser() -> ArgumentParser: # pragma: no cover
"""Returns a command-line argument parser for the Amazon Deadline Cloud Worker Agent"""
"""Returns a command-line argument parser for the AWS Deadline Cloud Worker Agent"""

parser = ArgumentParser(
prog="install-deadline-worker",
description="Installer for the Amazon Deadline Cloud Worker Agent",
description="Installer for the AWS Deadline Cloud Worker Agent",
)
parser.add_argument(
"--farm-id",
help="The Amazon Deadline Cloud Farm ID that the Worker belongs to.",
help="The AWS Deadline Cloud Farm ID that the Worker belongs to.",
required=True,
)
parser.add_argument(
"--fleet-id",
help="The Amazon Deadline Cloud Fleet ID that the Worker belongs to.",
help="The AWS Deadline Cloud Fleet ID that the Worker belongs to.",
required=True,
)
parser.add_argument(
"--region",
help='The AWS region of the Amazon Deadline Cloud farm. Defaults to "us-west-2".',
help='The AWS region of the AWS Deadline Cloud farm. Defaults to "us-west-2".',
default="us-west-2",
)

# Windows local usernames are restricted to 20 characters in length.
default_username = "deadline-worker-agent" if sys.platform != "win32" else "deadline-worker"
parser.add_argument(
"--user",
help=f'The username of the Amazon Deadline Cloud Worker Agent user. Defaults to "{default_username}".',
help=f'The username of the AWS Deadline Cloud Worker Agent user. Defaults to "{default_username}".',
default=default_username,
)

Expand Down Expand Up @@ -184,7 +184,7 @@ def get_argument_parser() -> ArgumentParser: # pragma: no cover
if sys.platform == "win32":
parser.add_argument(
"--password",
help="The password for the Amazon Deadline Cloud Worker Agent user. Defaults to generating a password.",
help="The password for the AWS Deadline Cloud Worker Agent user. Defaults to generating a password.",
required=False,
default=None,
)
Expand Down
16 changes: 8 additions & 8 deletions src/deadline_worker_agent/installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

#
# Amazon Deadline Cloud Worker Agent Installer
# AWS Deadline Cloud Worker Agent Installer
#
# This script installs the Amazon Deadline Cloud Worker Agent. The installer provides command-line arguments that
# This script installs the AWS Deadline Cloud Worker Agent. The installer provides command-line arguments that
# can be used to configure the installation. The installer supports upgrading over top of a prior
# installation, but the installer will not backup or rollback the prior installation.
#
Expand Down Expand Up @@ -58,13 +58,13 @@ usage()
echo "Arguments"
echo "---------"
echo " --farm-id FARM_ID"
echo " The Amazon Deadline Cloud Farm ID that the Worker belongs to."
echo " The AWS Deadline Cloud Farm ID that the Worker belongs to."
echo " --fleet-id FLEET_ID"
echo " The Amazon Deadline Cloud Fleet ID that the Worker belongs to."
echo " The AWS Deadline Cloud Fleet ID that the Worker belongs to."
echo " --region REGION"
echo " The AWS region of the Amazon Deadline Cloud farm. Defaults to $region."
echo " The AWS region of the AWS Deadline Cloud farm. Defaults to $region."
echo " --user USER"
echo " A user name that the Amazon Deadline Cloud Worker Agent will run as. Defaults to $default_wa_user."
echo " A user name that the AWS Deadline Cloud Worker Agent will run as. Defaults to $default_wa_user."
echo " --group GROUP"
echo " A group name that the Worker Agent shares with the user(s) that Jobs will be running as."
echo " Do not use the primary/effective group of the Worker Agent user specifeid in --user as"
Expand Down Expand Up @@ -96,7 +96,7 @@ usage()

banner() {
echo "==========================================================="
echo "| Amazon Deadline Cloud Worker Agent Installer |"
echo "| AWS Deadline Cloud Worker Agent Installer |"
echo "==========================================================="
}

Expand Down Expand Up @@ -399,7 +399,7 @@ if ! [[ "${no_install_service}" == "yes" ]]; then
worker_agent_homedir=$(eval echo ~$wa_user)
cat > /etc/systemd/system/deadline-worker.service <<EOF
[Unit]
Description=Amazon Deadline Cloud Worker Agent
Description=AWS Deadline Cloud Worker Agent
[Service]
User=${wa_user}
Expand Down
4 changes: 2 additions & 2 deletions src/deadline_worker_agent/installer/win_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def generate_password(length: int = DEFAULT_PASSWORD_LENGTH) -> str:
def print_banner():
print(
"===========================================================\n"
"| Amazon Deadline Cloud Worker Agent Installer |\n"
"| AWS Deadline Cloud Worker Agent Installer |\n"
"===========================================================\n"
)

Expand Down Expand Up @@ -179,7 +179,7 @@ def ensure_local_agent_user(username: str, password: str) -> None:
"password": password,
"priv": win32netcon.USER_PRIV_USER, # User privilege level, Standard User
"home_dir": None,
"comment": "Amazon Deadline Cloud Worker Agent User",
"comment": "AWS Deadline Cloud Worker Agent User",
"flags": win32netcon.UF_DONT_EXPIRE_PASSWD,
"script_path": None,
}
Expand Down
16 changes: 8 additions & 8 deletions src/deadline_worker_agent/installer/worker.toml.example
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
[worker]

# The unique identifier of the Amazon Deadline Cloud farm that the Worker belongs to. This value is overridden
# The unique identifier of the AWS Deadline Cloud farm that the Worker belongs to. This value is overridden
# when the DEADLINE_WORKER_FARM_ID environment variable is set or the --farm-id command-line argument
# is specified.
#
# The following is an example for setting the farm ID in this configuration file:
#
# farm_id = "farm-aabbccddeeff11223344556677889900"
#
# Uncomment the line below and replace the value with your Amazon Deadline Cloud farm ID:
# Uncomment the line below and replace the value with your AWS Deadline Cloud farm ID:
#
# farm_id = "REPLACE-WITH-WORKER-FARM-ID"


# The unique identifier of the Amazon Deadline Cloud fleet that the Worker belongs to. This value is overridden
# The unique identifier of the AWS Deadline Cloud fleet that the Worker belongs to. This value is overridden
# when the DEADLINE_WORKER_FLEET_ID environment variable is set or the --fleet-id command-line
# argument is specified.
#
# The following is an example for setting the fleet ID in this configuration file:
#
# fleet_id = "fleet-aabbccddeeff11223344556677889900"
#
# Uncomment the line below and replace the value with your Amazon Deadline Cloud fleet ID:
# Uncomment the line below and replace the value with your AWS Deadline Cloud fleet ID:
#
# fleet_id = "REPLACE-WITH-WORKER-FLEET-ID"

Expand Down Expand Up @@ -122,7 +122,7 @@
#
# ******************************************* NOTE ******************************************
# * *
# # The Amazon Deadline Cloud Worker Agent does not have any feature to delete/clean up session logs. #
# # The AWS Deadline Cloud Worker Agent does not have any feature to delete/clean up session logs. #
# # It is up to the worker host admin to manage the deletion of session logs written to #
# # local file-system. Otherwise, the worker could eventually fill up all file-system #
# # capacity. #
Expand All @@ -148,7 +148,7 @@

[os]

# Amazon Deadline Cloud may specify an OS user to run a Job's session actions as. By setting
# AWS Deadline Cloud may specify an OS user to run a Job's session actions as. By setting
# "run_jobs_as_agent_user" to true, the specified OS user is ignored and the session actions
# are instead run as the same user that the worker agent process runs as.
#
Expand All @@ -163,7 +163,7 @@
#
# run_jobs_as_agent_user = true

# Amazon Deadline Cloud may specify an OS user to run a Job's session actions as. Setting
# AWS Deadline Cloud may specify an OS user to run a Job's session actions as. Setting
# "posix_job_user" will override the OS user and the session actions will be run as
# the user given in the value of "posix_job_user" instead. This setting is ignored
# if "run_jobs_as_agent_user" is set to true.
Expand All @@ -185,7 +185,7 @@
#
# posix_job_user = "user:group"

# Amazon Deadline Cloud may tell the worker to stop. If the "shutdown_on_stop" setting below is true, then the
# AWS Deadline Cloud may tell the worker to stop. If the "shutdown_on_stop" setting below is true, then the
# Worker will attempt to shutdown the host system after the Worker has been stopped.
#
# This value is overridden when the DEADLINE_WORKER_NO_SHUTDOWN environment variable is set using
Expand Down
2 changes: 1 addition & 1 deletion src/deadline_worker_agent/log_sync/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

"""Top-level module for Amazon Deadline Cloud Worker Agent log synchronization"""
"""Top-level module for AWS Deadline Cloud Worker Agent log synchronization"""
2 changes: 1 addition & 1 deletion src/deadline_worker_agent/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ def shutdown(
fail_message: str | None = None,
grace_time: timedelta | None = None,
) -> None:
"""Stops all active Work and notifies the Amazon Deadline Cloud service that the Worker is shutting down.
"""Stops all active Work and notifies the AWS Deadline Cloud service that the Worker is shutting down.
Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SyncCanceled(Exception):


class SyncInputJobAttachmentsAction(SessionActionDefinition):
"""Action to synchronize input job attachments for a Amazon Deadline Cloud job
"""Action to synchronize input job attachments for a AWS Deadline Cloud job
Parameters
----------
Expand Down
Loading

0 comments on commit f5ee600

Please sign in to comment.