Skip to content

[Examples] Add a CloudFormation template showing how to deploy dstack server to AWS#1944

Merged
peterschmidt85 merged 2 commits intomasterfrom
1941-examples-add-a-cloudformation-template-showing-how-to-deploy-dstack-server-to-aws
Nov 16, 2024
Merged

[Examples] Add a CloudFormation template showing how to deploy dstack server to AWS#1944
peterschmidt85 merged 2 commits intomasterfrom
1941-examples-add-a-cloudformation-template-showing-how-to-deploy-dstack-server-to-aws

Conversation

@peterschmidt85
Copy link
Copy Markdown
Contributor

Fixes #1941

@malandrina
Copy link
Copy Markdown

malandrina commented Nov 6, 2024

Hi there! I’m working with @spott to provision and deploy resources for dstack on AWS. I’m running into an issue where creating the cluster times out due to a task failing with the error CannotPullContainerError: pull image manifest has been retried 5 time(s): failed to resolve ref docker.io/dstackai/dstack:latest: failed to do request: Head "https://registry-1.docker.io/v2/dstackai/dstack/manifests/latest": dial tcp 54.227.20.253:443: i/o timeout.

Some additional information about our setup and steps I’ve taken:

  • The VPC we’re using is private, with two private subnets in two different areas
  • After encountering the error the first time I attached an AWS Internet Gateway to the VPC, thinking that this would allow resources provisioned in the private VPC to access the internet, but when I recreated the CloudFormation stack the cluster creation failed with the same error

Any chance you could point us in the right direction?

@peterschmidt85
Copy link
Copy Markdown
Contributor Author

@malandrina Thank you for sharing this! Any chance you can check that the VPC has Internet access? Perhaps can be checked by creating an instance in this private VPC and checking that Internet is accessible.

Also perhaps you could share a screenshot of the VPC resources? Just to see what subnets and Gaweway/NAT are there?

Here's ane example of a VPC that I tested the CloudFormtion stack with:

Screenshot 2024-11-06 at 23 38 42

If this helps, please feel free to join Discord, I can create a private channel.

@malandrina
Copy link
Copy Markdown

Thanks for the quick response @peterschmidt85! The information you shared was exactly what I needed and I was able to create a dstack cluster via CloudFormation with the template in this PR.

It took me a while to get the private/public subnet and gateway configuration right, but (in case it's helpful to others) here's what I ended up with:

Resources:

  • 1 VPC
  • 2 private subnets
    • 1 in availability zone $1
    • 1 in availability zone $2
  • 2 public subnets
    • 1 in availability zone $1
    • 1 in availability zone $2
  • 1 Internet Gateway
  • 2 NAT Gateways
    • 1 on public subnet in availability zone $1
    • 1 on public subnet in availability zone $2

Routing:

  • Public subnets -> Internet Gateway
  • AZ $1 private subnet -> AZ $1 NAT Gateway
  • AZ $2 private subnet -> AZ $2 NAT Gateway

@peterschmidt85 peterschmidt85 marked this pull request as ready for review November 16, 2024 11:55
@peterschmidt85 peterschmidt85 merged commit 580cba0 into master Nov 16, 2024
@peterschmidt85 peterschmidt85 deleted the 1941-examples-add-a-cloudformation-template-showing-how-to-deploy-dstack-server-to-aws branch November 16, 2024 11:55
superprat pushed a commit to bahaal-tech/dstack that referenced this pull request Dec 20, 2024
… server to AWS (dstackai#1944)

* - [Examples] Add a CloudFormation template showing how to deploy dstack server to AWS dstackai#1941

* - [Examples] Add a CloudFormation template showing how to deploy dstack server to AWS dstackai#1941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Examples] Add a CloudFormation template showing how to deploy dstack server to AWS

2 participants