Skip to content
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

update domain docs #812

Merged
merged 1 commit into from
May 21, 2024
Merged
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
20 changes: 15 additions & 5 deletions docs/api/python/cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,28 @@ Runhouse offers two options for enabling TLS/SSL on a cluster with Caddy:

Using a Custom Domain
~~~~~~~~~~~~~~~~~~~~~
Runhouse also supports custom domains for deploying your apps and services. In order to configure a domain, make sure
to first add the relevant A record to your domain's DNS settings. Once the cluster is up, you can add a new A record
with its public IP address.
Runhouse supports using custom domains for deploying your apps and services. You can provide the domain ahead of time
before launching the cluster by specifying the :code:`domain` argument:

.. code-block:: python

cluster = rh.cluster(name="rh-serving-cpu",
domain="<your domain>",
instance_type="m5.xlarge",
server_connection_type="tls",
open_ports=[443]).up_if_not()

.. note::

You'll need to also sure the relevant ports are open (ex: 443) in the security group settings of the cluster.
After the cluster is launched, make sure to add the relevant A record to your domain's DNS settings to point this
domain to the cluster's public IP address.

You'll need to also ensure the relevant ports are open (ex: 443) in the security group settings of the cluster.
Runhouse will also automatically set up a TLS certificate for the domain via
`Caddy <https://caddyserver.com/docs/automatic-https>`_.

Once the server is up, you can include its IP and domain when initializing the Runhouse cluster object:
If you have an existing cluster, you can also configure a domain by including the IP and domain when
initializing the Runhouse cluster object:

.. code-block:: python

Expand Down
8 changes: 8 additions & 0 deletions runhouse/resources/hardware/on_demand_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ def up(self):
)

self._update_from_sky_status()

if self.domain:
logger.info(
f"Cluster has been launched with the custom domain '{self.domain}'. "
"Please add an A record to your DNS provider to point this domain to the cluster's "
f"public IP address ({self.address}) to ensure successful requests."
)

self.restart_server()

# Save a limited version of the local ~/.rh config to the cluster with the user's hashed token
Expand Down
Loading