Skip to content

Commit

Permalink
feat: Add webhooks_base_url to det deploy (#5354)
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-determined-ai authored Nov 15, 2022
1 parent 5a476ac commit bf02b05
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ commands:
reattach-enabled:
type: boolean
default: false
webhooks-base-url:
type: string
default: ""
steps:
- run:
name: Initialize extra arguments
Expand Down Expand Up @@ -584,6 +587,7 @@ commands:
--aux-agent-instance-type <<parameters.aux-agent-instance-type>> \
--compute-agent-instance-type <<parameters.compute-agent-instance-type>> \
--max-dynamic-agents <<parameters.max-dynamic-agents>> \
--webhooks-base-url <<parameters.webhooks-base-url>> \
--keypair <<parameters.keypair>> \
--yes
Expand Down
6 changes: 6 additions & 0 deletions harness/determined/deploy/aws/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def deploy_aws(command: str, args: argparse.Namespace) -> None:
constants.cloudformation.IMAGE_REPO_PREFIX: args.image_repo_prefix,
constants.cloudformation.MOUNT_EFS_ID: args.efs_id,
constants.cloudformation.MOUNT_FSX_ID: args.fsx_id,
constants.cloudformation.WEBHOOKS_BASE_URL: args.webhooks_base_url,
constants.cloudformation.AGENT_REATTACH_ENABLED: args.agent_reattach_enabled,
constants.cloudformation.AGENT_RECONNECT_ATTEMPTS: args.agent_reconnect_attempts,
constants.cloudformation.AGENT_RECONNECT_BACKOFF: args.agent_reconnect_backoff,
Expand Down Expand Up @@ -510,6 +511,11 @@ def handle_dump_master_config_template(args: argparse.Namespace) -> None:
default=5,
help="max attempts an agent has to reconnect",
),
Arg(
"--webhooks-base-url",
type=str,
help="the base url that webhook messages will link to",
),
Arg(
"--agent-reconnect-backoff",
type=int,
Expand Down
1 change: 1 addition & 0 deletions harness/determined/deploy/aws/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class cloudformation:
AGENT_RECONNECT_ATTEMPTS = "AgentReconnectAttempts"
AGENT_RECONNECT_BACKOFF = "AgentReconnectBackoff"
AGENT_CONFIG_FILE_CONTENTS = "AgentConfigFileContents"
WEBHOOKS_BASE_URL = "WebhooksBaseUrl"


class misc:
Expand Down
1 change: 1 addition & 0 deletions harness/determined/deploy/aws/deployment_types/govcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Govcloud(base.DeterminedDeployment):
constants.cloudformation.AGENT_RECONNECT_ATTEMPTS,
constants.cloudformation.AGENT_RECONNECT_BACKOFF,
constants.cloudformation.AGENT_CONFIG_FILE_CONTENTS,
constants.cloudformation.WEBHOOKS_BASE_URL,
]

def deploy(self, no_prompt: bool, update_terminate_agents: bool) -> None:
Expand Down
1 change: 1 addition & 0 deletions harness/determined/deploy/aws/deployment_types/secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Secure(base.DeterminedDeployment):
constants.cloudformation.AGENT_RECONNECT_ATTEMPTS,
constants.cloudformation.AGENT_RECONNECT_BACKOFF,
constants.cloudformation.AGENT_CONFIG_FILE_CONTENTS,
constants.cloudformation.WEBHOOKS_BASE_URL,
]

def deploy(self, no_prompt: bool, update_terminate_agents: bool) -> None:
Expand Down
1 change: 1 addition & 0 deletions harness/determined/deploy/aws/deployment_types/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Simple(base.DeterminedDeployment):
constants.cloudformation.AGENT_RECONNECT_ATTEMPTS,
constants.cloudformation.AGENT_RECONNECT_BACKOFF,
constants.cloudformation.AGENT_CONFIG_FILE_CONTENTS,
constants.cloudformation.WEBHOOKS_BASE_URL,
]

def deploy(self, no_prompt: bool, update_terminate_agents: bool) -> None:
Expand Down
1 change: 1 addition & 0 deletions harness/determined/deploy/aws/deployment_types/vpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class VPCBase(base.DeterminedDeployment):
constants.cloudformation.AGENT_RECONNECT_ATTEMPTS,
constants.cloudformation.AGENT_RECONNECT_BACKOFF,
constants.cloudformation.AGENT_CONFIG_FILE_CONTENTS,
constants.cloudformation.WEBHOOKS_BASE_URL,
]

def deploy(self, no_prompt: bool, update_terminate_agents: bool) -> None:
Expand Down
9 changes: 9 additions & 0 deletions harness/determined/deploy/aws/templates/efs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ Parameters:
Type: String
Description: preexisting EFS ID to mount
Default: ""

WebhooksBaseUrl:
Type: String
Description: The url that webhook messages will link to
Default: ""


MasterConfigTemplate:
Type: String
Expand Down Expand Up @@ -788,6 +794,9 @@ Resources:
enable_cors: ${EnableCORS}
webhooks:
base_url: ${WebhooksBaseUrl}
resource_manager:
scheduler:
type: ${SchedulerType}
Expand Down
8 changes: 8 additions & 0 deletions harness/determined/deploy/aws/templates/fsx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ Parameters:
Type: String
Description: preexisting FSx ID to mount
Default: ""

WebhooksBaseUrl:
Type: String
Description: The url that webhook messages will link to
Default: ""

MasterConfigTemplate:
Type: String
Expand Down Expand Up @@ -808,6 +813,9 @@ Resources:
enable_cors: ${EnableCORS}
webhooks:
base_url: ${WebhooksBaseUrl}
resource_manager:
scheduler:
type: ${SchedulerType}
Expand Down
9 changes: 9 additions & 0 deletions harness/determined/deploy/aws/templates/govcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ Parameters:
Type: String
Description: Whether to retain CloudWatch log group after the stack is deleted
Default: false

WebhooksBaseUrl:
Type: String
Description: The url that webhook messages will link to
Default: ""


MasterConfigTemplate:
Type: String
Expand Down Expand Up @@ -596,6 +602,9 @@ Resources:
enable_cors: ${EnableCORS}
webhooks:
${WebhooksBaseUrl}
resource_manager:
scheduler:
type: ${SchedulerType}
Expand Down
8 changes: 8 additions & 0 deletions harness/determined/deploy/aws/templates/secure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ Parameters:
Description: Prefix for output CloudWatch log group (the full log group will be "/<prefix>/<stack>")
Default: determined

WebhooksBaseUrl:
Type: String
Description: The url that webhook messages will link to
Default: ""

MasterConfigTemplate:
Type: String
Description: Master config template
Expand Down Expand Up @@ -802,6 +807,9 @@ Resources:
enable_cors: ${EnableCORS}
webhooks:
base_url: ${WebhooksBaseUrl}
resource_manager:
scheduler:
type: ${SchedulerType}
Expand Down
9 changes: 9 additions & 0 deletions harness/determined/deploy/aws/templates/simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ Parameters:
Type: String
Description: Whether to retain CloudWatch log group after the stack is deleted
Default: false

WebhooksBaseUrl:
Type: String
Description: The url that webhook messages will link to
Default: ""


MasterConfigTemplate:
Type: String
Expand Down Expand Up @@ -637,6 +643,9 @@ Resources:
enable_cors: ${EnableCORS}
webhooks:
base_url: ${WebhooksBaseUrl}
resource_manager:
scheduler:
type: ${SchedulerType}
Expand Down
5 changes: 5 additions & 0 deletions harness/determined/deploy/gcp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ def handle_dump_master_config_template(args: argparse.Namespace) -> None:
help="use the GCS bucket to store the terraform state "
"instead of a local directory",
),
Arg(
"--webhooks-base-url",
type=str,
help="the base url that webhook messages will link to",
),
],
),
],
Expand Down
1 change: 1 addition & 0 deletions harness/determined/deploy/gcp/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ class defaults:
REGION = "us-west1"
SCHEDULER_TYPE = "fair_share"
PREEMPTION_ENABLED = False
WEBHOOKS_BASE_URL = ""

0 comments on commit bf02b05

Please sign in to comment.