Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dashboard monitoring resources #54

Merged
merged 5 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ more simple VM instances.
Used when specifying a pre-existing file system to be mounted by
simple_instances and slurm resources.

### Monitoring

* [**dashboard**](monitoring/dashboard/README.md): Creates a
[monitoring dashboard](https://cloud.google.com/monitoring/dashboards) for
visually tracking a HPC Toolkit deployment.

### Network

Expand Down
77 changes: 77 additions & 0 deletions resources/monitoring/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## Description
Creates a monitoring dashboard for the HPC cluster distribution. The resource
includes a default HPC focused dashboard with the ability to add custom widgets
as well as the option to add an empty dashboard and add widgets as needed.

## Example
```
- source: resources/monitoring/dashboard
kind: terraform
id: hpc_dash
settings:
widgets:
- |
{
"text": {
"content": "## Header",
"format": "MARKDOWN"
},
"title": "Custom Text Block Widget"
}
```
This resource creates a dashboard based on the HPC dashboard (default) with an
extra text widget added as a multi-line string representing a JSON block.

## License
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Copyright 2021 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14.0 |
| <a name="requirement_google"></a> [google](#requirement\_google) | ~> 3.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | ~> 3.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [google_monitoring_dashboard.dashboard](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_dashboard) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_base_dashboard"></a> [base\_dashboard](#input\_base\_dashboard) | Baseline dashboard template, select from HPC or Emtpy | `string` | `"HPC"` | no |
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | The name of the current deployment | `string` | n/a | yes |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which the HPC deployment will be created | `string` | n/a | yes |
| <a name="input_title"></a> [title](#input\_title) | Title of the created dashboard | `string` | `"HPC Toolkit Dashboard"` | no |
| <a name="input_widgets"></a> [widgets](#input\_widgets) | List of additional widgets to add to the base dashboard. | `list(string)` | `[]` | no |

## Outputs

No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
17 changes: 17 additions & 0 deletions resources/monitoring/dashboard/dashboards/Empty.json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"displayName": "${title}: ${deployment_name}",
"gridLayout": {
"columns": 2,
"widgets": [
{
"text": {
"content": "Metrics from the ${deployment_name} deployment of the HPC Toolkit.",
"format": "MARKDOWN"
},
"title": "${title}"
}%{ for widget in widgets ~},
${widget}
%{endfor ~}
]
}
}
Loading