Skip to content

Commit b182a9d

Browse files
authored
Merge pull request #799 from jshufro/jms/install
Change install commands to use local assets instead of downloading from github
2 parents b36f537 + f987c0f commit b182a9d

53 files changed

Lines changed: 2855 additions & 128 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

rocketpool-cli/service/commands.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package service
22

33
import (
44
"fmt"
5+
"os"
56
"strings"
67

78
"github.com/urfave/cli"
@@ -131,7 +132,6 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
131132
cli.StringFlag{
132133
Name: "version, v",
133134
Usage: "The smart node package version to install",
134-
Value: fmt.Sprintf("v%s", shared.RocketPoolVersion),
135135
},
136136
},
137137
Action: func(c *cli.Context) error {
@@ -141,6 +141,11 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
141141
return err
142142
}
143143

144+
if c.String("version") != "" {
145+
fmt.Fprintf(os.Stderr, "--version/-v is no longer supported. Instead, download the correct version of the `rocketpool` binary and install that. Current version: %s\n", shared.RocketPoolVersion)
146+
os.Exit(1)
147+
}
148+
144149
// Run command
145150
return installService(c)
146151

@@ -417,8 +422,7 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
417422
},
418423
cli.StringFlag{
419424
Name: "version, v",
420-
Usage: "The update tracker package version to install",
421-
Value: fmt.Sprintf("v%s", shared.RocketPoolVersion),
425+
Usage: "DEPRECATED: The update tracker package version to install",
422426
},
423427
},
424428
Action: func(c *cli.Context) error {
@@ -428,6 +432,11 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
428432
return err
429433
}
430434

435+
if c.String("version") != "" {
436+
fmt.Fprintf(os.Stderr, "--version/-v is no longer supported. Instead, download the correct version of the `rocketpool` binary and install the update tracker from there. Current version: %s\n", shared.RocketPoolVersion)
437+
os.Exit(1)
438+
}
439+
431440
// Run command
432441
return installUpdateTracker(c)
433442

rocketpool-cli/service/service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func installService(c *cli.Context) error {
5858

5959
// Prompt for confirmation
6060
if !(c.Bool("yes") || prompt.Confirm(fmt.Sprintf(
61-
"The Rocket Pool service will be installed --Version: %s\n\n%sIf you're upgrading, your existing configuration will be backed up and preserved.\nAll of your previous settings will be migrated automatically.%s\nAre you sure you want to continue?",
62-
c.String("version"), colorGreen, colorReset,
61+
"The Rocket Pool %s service will be installed.\n\n%sIf you're upgrading, your existing configuration will be backed up and preserved.\nAll of your previous settings will be migrated automatically.%s\nAre you sure you want to continue?",
62+
shared.RocketPoolVersion, colorGreen, colorReset,
6363
))) {
6464
fmt.Println("Cancelled.")
6565
return nil
@@ -83,7 +83,7 @@ func installService(c *cli.Context) error {
8383
}
8484

8585
// Install service
86-
err = rp.InstallService(c.Bool("verbose"), c.Bool("no-deps"), c.String("version"), c.String("path"), dataPath)
86+
err = rp.InstallService(c.Bool("verbose"), c.Bool("no-deps"), c.String("path"), dataPath)
8787
if err != nil {
8888
return err
8989
}
@@ -150,7 +150,7 @@ func installUpdateTracker(c *cli.Context) error {
150150
defer rp.Close()
151151

152152
// Install service
153-
err := rp.InstallUpdateTracker(c.Bool("verbose"), c.String("version"))
153+
err := rp.InstallUpdateTracker(c.Bool("verbose"))
154154
if err != nil {
155155
return err
156156
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package assets
2+
3+
import (
4+
"embed"
5+
"io/fs"
6+
)
7+
8+
// the all: prefix is used because there are hidden files in the install directory
9+
//
10+
//go:embed all:install
11+
var installFS embed.FS
12+
13+
//go:embed rp-update-tracker
14+
var rpUpdateTrackerFS embed.FS
15+
16+
//go:embed scripts/install.sh
17+
var installScript []byte
18+
19+
//go:embed scripts/install-update-tracker.sh
20+
var installUpdateTrackerScript []byte
21+
22+
type ScriptWithContext struct {
23+
Script []byte
24+
Context fs.FS
25+
}
26+
27+
func InstallScript() ScriptWithContext {
28+
return ScriptWithContext{Script: installScript, Context: installFS}
29+
}
30+
31+
func InstallUpdateTrackerScript() ScriptWithContext {
32+
return ScriptWithContext{Script: installUpdateTrackerScript, Context: rpUpdateTrackerFS}
33+
}

shared/services/rocketpool/assets/install/addons/gww/.ignoreme

Whitespace-only changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Autogenerated - DO NOT MODIFY THIS FILE DIRECTLY
2+
3+
global:
4+
# ResolveTimeout is the default value used by alertmanager if the alert does
5+
# not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated.
6+
# This has no impact on alerts from Prometheus, as they always include EndsAt.
7+
# default = 5m
8+
resolve_timeout: 5m
9+
10+
route:
11+
# The labels by which incoming alerts are grouped together.
12+
group_by: ["alertname"]
13+
# How long to initially wait to send a notification for a group
14+
# of alerts. Allows to wait for an inhibiting alert to arrive or collect
15+
# more initial alerts for the same group.
16+
group_wait: 30s
17+
# How long to wait before sending a notification about new alerts that
18+
# are added to a group of alerts for which an initial notification has
19+
# already been sent. (Usually ~5m or more.)
20+
group_interval: 5m
21+
# How long to wait before sending a notification again if it has already been sent successfully for an alert.
22+
repeat_interval: 4h
23+
routes:
24+
# severity=info: Don't send the follow-up resolved notification.
25+
- match:
26+
severity: info
27+
continue: false
28+
# The notification destination
29+
receiver: "node_operator_no_resolved"
30+
# all other alerts get sent notifications for the initial firing _and_ resolved notifications.
31+
- receiver: "node_operator_default"
32+
#match: We want this to match all alerts (severity=info is frist though so it will stop)
33+
34+
# The notification destination
35+
receiver: "node_operator_default"
36+
37+
receivers:
38+
- name: "node_operator_default"
39+
{{- if .DiscordWebhookURL.Value }}
40+
discord_configs:
41+
- webhook_url: "{{ .DiscordWebhookURL.Value }}"
42+
{{- end }}
43+
44+
- name: "node_operator_no_resolved"
45+
{{- if .DiscordWebhookURL.Value }}
46+
discord_configs:
47+
- webhook_url: "{{ .DiscordWebhookURL.Value }}"
48+
send_resolved: false
49+
{{- end }}
50+
51+
inhibit_rules:
52+
# Inhibit rules mute a new alert (target) that matches an existing alert (source).
53+
- source_match:
54+
# if the existing alert (source) is severity=critical
55+
severity: "critical"
56+
target_match:
57+
# and the new alert (target) is severity=warning
58+
severity: "warning"
59+
# and the alertname, job, and instance labels have the same value
60+
equal: ["alertname", "job", "instance"]
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Autogenerated - DO NOT MODIFY THIS FILE DIRECTLY If you want to overwrite some
2+
# of these values with your own customizations, please disable the alerts in the
3+
# TUI and then add your own fule files to the <rocketpool-root>/alerting/rules
4+
# directory.
5+
#
6+
# NOTE: This file uses non-default go template delimiters (triple braces) to avoid
7+
# conflicts with the default delimiters used in the alerting rules.
8+
9+
groups:
10+
- name: NodeOperator
11+
rules:
12+
{{{- if .AlertEnabled_ClientSyncStatusBeacon.Value }}}
13+
- alert: ClientSyncStatusBeacon
14+
expr: rocketpool_node_sync_progress{client="beacon"} < 1.0
15+
for: 5m
16+
labels:
17+
severity: critical
18+
annotations:
19+
summary: "The beacon client is not synced"
20+
{{{- end }}}
21+
22+
{{{- if .AlertEnabled_ClientSyncStatusExecution.Value }}}
23+
- alert: ClientSyncStatusExecution
24+
expr: rocketpool_node_sync_progress{client="execution"} < 1.0
25+
for: 5m
26+
labels:
27+
severity: critical
28+
annotations:
29+
summary: "The execution client is not synced"
30+
{{{- end }}}
31+
32+
{{{- if .AlertEnabled_UpcomingSyncCommittee.Value }}}
33+
- alert: UpcomingSyncCommittee
34+
expr: rocketpool_beacon_upcoming_sync_committee > 0
35+
labels:
36+
severity: warning
37+
job: validator
38+
annotations:
39+
summary: "Your Rocket Pool node is about to become part of a sync committee"
40+
description: |
41+
If you were planning on doing maintenance to your node, **you should wait until the sync committee is over**. Not only are they worth an **extremely** large amount of ETH, but if you miss attestations during a sync committee, you **lose an extremely large amount of ETH** instead!
42+
You should be online as long as possible while you are in a sync committee.
43+
{{{- end }}}
44+
45+
{{{- if .AlertEnabled_ActiveSyncCommittee.Value }}}
46+
- alert: ActiveSyncCommittee
47+
expr: rocketpool_beacon_active_sync_committee > 0
48+
labels:
49+
severity: warning
50+
job: validator
51+
annotations:
52+
summary: "Your Rocket Pool node is part of a sync committee"
53+
description: |
54+
If you were planning on doing maintenance to your node, **you should wait until the sync committee is over**. Not only are they worth an **extremely** large amount of ETH, but if you miss attestations during a sync committee, you **lose an extremely large amount of ETH** instead!
55+
You should be online as long as possible while you are in a sync committee.
56+
{{{- end }}}
57+
58+
{{{- if .AlertEnabled_UpcomingProposal.Value }}}
59+
- alert: UpcomingProposal
60+
expr: rocketpool_beacon_upcoming_proposals > 0
61+
labels:
62+
severity: warning
63+
job: validator
64+
annotations:
65+
summary: "Your Rocket Pool node is about to propose a block"
66+
description: |
67+
You have {{ $value }} block proposals coming up in the next few minutes. If you were planning on taking your node down for maintenance, you should wait until after the proposals because they're worth a lot of ETH!
68+
{{{- end }}}
69+
70+
{{{- if .AlertEnabled_RecentProposal.Value }}}
71+
- alert: RecentProposal
72+
expr: rocketpool_beacon_recent_proposals > 0
73+
# note: 384s = 12s slot time * 32 slots per epoch: This should prevent the alert from refiring during a single epoch
74+
for: 384s
75+
labels:
76+
severity: info
77+
job: validator
78+
annotations:
79+
summary: "Your Rocket Pool node proposed a block"
80+
description: |
81+
Your node proposed {{ $value }} blocks a recent epoch.
82+
{{{- end }}}
83+
84+
{{{- if .AlertEnabled_LowDiskSpaceWarning.Value }}}
85+
- alert: LowDiskSpaceWarning
86+
expr: node_filesystem_avail_bytes{job="node", mountpoint="/"} / 1024^3 < 200
87+
labels:
88+
severity: warning
89+
job: node
90+
annotations:
91+
summary: "Device {{ $labels.device }} on instance {{ $labels.instance }} is getting low on disk space"
92+
description: "{{ $labels.instance }} has low disk space. Currently has {{ humanize $value }} GB free."
93+
{{{- end }}}
94+
95+
{{{- if .AlertEnabled_LowDiskSpaceCritical.Value }}}
96+
- alert: LowDiskSpaceCritical
97+
# NOTE: 50GB taken from PruneFreeSpaceRequired in rocketpool-cli's nethermind pruning (it won't prune below 50GB)
98+
expr: node_filesystem_avail_bytes{job="node", mountpoint="/"} / 1024^3 < 50
99+
labels:
100+
severity: critical
101+
job: node
102+
annotations:
103+
summary: "Device {{ $labels.device }} on instance {{ $labels.instance }} has critically low disk space"
104+
description: "{{ $labels.instance }} has critically low disk space. Currently has {{ humanize $value }} GB free."
105+
{{{- end }}}
106+
107+
{{{- if .AlertEnabled_OSUpdatesAvailable.Value }}}
108+
- alert: OSUpdatesAvailable
109+
expr: max(os_upgrades_pending{job="node"}) > 0
110+
labels:
111+
severity: warning
112+
job: node
113+
annotations:
114+
summary: "Rocket Pool OS Updates Available"
115+
description: |
116+
There are updates available for your OS that haven't been applied yet. You should update your OS.
117+
For more information on updating see the documentation at https://docs.rocketpool.net/guides/node/updates#updating-your-operating-system
118+
{{{- end }}}
119+
120+
{{{- if .AlertEnabled_RPUpdatesAvailable.Value }}}
121+
- alert: RPUpdatesAvailable
122+
expr: max(rocketpool_version_update{job="node"}) > 0
123+
labels:
124+
severity: warning
125+
job: node
126+
annotations:
127+
summary: "Rocket Pool Smartnode Update Available"
128+
description: |
129+
There are updates available for the Rocket Pool Smartnode that haven't been applied yet. You should update the smartnode stack.
130+
For more information on updating see the documentation at https://docs.rocketpool.net/guides/node/updates#updating-the-smartnode-stack
131+
{{{- end }}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: 1
2+
3+
deleteDatasources:
4+
- name: Prometheus
5+
orgId: 1
6+
7+
datasources:
8+
- name: Prometheus
9+
type: prometheus
10+
access: proxy
11+
orgId: 1
12+
url: http://prometheus:9091
13+
basicAuth: false
14+
isDefault: true
15+
version: 1
16+
editable: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enter your own customizations for the Graffiti Wall Addon container here. These changes will persist after upgrades, so you only need to do them once.
2+
#
3+
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration
4+
# for more information on overriding specific parameters of docker-compose files.
5+
6+
services:
7+
addon_gww:
8+
x-rp-comment: Add your customizations below this line
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enter your own customizations for the alertmanager container here. These changes will persist after upgrades, so you only need to do them once.
2+
#
3+
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration
4+
# for more information on overriding specific parameters of docker-compose files.
5+
6+
services:
7+
alertmanager:
8+
x-rp-comment: Add your customizations below this line
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enter your own customizations for the API container here. These changes will persist after upgrades, so you only need to do them once.
2+
#
3+
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration
4+
# for more information on overriding specific parameters of docker-compose files.
5+
6+
services:
7+
api:
8+
x-rp-comment: Add your customizations below this line

0 commit comments

Comments
 (0)