-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d726c1
commit 66474cd
Showing
6 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Beam Arc on Crusoe Cloud | ||
|
||
This will help you run a single instance of Beam Arc on [Crusoe Cloud](https://docs.crusoecloud.com/). | ||
|
||
## Prereqs | ||
|
||
1. Install terraform. | ||
1. Configure your Crusoe config ([docs](https://docs.crusoecloud.com/quickstart/installing-the-cli/index.html#configure-the-cli)). | ||
|
||
|
||
## Getting started | ||
|
||
1. Find your project ID. | ||
1. Make a new SSH key, or point to an existing one. | ||
1. Create a `terraform.tfvars` file in this directory. | ||
``` | ||
project_id = "<uuid of your project>" | ||
instance_type = "a40.1x" | ||
ssh_key_path = "~/.ssh/id_crusoecloud.pub" | ||
``` | ||
1. Deploy the instance. | ||
|
||
```sh | ||
terraform apply | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
crusoe = { | ||
source = "registry.terraform.io/crusoecloud/crusoe" | ||
version = "0.5.3" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
locals { | ||
name = "beam-arc" | ||
ssh_key_content = file(var.ssh_key_path) | ||
} | ||
|
||
resource "crusoe_compute_instance" "this" { | ||
name = local.name | ||
image = "ubuntu20.04-nvidia-pcie-docker:latest" | ||
type = var.instance_type | ||
ssh_key = local.ssh_key_content | ||
location = var.location | ||
project_id = var.project_id | ||
|
||
startup_script = <<-EOF | ||
#!/bin/bash | ||
mkdir /data | ||
mkfs.ext4 /dev/vda | ||
mount -t ext4 /dev/vda /data | ||
# cd /data | ||
# git clone https://github.com/beam-cloud/beam.git | ||
# cd beam | ||
# make setup | ||
EOF | ||
|
||
disks = [ | ||
{ | ||
id = crusoe_storage_disk.data.id | ||
mode = "read-write" | ||
attachment_type = "data" | ||
} | ||
] | ||
|
||
depends_on = [crusoe_storage_disk.data] | ||
} | ||
|
||
resource "crusoe_storage_disk" "data" { | ||
name = "${local.name}-data" | ||
size = "400GiB" | ||
location = var.location | ||
project_id = var.project_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "public_ipv4" { | ||
value = crusoe_compute_instance.this.network_interfaces[0].public_ipv4.address | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
variable "project_id" { | ||
description = "UUID of your project." | ||
type = string | ||
} | ||
|
||
variable "ssh_key_path" { | ||
description = "Path to your public SSH key." | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
description = "Location to deploy your resources." | ||
type = string | ||
default = "us-northcentral1-a" | ||
} | ||
|
||
variable "instance_type" { | ||
type = string | ||
default = "a40.1x" | ||
} |