Skip to content

Latest commit

 

History

History

README.md

{{ $inputs := (default dict (index (default dict .nuon.inputs) "inputs")) }} {{ $root_domain := (dig "root_domain" "" $inputs) }} {{ $public_domain := (dig "outputs" "nuon_dns" "public_domain" "name" $root_domain .nuon.sandbox) }}

{{/* Setup runbooks (config label: type=setup). The README template can't read runbook labels at render time, so list each type=setup runbook here with its completion check. Keep in sync as setup runbooks are added/removed. */}} {{ $slackDone := false }}{{ with index (default dict .nuon.actions.workflows) "sync_slack_secrets" }}{{ if eq .status "finished" }}{{ $slackDone = true }}{{ end }}{{ end }} {{ $setupRunbooks := list (dict "name" "slack_setup" "label" "Slack" "complete" $slackDone) }} {{ $incomplete := list }}{{ range $setupRunbooks }}{{ if not .complete }}{{ $incomplete = append $incomplete . }}{{ end }}{{ end }} {{ if gt (len $incomplete) 0 }} Some setup is still required. Once the install is provisioned, finish the setup runbook(s) below:

{{ end }}

{{ $wfOutputs := dict }}{{ $wfActionID := "" }}{{ with (index (default dict .nuon.actions.workflows) "ctl_api_query_workflows_by_type") }}{{ with .outputs }}{{ $wfOutputs = . }}{{ end }}{{ $wfActionID = dig "id" "" . }}{{ end }}

Recent workflows

See more →{{ with dig "updated_at" "" $wfOutputs }}Last updated {{ end }}

{{ with (index (default dict .nuon.actions.workflows) "ctl_api_query_workflows_by_type") }} {{ $wfData := dict }}{{ with .outputs }}{{ $wfData = . }}{{ end }} {{ $wfRows := dig "workflows" (list) $wfData }} {{ if and .populated (eq .status "finished") (gt (len $wfRows) 0) }}

{{ $topWf := $wfRows }}{{ if gt (len $wfRows) 5 }}{{ $topWf = slice $wfRows 0 5 }}{{ end }} {{ range $wf := $topWf }} {{ $status := dig "workflow_status" "" $wf }} {{ $email := dig "created_by_email" "" $wf }} {{ $createdByID := dig "created_by_id" "" $wf }} {{ $createdByLabel := $email }}{{ if not $createdByLabel }}{{ $createdByLabel = default "—" $createdByID }}{{ end }} {{ $wfID := dig "workflow_id" "" $wf }} {{ $curStep := dig "latest_step_name" "" $wf }}{{ $curStatus := dig "latest_step_status" "" $wf }}{{ $curGroup := dig "latest_step_group_name" "" $wf }}
Status Name Latest Step Created By Started Finished Details
{{ if $status }}{{ else }}—{{ end }} {{ dig "workflow_name" "—" $wf }}{{ with $wfID }}
{{ . }}{{ end }}
{{ if $curStep }}{{ $curStep }}{{ with $curStatus }} {{ end }}{{ with $curGroup }}
{{ . }}{{ end }}{{ else }}—{{ end }}
{{ $createdByLabel }} {{ with dig "workflow_started_at" "" $wf }}{{ else }}—{{ end }} {{ with dig "workflow_finished_at" "" $wf }}{{ else }}—{{ end }}

<nuon-panel heading="Workflow: {{ dig "workflow_name" (dig "workflow_id" "—" $wf) $wf }}" trigger="View" size="3/4">

{{ $ownerID := dig "owner_id" "" $wf }}{{ $ownerName := dig "owner_name" "" $wf }}{{ $ownerType := dig "owner_type" "" $wf }} {{ $orgID := dig "org_id" "" $wf }}{{ $orgName := dig "org_name" "" $wf }}

FieldValue
Status{{ if $status }}{{ else }}—{{ end }}
Name{{ dig "workflow_name" "—" $wf }}
Type{{ dig "workflow_type" "—" $wf }}
Workflow ID{{ dig "workflow_id" "—" $wf }}
Created By{{ if $email }}{{ $email }}{{ else }}—{{ end }}
Created By ID{{ if $createdByID }}{{ $createdByID }}{{ else }}—{{ end }}
Created By Subject{{ default "—" (dig "created_by_subject" "" $wf) }}
Created By Account Type{{ default "—" (dig "created_by_account_type" "" $wf) }}
Org{{ if $orgName }}{{ $orgName }}{{ else }}—{{ end }}
Org ID{{ if $orgID }}{{ $orgID }}{{ else }}—{{ end }}
Owner{{ if $ownerName }}{{ $ownerName }}{{ else }}—{{ end }}
Owner ID{{ if $ownerID }}{{ $ownerID }}{{ else }}—{{ end }}
Owner Type{{ default "—" $ownerType }}
Created At{{ with dig "workflow_created_at" "" $wf }}{{ else }}—{{ end }}
Updated At{{ with dig "workflow_updated_at" "" $wf }}{{ else }}—{{ end }}
Started At{{ with dig "workflow_started_at" "" $wf }}{{ else }}—{{ end }}
Finished At{{ with dig "workflow_finished_at" "" $wf }}{{ else }}—{{ end }}

Latest step

FieldValue
Name{{ default "—" (dig "latest_step_name" "" $wf) }}
Status{{ with dig "latest_step_status" "" $wf }}{{ else }}—{{ end }}
Step ID{{ with dig "latest_step_id" "" $wf }}{{ . }}{{ else }}—{{ end }}
Step idx{{ default "—" (dig "latest_step_idx" "" $wf) }}
Group{{ default "—" (dig "latest_step_group_name" "" $wf) }}
Group idx{{ default "—" (dig "latest_step_group_idx" "" $wf) }}
  </td>
</tr>

{{ end }}

{{ else if and .populated (eq .status "finished") }}

No workflows returned by the last run of ctl_api_query_workflows_by_type.

{{ else }}

Waiting on ctl_api_query_workflows_by_type. Run it to populate this section.

{{ end }} {{ else }}

Waiting on ctl_api_query_workflows_by_type. Run it to populate this section.

{{ end }}

{{ $runnersAction := default dict (index (default dict .nuon.actions.workflows) "inspect_runners") }} {{ $installsAction := default dict (index (default dict .nuon.actions.workflows) "inspect_installs") }} {{ $orgsAction := default dict (index (default dict .nuon.actions.workflows) "inspect_orgs") }} {{ $appsAction := default dict (index (default dict .nuon.actions.workflows) "inspect_apps") }} {{ $runnersOutputs := default dict (dig "outputs" dict $runnersAction) }} {{ $installsOutputs := default dict (dig "outputs" dict $installsAction) }} {{ $runnersSteps := dig "steps" dict $runnersOutputs }} {{ $installsSteps := dig "steps" dict $installsOutputs }} {{ $orgsSteps := dig "steps" dict (default dict (dig "outputs" dict $orgsAction)) }} {{ $appsSteps := dig "steps" dict (default dict (dig "outputs" dict $appsAction)) }}

Installs

See more →{{ with dig "updated_at" "" $installsOutputs }}Last updated {{ end }}

{{ $installs := dig "installs" (dict) $installsSteps }} {{ $appsByID := dict }} {{ range $, $a := (dig "apps" (dict) $appsSteps) }}{{ $appsByID = set $appsByID (dig "id" "" $a) (dig "name" "" $a) }}{{ end }} {{ $installOrgsByID := dict }} {{ range $, $o := (dig "orgs" (dict) $orgsSteps) }}{{ $installOrgsByID = set $installOrgsByID (dig "id" "" $o) (dig "name" "" $o) }}{{ end }} {{ $installList := values $installs }} {{ if gt (len $installList) 0 }}

{{ $topInstalls := $installList }}{{ if gt (len $installList) 5 }}{{ $topInstalls = slice $installList 0 5 }}{{ end }} {{ range $install := $topInstalls }} {{ $installID := dig "id" "—" $install }} {{ $installName := dig "name" "—" $install }} {{ $runnerStatus := dig "runner_status" "" $install }} {{ $sandboxStatus := dig "sandbox_status" "" $install }} {{ $componentStatus := dig "component_status" "" $install }} {{ $themeMap := dict "active" "success" "healthy" "success" "finished" "success" "ready" "success" "failed" "error" "error" "error" "unhealthy" "error" "pending" "warn" "queued" "warn" "in_progress" "info" "deprovisioned" "neutral" "unknown" "neutral" }}
Name Status Updated Details
{{ $installName }}
{{ $installID }}
{{ if $runnerStatus }}{{ end }}{{ if $sandboxStatus }}{{ end }}{{ if $componentStatus }}{{ end }}
{{ with dig "updated_at" "" $install }}{{ else }}—{{ end }} {{ $appID := dig "app_id" "" $install }}{{ $appName := dig $appID "" $appsByID }} {{ $orgID := dig "org_id" "" $install }}{{ $orgName := dig $orgID "" $installOrgsByID }}
Field Value
Name {{ $installName }}
ID {{ $installID }}
Runner Status {{ if $runnerStatus }}{{ else }}—{{ end }}
Sandbox Status {{ if $sandboxStatus }}{{ else }}—{{ end }}
Components Status {{ if $componentStatus }}{{ else }}—{{ end }}
App {{ if $appName }}{{ $appName }}{{ else }}—{{ end }}
App ID {{ default "—" $appID }}
Org {{ if $orgName }}{{ $orgName }}{{ else }}—{{ end }}
Org ID {{ default "—" $orgID }}
Created At {{ with dig "created_at" "" $install }}{{ else }}—{{ end }}
Updated At {{ with dig "updated_at" "" $install }}{{ else }}—{{ end }}
  </td>
</tr>

{{ end }}

{{ else }}

No installs reported.

{{ end }}

Runners

See more →{{ with dig "updated_at" "" $runnersOutputs }}Last updated {{ end }}

{{ $runners := dig "runners" (dict) $runnersSteps }} {{ $ownerNames := dict }} {{ range $, $i := (dig "installs" (dict) $installsSteps) }}{{ $ownerNames = set $ownerNames (dig "id" "" $i) (dig "name" "" $i) }}{{ end }} {{ range $, $o := (dig "orgs" (dict) $orgsSteps) }}{{ $ownerNames = set $ownerNames (dig "id" "" $o) (dig "name" "" $o) }}{{ end }} {{ range $_, $a := (dig "apps" (dict) $appsSteps) }}{{ $ownerNames = set $ownerNames (dig "id" "" $a) (dig "name" "" $a) }}{{ end }} {{ $runnerList := values $runners }} {{ if gt (len $runnerList) 0 }}

{{ $topRunners := $runnerList }}{{ if gt (len $runnerList) 5 }}{{ $topRunners = slice $runnerList 0 5 }}{{ end }} {{ range $runner := $topRunners }} {{ $status := dig "status" "" $runner }} {{ $ownerID := dig "owner_id" "" $runner }} {{ $ownerName := dig $ownerID "" $ownerNames }} {{ $ownerLabel := $ownerName }}{{ if not $ownerLabel }}{{ $ownerLabel = default "—" $ownerID }}{{ end }} {{ $runnerID := dig "id" "—" $runner }}
Owner Healthcheck Heartbeat Details
{{ $ownerLabel }}
{{ $runnerID }}
{{ with dig "latest_health_check_status" "" $runner }}{{ else }}—{{ end }} {{ with dig "latest_heart_beat_created_at" "" $runner }}{{ else }}—{{ end }}

{{ $processes := default (list) (dig "process_uptimes" nil $runner) }}

Field Value
Status
Owner {{ $ownerLabel }}
Owner ID {{ $ownerID }}
Type {{ dig "type" "—" $runner }}
Platform {{ dig "platform" "—" $runner }}
Image {{ dig "image" "—" $runner }}:{{ dig "tag" "—" $runner }}
Runner ID {{ $runnerID }}
Latest Heartbeat {{ with dig "latest_heart_beat_created_at" "" $runner }}{{ else }}—{{ end }}
Latest Heartbeat Version {{ with dig "latest_heart_beat_version" "" $runner }}{{ . }}{{ else }}—{{ end }}
Latest Healthcheck {{ with dig "latest_health_check_created_at" "" $runner }}{{ else }}—{{ end }}
Latest Healthcheck Status {{ with dig "latest_health_check_status" "" $runner }}{{ else }}—{{ end }}

{{ if gt (len $processes) 0 }}

Processes

{{ range $p := $processes }} {{ end }}
Type Status Started At Uptime ID
{{ dig "type" "—" $p }} {{ with dig "status" "" $p }}{{ else }}—{{ end }} {{ with dig "started_at" "" $p }}{{ else }}—{{ end }} {{ with dig "uptime" 0 $p }}{{ (div (int64 .) 1000000000) | int64 | duration }}{{ else }}—{{ end }} {{ dig "id" "—" $p }}

{{ end }}

  </td>
</tr>

{{ end }}

{{ else }}

No runners reported.

{{ end }}

{{ $api := dict }}{{ $apiActionID := "" }}{{ with index .nuon.actions.workflows "api_status" }}{{ with .outputs }}{{ $api = . }}{{ end }}{{ $apiActionID = dig "id" "" . }}{{ end }} {{ $dash := dict }}{{ $dashActionID := "" }}{{ with index .nuon.actions.workflows "dashboard_status" }}{{ with .outputs }}{{ $dash = . }}{{ end }}{{ $dashActionID = dig "id" "" . }}{{ end }} {{ $apiSteps := dig "steps" (dict) $api }} {{ $dashSteps := dig "steps" (dict) $dash }}

API

See more →{{ with dig "updated_at" "" $api }}Last updated {{ end }}

{{ range $step := list "alb-healthcheck-ctl-api-public" "alb-healthcheck-ctl-api-admin" "alb-healthcheck-ctl-api-runner" }}{{ $indicator := dig $step "indicator" "" $apiSteps }}{{ if eq $indicator "🟢" }}{{ else if eq $indicator "🔴" }}{{ else }}{{ end }}{{ end }}<nuon-label-badge label="version:{{ dig "ctl_api_version" "unknown" $api }}"><nuon-label-badge label="git:{{ dig "ctl_api_git_ref" "unknown" $api }}">Open ↗

{{ if not (dig "updated_at" "" $api) }}Waiting on api_status. Run it to populate this section.{{ end }}

Dashboard

See more →{{ with dig "updated_at" "" $dash }}Last updated {{ end }}

{{ $indicator := dig "alb-healthcheck-dashboard-ui" "indicator" "" $dashSteps }}{{ if eq $indicator "🟢" }}{{ else if eq $indicator "🔴" }}{{ else }}{{ end }}<nuon-label-badge label="version:{{ dig "dashboard_ui_version" "unknown" $dash }}"><nuon-label-badge label="git:{{ dig "dashboard_ui_git_ref" "unknown" $dash }}">Open ↗

{{ if not (dig "updated_at" "" $dash) }}Waiting on dashboard_status. Run it to populate this section.{{ end }}

{{ $migAction := default dict (index (default dict .nuon.actions.workflows) "inspect_migrations") }} {{ $migOutputs := default dict (dig "outputs" dict $migAction) }} {{ $migSteps := dig "steps" dict $migOutputs }} {{ $migrations := dig "migrations" (dict) $migSteps }}

Migrations

See more →{{ with dig "updated_at" "" $migOutputs }}Last updated {{ end }}

{{ if gt (len $migrations) 0 }} {{ $themeMap := dict "applied" "success" "in_progress" "info" "error" "error" "unknown" "neutral" }}

{{ range $_, $m := $migrations }} {{ $status := dig "status" "" $m }} {{ end }}
Name Status Created
{{ dig "name" "—" $m }}
{{ dig "id" "—" $m }}
{{ if $status }}{{ else }}—{{ end }} {{ with dig "created_at" "" $m }}{{ else }}—{{ end }}

{{ else if not (dig "updated_at" "" $migOutputs) }}Waiting on inspect_migrations. Run it to populate this section.{{ else }}No migrations reported.{{ end }}

{{ $stackStatus := dig "status" "" .nuon.install_stack }} {{ $stackOutputs := default dict .nuon.install_stack.outputs }}

Status {{ if $stackStatus }}{{ else }}—{{ end }}
Cloud AWS
Account {{ dig "account_id" "—" $stackOutputs }}
Region {{ default "—" .nuon.cloud_account.aws.region }}
VPC {{ dig "vpc_id" "—" $stackOutputs }}

{{ $sandboxStatus := dig "status" "" .nuon.sandbox }} {{ $cluster := dig "outputs" "cluster" (dict) .nuon.sandbox }}

Status {{ if $sandboxStatus }}{{ else }}—{{ end }}
Name {{ dig "name" "—" $cluster }}
Version {{ coalesce (dig "version" nil $cluster) (dig "platform_version" nil $cluster) "—" }}
Endpoint {{ with dig "endpoint" "" $cluster }}{{ . }}{{ else }}—{{ end }}
ARN {{ with dig "arn" "" $cluster }}{{ . }}{{ else }}—{{ end }}

{{ $dbAction := default dict (index (default dict .nuon.actions.workflows) "inspect_postgres") }} {{ $dbOutputs := default dict (dig "outputs" dict $dbAction) }} {{ $databases := dig "databases" (dict) (dig "steps" dict $dbOutputs) }} {{ $chAction := default dict (index (default dict .nuon.actions.workflows) "inspect_clickhouse") }} {{ $chOutputs := default dict (dig "outputs" dict $chAction) }} {{ $clickhouse := dig "clickhouse" (dict) (dig "steps" dict $chOutputs) }}

Databases

See more →{{ with dig "updated_at" "" $dbOutputs }}Last updated {{ end }}

{{ if gt (len $databases) 0 }}

{{ range $label, $r := $databases }} {{ end }}
Postgres CPU Mem Disk DB load
{{ $label }} {{ $v := dig "cpu_pct" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}%{{ end }} {{ $v := dig "mem_used_pct" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}%{{ end }} {{ $v := dig "disk_used_pct" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}%{{ end }} {{ $v := dig "db_load" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}{{ end }}

{{ end }}

{{ if gt (len $clickhouse) 0 }}

{{ range $label, $r := $clickhouse }} {{ end }}
ClickHouse CPU Mem Disk
{{ $label }} {{ $v := dig "cpu_pct" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}%{{ end }} {{ $v := dig "mem_used_pct" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}%{{ end }} {{ $v := dig "disk_used_pct" nil $r }}{{ if kindIs "invalid" $v }}—{{ else }}{{ $v }}%{{ end }}

{{ end }}

{{ if and (eq (len $databases) 0) (eq (len $clickhouse) 0) }}

Run inspect_databases to populate this section.

{{ end }}