Skip to content

Commit

Permalink
Adopt firewall-rules module in ml-slurm example
Browse files Browse the repository at this point in the history
  • Loading branch information
tpdownes committed Feb 15, 2024
1 parent b6cae6b commit a3045c7
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions examples/ml-slurm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,51 @@ vars:
deployment_groups:
- group: primary
modules:
- id: network1
- id: network
source: modules/network/pre-existing-vpc

# this example anticipates that the VPC default network has internal traffic
# allowed and IAP tunneling for SSH connections
- id: firewall_rule
source: modules/network/firewall-rules
use:
- network
settings:
ingress_rules:
- name: $(vars.deployment_name)-allow-internal-traffic
description: Allow internal traffic
destination_ranges:
- $(network.subnetwork_address)
source_ranges:
- $(network.subnetwork_address)
allow:
- protocol: tcp
ports:
- 0-65535
- protocol: udp
ports:
- 0-65535
- protocol: icmp
- name: $(vars.deployment_name)-allow-iap-ssh
description: Allow IAP-tunneled SSH connections
destination_ranges:
- $(network.subnetwork_address)
source_ranges:
- 35.235.240.0/20
allow:
- protocol: tcp
ports:
- 22

- id: homefs
source: modules/file-system/filestore
use:
- network1
- network
settings:
local_mount: /home
size_gb: 2560
filestore_tier: BASIC_SSD

- id: script
source: modules/scripts/startup-script
settings:
Expand Down Expand Up @@ -129,7 +164,7 @@ deployment_groups:
source: modules/packer/custom-image
kind: packer
use:
- network1
- network
- script
settings:
# give VM a public IP to ensure startup script can reach public internet
Expand Down Expand Up @@ -208,7 +243,7 @@ deployment_groups:
use:
- a2_node_group
- homefs
- network1
- network
settings:
partition_name: a2
is_default: true
Expand All @@ -227,7 +262,7 @@ deployment_groups:
use:
- g2_node_group
- homefs
- network1
- network
settings:
partition_name: g2
enable_placement: false
Expand All @@ -236,7 +271,7 @@ deployment_groups:
- id: slurm_controller
source: community/modules/scheduler/schedmd-slurm-gcp-v5-controller
use:
- network1
- network
- a2_partition
- g2_partition
- homefs
Expand All @@ -249,7 +284,7 @@ deployment_groups:
source: community/modules/scheduler/schedmd-slurm-gcp-v5-login
use:
- examples
- network1
- network
- slurm_controller
settings:
disable_login_public_ips: false
Expand Down

0 comments on commit a3045c7

Please sign in to comment.