amzn / amazon-ray

Staging area for ongoing enhancements to Ray focused on improving integration with AWS and other Amazon technologies.
Apache License 2.0
66 stars 28 forks source link

Add AWS SNS event callback during cluster setup #96

Closed rkenmi closed 2 years ago

rkenmi commented 2 years ago

Why are these changes needed?

This PR adds a SNS event callback for each Ray cluster setup event. Tested with ray up, ray exec.

TODO: need to add unit tests

To configure, the cluster_notifications should be added as a field under provider (with type aws)

cluster_notifications takes the following arguments:

Example:

# Cloud-provider specific configuration.
provider:
    type: aws
    ...
    # If specified, publishes head node cluster setup events to an SNS topic.
    # Additional message parameters specified here will be included in every SNS notification.
    cluster_notifications:
        sns_topic_arn: "arn:aws:sns:us-west-2a:012345678901:01234567-89ab-cdef-0123-456789abcdef"
        parameters:
             jobId: exampleRayJobId
             createdTimestamp: 123456789
             ...

Related issue number

Checks

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Zyiqin-Miranda commented 2 years ago

Would you mind open this PR against the experimental branch instead of main?

rkenmi commented 2 years ago

Closing the PR and opening a new one rebased on the experimental branch.