fsi/MonteCarloMultiGPU/montecarlo_toolkit.yaml [25:199]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  region: us-central1
  zone: us-central1-c
  custom_image:
    family: apptainer-enabled
    project: $(vars.project_id)
  disk_size: 64
  bucket_prefix: mc_bucket
  zones: [us-central1-a, us-central1-b, us-central1-c]

# Documentation for each of the modules used below can be found at
# https://github.com/GoogleCloudPlatform/hpc-toolkit/blob/main/modules/README.md

deployment_groups:
- group: primary
  modules:
  - id: solution
    source: /usr/local/google/home/jrossthomson/_HPC/scientific-computing-examples/fsi/MonteCarloMultiGPU/solution
  - id: network

    source: modules/network/vpc
  - id: enable_apis
    source: community/modules/project/service-enablement
    settings:
      gcp_service_list: [
        "cloudresourcemanager.googleapis.com",
        "container.googleapis.com",
        "logging.googleapis.com",
        "compute.googleapis.com"
      ]
  - id: homefs
    source: modules/file-system/filestore
    use: [network]
    settings:
      local_mount: /home

  - id: startup_script
    source: modules/scripts/startup-script
    settings:
      install_cloud_ops_agent: false
      runners:
      - type: shell
        destination: install_apptainer.sh
        content: |
          #!/bin/sh
          dnf install -y epel-release
          dnf install -y apptainer-suid

  - id: startup_login
    source: modules/scripts/startup-script
    settings:
      runners:
      - type: data
        destination: "/tmp/montecarlo_slurm.job"
        content: $(file(ghpc_stage("montecarlo_slurm.job")))
      - type: shell
        destination: install_apptainer.sh
        content: |
          #!/bin/sh
          dnf install -y epel-release
          dnf install -y apptainer-suid

  - id: data_bucket
    source: community/modules/file-system/cloud-storage-bucket
    settings:
      name_prefix: $(vars.bucket_prefix)
      random_suffix: true
      force_destroy: true
      local_mount: /mnt/data_bucket
      mount_options: defaults,_netdev,implicit_dirs,allow_other,dir_mode=0777,file_mode=766

  ## Monitoring
  - id: hpc_dash
    source: modules/monitoring/dashboard
    settings:
      title: HPC
  - id: gpu_dash
    source: modules/monitoring/dashboard
    settings:
      title: GPU
      base_dashboard: Empty
      widgets:
      - |
          {
            "title": "GPU Memory Utilization",
            "xyChart": {
              "dataSets": [
                {
                  "timeSeriesQuery": {
                    "timeSeriesFilter": {
                      "filter": "metric.type=\"agent.googleapis.com/gpu/memory/bytes_used\" resource.type=\"gce_instance\"",
                      "aggregation": {
                        "perSeriesAligner": "ALIGN_MEAN",
                        "crossSeriesReducer": "REDUCE_NONE",
                        "groupByFields": []
                      }
                    }
                  },
                  "plotType": "LINE",
                  "targetAxis": "Y1",
                  "minAlignmentPeriod": "60s"
                }
              ],
              "chartOptions": {
                "mode": "COLOR",
                "displayHorizontal": false
              },
              "thresholds": [],
              "yAxis": {
                "scale": "LINEAR"
              }
            }
          }
      - |
          {
            "title": "GPU Utilization",
            "xyChart": {
              "dataSets": [
                {
                  "timeSeriesQuery": {
                    "prometheusQuery": "avg_over_time(agent_googleapis_com:gpu_utilization{monitored_resource=\"gce_instance\"}[${__interval}])"
                  },
                  "plotType": "LINE",
                  "targetAxis": "Y1"
                }
              ],
              "chartOptions": {
                "mode": "COLOR",
                "displayHorizontal": false
              },
              "thresholds": [],
              "yAxis": {
                "scale": "LINEAR"
              }
            }
          }


# - group: packer
#   modules:
#   - id: apptainer-enabled-image
#     source: modules/packer/custom-image
#     kind: packer
#     use:
#     - network
#     - scripts_for_image
#     settings:
#       source_image_project_id: [schedmd-slurm-public]
#       # see latest in https://github.com/GoogleCloudPlatform/slurm-gcp/blob/master/docs/images.md#published-image-family
#       source_image_family: slurm-gcp-6-8-hpc-rocky-linux-8
#       # You can find size of source image by using following command
#       # gcloud compute images describe-from-family <source_image_family> --project schedmd-slurm-public
#       disk_size: $(vars.disk_size)
#       image_family: $(vars.custom_image.family)
#       state_timeout: 15m

- group: cluster
  modules:
  - id: compute_nodeset
    source: community/modules/compute/schedmd-slurm-gcp-v6-nodeset
    use: [network]
    settings:
      node_count_dynamic_max: 20
      zones: $(vars.zones)
      disk_size_gb: $(vars.disk_size)
      instance_image: $(vars.custom_image)
      instance_image_custom: true
      bandwidth_tier: gvnic_enabled
      allow_automatic_updates: false

  - id: compute_partition
    source: community/modules/compute/schedmd-slurm-gcp-v6-partition
    use: [compute_nodeset]
    settings:
      partition_name: compute
      is_default: true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



fsi/MonteCarloMultiGPU/montecarlo_toolkit_dws.yaml [25:198]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  region: us-central1
  zone: us-central1-c
  custom_image:
    family: apptainer-enabled
    project: $(vars.project_id)
  disk_size: 64
  bucket_prefix: mc_bucket
  zones: [us-central1-a, us-central1-b, us-central1-c]

# Documentation for each of the modules used below can be found at
# https://github.com/GoogleCloudPlatform/hpc-toolkit/blob/main/modules/README.md

deployment_groups:
- group: primary
  modules:
  - id: solution
    source: /usr/local/google/home/jrossthomson/_HPC/scientific-computing-examples/fsi/MonteCarloMultiGPU/solution
  - id: network
    source: modules/network/vpc
  - id: enable_apis
    source: community/modules/project/service-enablement
    settings:
      gcp_service_list: [
        "cloudresourcemanager.googleapis.com",
        "container.googleapis.com",
        "logging.googleapis.com",
        "compute.googleapis.com"
      ]
  - id: homefs
    source: modules/file-system/filestore
    use: [network]
    settings:
      local_mount: /home

  - id: startup_script
    source: modules/scripts/startup-script
    settings:
      install_cloud_ops_agent: false
      runners:
      - type: shell
        destination: install_apptainer.sh
        content: |
          #!/bin/sh
          dnf install -y epel-release
          dnf install -y apptainer-suid

  - id: startup_login
    source: modules/scripts/startup-script
    settings:
      runners:
      - type: data
        destination: "/tmp/montecarlo_slurm.job"
        content: $(file(ghpc_stage("montecarlo_slurm.job")))
      - type: shell
        destination: install_apptainer.sh
        content: |
          #!/bin/sh
          dnf install -y epel-release
          dnf install -y apptainer-suid

  - id: data_bucket
    source: community/modules/file-system/cloud-storage-bucket
    settings:
      name_prefix: $(vars.bucket_prefix)
      random_suffix: true
      force_destroy: true
      local_mount: /mnt/data_bucket
      mount_options: defaults,_netdev,implicit_dirs,allow_other,dir_mode=0777,file_mode=766

  ## Monitoring
  - id: hpc_dash
    source: modules/monitoring/dashboard
    settings:
      title: HPC
  - id: gpu_dash
    source: modules/monitoring/dashboard
    settings:
      title: GPU
      base_dashboard: Empty
      widgets:
      - |
          {
            "title": "GPU Memory Utilization",
            "xyChart": {
              "dataSets": [
                {
                  "timeSeriesQuery": {
                    "timeSeriesFilter": {
                      "filter": "metric.type=\"agent.googleapis.com/gpu/memory/bytes_used\" resource.type=\"gce_instance\"",
                      "aggregation": {
                        "perSeriesAligner": "ALIGN_MEAN",
                        "crossSeriesReducer": "REDUCE_NONE",
                        "groupByFields": []
                      }
                    }
                  },
                  "plotType": "LINE",
                  "targetAxis": "Y1",
                  "minAlignmentPeriod": "60s"
                }
              ],
              "chartOptions": {
                "mode": "COLOR",
                "displayHorizontal": false
              },
              "thresholds": [],
              "yAxis": {
                "scale": "LINEAR"
              }
            }
          }
      - |
          {
            "title": "GPU Utilization",
            "xyChart": {
              "dataSets": [
                {
                  "timeSeriesQuery": {
                    "prometheusQuery": "avg_over_time(agent_googleapis_com:gpu_utilization{monitored_resource=\"gce_instance\"}[${__interval}])"
                  },
                  "plotType": "LINE",
                  "targetAxis": "Y1"
                }
              ],
              "chartOptions": {
                "mode": "COLOR",
                "displayHorizontal": false
              },
              "thresholds": [],
              "yAxis": {
                "scale": "LINEAR"
              }
            }
          }


# - group: packer
#   modules:
#   - id: apptainer-enabled-image
#     source: modules/packer/custom-image
#     kind: packer
#     use:
#     - network
#     - scripts_for_image
#     settings:
#       source_image_project_id: [schedmd-slurm-public]
#       # see latest in https://github.com/GoogleCloudPlatform/slurm-gcp/blob/master/docs/images.md#published-image-family
#       source_image_family: slurm-gcp-6-8-hpc-rocky-linux-8
#       # You can find size of source image by using following command
#       # gcloud compute images describe-from-family <source_image_family> --project schedmd-slurm-public
#       disk_size: $(vars.disk_size)
#       image_family: $(vars.custom_image.family)
#       state_timeout: 15m

- group: cluster
  modules:
  - id: compute_nodeset
    source: community/modules/compute/schedmd-slurm-gcp-v6-nodeset
    use: [network]
    settings:
      node_count_dynamic_max: 20
      zones: $(vars.zones)
      disk_size_gb: $(vars.disk_size)
      instance_image: $(vars.custom_image)
      instance_image_custom: true
      bandwidth_tier: gvnic_enabled
      allow_automatic_updates: false

  - id: compute_partition
    source: community/modules/compute/schedmd-slurm-gcp-v6-partition
    use: [compute_nodeset]
    settings:
      partition_name: compute
      is_default: true
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



