-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCLOUD2-17975: add description and examples for gpu cloud
- Loading branch information
1 parent
83af2de
commit 947eda7
Showing
11 changed files
with
294 additions
and
127 deletions.
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 |
---|---|---|
@@ -1,47 +1,104 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "gcore_ai_cluster Resource - terraform-provider-gcore" | ||
subcategory: "" | ||
description: |- | ||
Represent instance | ||
Represent GPU cluster | ||
--- | ||
|
||
# gcore_ai_cluster (Resource) | ||
|
||
Represent instance | ||
Represent GPU cluster | ||
|
||
## Example Usage | ||
|
||
##### Prerequisite | ||
|
||
```terraform | ||
provider gcore { | ||
permanent_api_token = "251$d3361.............1b35f26d8" | ||
} | ||
resource "gcore_ai_cluster" "cluster1" { | ||
region_id = 10 | ||
project_id = 15 | ||
flavor = "g2a-ai-fake-v1pod-8" | ||
image_id = "f6aa6e75-ab88-4c19-889d-79133366cb83" | ||
cluster_name = "cluster1" | ||
keypair_name = "front" | ||
volume { | ||
source = "image" | ||
image_id = "f6aa6e75-ab88-4c19-889d-79133366cb83" | ||
volume_type = "standard" | ||
size = 20 | ||
} | ||
data "gcore_project" "project" { | ||
name = "Default" | ||
} | ||
data "gcore_region" "region" { | ||
name = "Luxembourg-2" | ||
} | ||
resource "gcore_network" "network" { | ||
name = "my-network" | ||
type = "vlan" | ||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} | ||
resource "gcore_subnet" "subnet" { | ||
name = "my-subnet" | ||
cidr = "192.168.10.0/24" | ||
network_id = gcore_network.network.id | ||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} | ||
resource "gcore_keypair" "keypair" { | ||
project_id = data.gcore_project.project.id | ||
sshkey_name = "my-keypair" | ||
public_key = "ssh-ed25519 ...your public key... [email protected]" | ||
} | ||
``` | ||
|
||
### Basic example | ||
|
||
#### Creating GPU cluster of one node with one public interface and metadata provided | ||
|
||
```terraform | ||
resource "gcore_ai_cluster" "gpu_cluster" { | ||
flavor = "bm3-ai-1xlarge-h100-80-8" | ||
image_id = "37c4fa17-1f18-4904-95f2-dbf39d0318fe" | ||
cluster_name = "my-gpu-cluster" | ||
keypair_name = "my-keypair" | ||
instances_count = 1 | ||
interface { | ||
type = "external" | ||
type = "external" | ||
} | ||
cluster_metadata = { | ||
my-metadata-key = "my-metadata-value" | ||
} | ||
security_group { | ||
id = "4c74142d-9374-4aa6-b11b-43469b66f746" | ||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} | ||
``` | ||
|
||
#### Creating GPU cluster with two interfaces | ||
|
||
This example demonstrates how to create a baremetal GPU cluster with two network interfaces: one public and one private. | ||
|
||
```terraform | ||
resource "gcore_ai_cluster" "gpu_cluster" { | ||
flavor = "bm3-ai-1xlarge-h100-80-8" | ||
image_id = "37c4fa17-1f18-4904-95f2-dbf39d0318fe" | ||
cluster_name = "my-gpu-cluster" | ||
keypair_name = "my-keypair" | ||
instances_count = 1 | ||
interface { | ||
type = "external" | ||
} | ||
cluster_metadata = { | ||
meta = "meta1" | ||
interface { | ||
type = "subnet" | ||
network_id = gcore_network.network.id | ||
subnet_id = gcore_subnet.subnet.id | ||
} | ||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} | ||
``` | ||
|
||
|
@@ -50,34 +107,34 @@ resource "gcore_ai_cluster" "cluster1" { | |
|
||
### Required | ||
|
||
- `cluster_name` (String) AI Cluster Name | ||
- `cluster_name` (String) GPU Cluster Name | ||
- `flavor` (String) Flavor ID (name) | ||
- `image_id` (String) Image ID | ||
- `interface` (Block List, Min: 1) Networks managed by user and associated with the cluster (see [below for nested schema](#nestedblock--interface)) | ||
|
||
### Optional | ||
|
||
- `cluster_metadata` (Map of String) Cluster metadata (simple key-value pairs) | ||
- `cluster_status` (String) AI Cluster status | ||
- `instances_count` (Number) Number of instances to create | ||
- `keypair_name` (String) Ssh keypair name | ||
- `password` (String) A password for baremetal instance. This parameter is used to set a password for the Admin user on a Windows instance, a default user or a new user on a Linux instance | ||
- `project_id` (Number) | ||
- `project_name` (String) | ||
- `region_id` (Number) | ||
- `region_name` (String) | ||
- `cluster_metadata` (Map of String) A map of metadata items. Key-value pairs for GPU cluster metadata. Example: {'environment': 'production', 'owner': 'user'} | ||
- `cluster_status` (String) GPU Cluster status | ||
- `instances_count` (Number) Number of servers in the GPU cluster | ||
- `keypair_name` (String) The name of the SSH keypair to use for the GPU servers | ||
- `password` (String) A password for servers in GPU cluster. This parameter is used to set a password for the Admin user on a Windows instance, a default user or a new user on a Linux instance | ||
- `project_id` (Number) Project ID, only one of project_id or project_name should be set | ||
- `project_name` (String) Project name, only one of project_id or project_name should be set | ||
- `region_id` (Number) Region ID, only one of region_id or region_name should be set | ||
- `region_name` (String) Region name, only one of region_id or region_name should be set | ||
- `security_group` (Block Set) Security groups attached to the cluster (see [below for nested schema](#nestedblock--security_group)) | ||
- `user_data` (String) String in base64 format. Must not be passed together with 'username' or 'password'. Examples of the user_data: https://cloudinit.readthedocs.io/en/latest/topics/examples.html | ||
- `user_data` (String) User data string in base64 format. This is passed to the instance at launch. For Linux instances, 'user_data' is ignored when 'password' field is provided. For Windows instances, Admin user password is set by 'password' field and cannot be updated via 'user_data' | ||
- `username` (String) A name of a new user in the Linux instance. It may be passed with a 'password' parameter | ||
- `volume` (Block Set) List of volumes attached to the cluster (see [below for nested schema](#nestedblock--volume)) | ||
|
||
### Read-Only | ||
|
||
- `created_at` (String) Datetime when the cluster was created | ||
- `created_at` (String) Datetime when the GPU cluster was created | ||
- `creator_task_id` (String) Task that created this entity | ||
- `id` (String) The ID of this resource. | ||
- `image_name` (String) Image name | ||
- `poplar_servers` (List of Object) Poplar servers (see [below for nested schema](#nestedatt--poplar_servers)) | ||
- `poplar_servers` (List of Object) GPU cluster servers list (see [below for nested schema](#nestedatt--poplar_servers)) | ||
- `task_id` (String) Task ID associated with the cluster | ||
- `task_status` (String) Task status | ||
|
||
|
@@ -193,6 +250,11 @@ Read-Only: | |
- `delete_on_termination` (Boolean) | ||
- `id` (String) | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
@@ -201,3 +263,4 @@ Import is supported using the following syntax: | |
# import using <project_id>:<region_id>:<cluster_id> format | ||
terraform import gcore_ai_cluster.cluster1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7 | ||
``` | ||
|
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,34 @@ | ||
provider gcore { | ||
permanent_api_token = "251$d3361.............1b35f26d8" | ||
} | ||
|
||
data "gcore_project" "project" { | ||
name = "Default" | ||
} | ||
|
||
data "gcore_region" "region" { | ||
name = "Luxembourg-2" | ||
} | ||
|
||
resource "gcore_network" "network" { | ||
name = "my-network" | ||
type = "vlan" | ||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} | ||
|
||
resource "gcore_subnet" "subnet" { | ||
name = "my-subnet" | ||
cidr = "192.168.10.0/24" | ||
network_id = gcore_network.network.id | ||
|
||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} | ||
|
||
resource "gcore_keypair" "keypair" { | ||
project_id = data.gcore_project.project.id | ||
sshkey_name = "my-keypair" | ||
public_key = "ssh-ed25519 ...your public key... [email protected]" | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
examples/resources/gcore_ai_cluster/one-interface-with-meta.tf
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,18 @@ | ||
resource "gcore_ai_cluster" "gpu_cluster" { | ||
flavor = "bm3-ai-1xlarge-h100-80-8" | ||
image_id = "37c4fa17-1f18-4904-95f2-dbf39d0318fe" | ||
cluster_name = "my-gpu-cluster" | ||
keypair_name = "my-keypair" | ||
instances_count = 1 | ||
|
||
interface { | ||
type = "external" | ||
} | ||
|
||
cluster_metadata = { | ||
my-metadata-key = "my-metadata-value" | ||
} | ||
|
||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.id | ||
} |
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
resource "gcore_ai_cluster" "gpu_cluster" { | ||
flavor = "bm3-ai-1xlarge-h100-80-8" | ||
image_id = "37c4fa17-1f18-4904-95f2-dbf39d0318fe" | ||
cluster_name = "my-gpu-cluster" | ||
keypair_name = "my-keypair" | ||
instances_count = 1 | ||
|
||
interface { | ||
type = "external" | ||
} | ||
|
||
interface { | ||
type = "subnet" | ||
|
||
network_id = gcore_network.network.id | ||
subnet_id = gcore_subnet.subnet.id | ||
} | ||
|
||
project_id = data.gcore_project.project.id | ||
region_id = data.gcore_region.region.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
Oops, something went wrong.