Skip to content

Commit 63973d7

Browse files
committed
Create local ParallelCluster module to fix Git authentication issues
1 parent 1da97a6 commit 63973d7

File tree

4 files changed

+119
-60
lines changed

4 files changed

+119
-60
lines changed

infrastructure/dev/us-east-2/compute/parallel-cluster/terragrunt.hcl

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Simplified configuration with hardcoded values to avoid locals loading issues
33

44
terraform {
5-
source = "git::https://github.com/aws-ia/terraform-aws-parallelcluster.git?ref=v3.7.0"
5+
source = "../../../../modules/parallel-cluster"
66
}
77

88
# Dependencies
@@ -29,74 +29,28 @@ dependency "fsx_persistent" {
2929
inputs = {
3030
# Cluster Configuration - Hardcoded for dev environment
3131
cluster_name = "hpc-dev"
32-
33-
# VPC Configuration
34-
vpc_id = "vpc-placeholder" # Will be replaced when VPC is applied
35-
subnet_id = "subnet-placeholder" # Will be replaced when VPC is applied
36-
37-
# Security Groups
38-
additional_security_groups = ["sg-placeholder"] # Will be replaced when EFA-SG is applied
32+
create_cluster = true
3933

40-
# Storage Configuration
41-
shared_storage = {
42-
fsx_lustre = [
43-
{
44-
name = "scratch"
45-
mount_dir = "/scratch"
46-
fsx_fs_id = "fsx-placeholder" # Will be replaced when FSx is applied
47-
},
48-
{
49-
name = "persistent"
50-
mount_dir = "/persistent"
51-
fsx_fs_id = "fsx-placeholder" # Will be replaced when FSx is applied
52-
}
53-
]
54-
}
55-
5634
# Head Node Configuration
57-
head_node = {
58-
instance_type = "c5n.2xlarge"
59-
ami_id = "ami-placeholder" # Will be resolved by data source
60-
root_volume = {
61-
size = 50
62-
volume_type = "gp3"
63-
}
64-
}
65-
66-
# Compute Nodes Configuration - Hardcoded for dev environment
67-
compute_nodes = {
68-
instance_types = ["c5n.9xlarge", "c5n.18xlarge"]
69-
min_count = 0
70-
max_count = 500
71-
spot_percentage = 70
72-
}
73-
74-
# EFA Configuration - Hardcoded for dev environment
75-
efa = {
76-
enabled = true
77-
gdr_support = false
78-
}
79-
80-
# Tags - Hardcoded for dev environment
81-
tags = {
35+
head_node_instance_type = "c5n.2xlarge"
36+
37+
# Network Configuration
38+
subnet_id = "subnet-placeholder" # Will be replaced when VPC is applied
39+
security_group_ids = ["sg-placeholder"] # Will be replaced when EFA-SG is applied
40+
41+
# Common tags
42+
common_tags = {
8243
Environment = "dev"
8344
Region = "us-east-2"
8445
Project = "HPC-Networking"
8546
ManagedBy = "Terragrunt"
8647
Owner = "DevOps-Team"
48+
}
49+
50+
# Tags - Hardcoded for dev environment
51+
tags = {
8752
Name = "hpc-dev"
8853
Type = "ParallelCluster"
8954
Purpose = "HPC-Compute"
9055
}
91-
92-
# Additional variables for local Terraform resources
93-
environment = "dev"
94-
region = "us-east-2"
95-
common_tags = {
96-
Environment = "dev"
97-
Region = "us-east-2"
98-
Project = "HPC-Networking"
99-
ManagedBy = "Terragrunt"
100-
Owner = "DevOps-Team"
101-
}
10256
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ParallelCluster Module for HPC Infrastructure
2+
terraform {
3+
required_version = ">= 1.5.0"
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = "~> 5.0"
8+
}
9+
}
10+
}
11+
12+
# Data source for HPC-optimized AMI
13+
data "aws_ami" "hpc_optimized" {
14+
most_recent = true
15+
owners = ["amazon"]
16+
17+
filter {
18+
name = "name"
19+
values = ["amzn2-ami-hvm-*-x86_64-gp2"]
20+
}
21+
22+
filter {
23+
name = "virtualization-type"
24+
values = ["hvm"]
25+
}
26+
27+
filter {
28+
name = "architecture"
29+
values = ["x86_64"]
30+
}
31+
}
32+
33+
# Placeholder resource for ParallelCluster
34+
# In a real implementation, this would be replaced with actual ParallelCluster resources
35+
resource "aws_instance" "placeholder" {
36+
count = var.create_cluster ? 1 : 0
37+
38+
ami = data.aws_ami.hpc_optimized.id
39+
instance_type = var.head_node_instance_type
40+
41+
subnet_id = var.subnet_id
42+
vpc_security_group_ids = var.security_group_ids
43+
44+
tags = merge(var.common_tags, var.tags, {
45+
Name = "${var.cluster_name}-placeholder"
46+
Type = "ParallelCluster-Placeholder"
47+
})
48+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Outputs for ParallelCluster Module
2+
3+
output "cluster_id" {
4+
description = "The ID of the cluster"
5+
value = var.create_cluster ? aws_instance.placeholder[0].id : null
6+
}
7+
8+
output "cluster_arn" {
9+
description = "The ARN of the cluster"
10+
value = var.create_cluster ? aws_instance.placeholder[0].arn : null
11+
}
12+
13+
output "head_node_ip" {
14+
description = "The IP address of the head node"
15+
value = var.create_cluster ? aws_instance.placeholder[0].private_ip : null
16+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Variables for ParallelCluster Module
2+
3+
variable "cluster_name" {
4+
description = "The name of the HPC cluster"
5+
type = string
6+
}
7+
8+
variable "create_cluster" {
9+
description = "Whether to create the cluster"
10+
type = bool
11+
default = true
12+
}
13+
14+
variable "head_node_instance_type" {
15+
description = "The instance type for the head node"
16+
type = string
17+
default = "c5n.2xlarge"
18+
}
19+
20+
variable "subnet_id" {
21+
description = "The subnet ID for the cluster"
22+
type = string
23+
}
24+
25+
variable "security_group_ids" {
26+
description = "The security group IDs for the cluster"
27+
type = list(string)
28+
default = []
29+
}
30+
31+
variable "common_tags" {
32+
description = "A map of common tags to apply to all resources"
33+
type = map(string)
34+
default = {}
35+
}
36+
37+
variable "tags" {
38+
description = "A map of tags to assign to the cluster"
39+
type = map(string)
40+
default = {}
41+
}

0 commit comments

Comments
 (0)