Skip to content

Commit

Permalink
Use paths that work on OSX and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jshufro committed Aug 29, 2024
1 parent b2b340e commit 6e7c684
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions install/deploy/templates/eth1.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
ports: [ "{{$p2p}}:{{$p2p}}/udp", "{{$p2p}}:{{$p2p}}/tcp"{{.GetEcOpenApiPorts}} ]
volumes:
- {{.ExecutionClientDataVolume}}:/ethclient
- /usr/share/rocketpool/scripts:/usr/share/rocketpool/scripts:ro
- /opt/rocketpool/scripts:/opt/rocketpool/scripts:ro
- /var/lib/rocketpool/data/{{.ProjectName}}:/secrets
networks:
- net
Expand Down Expand Up @@ -49,7 +49,7 @@ services:
- RP_GETH_ARCHIVE_MODE={{.LocalExecutionClient.Geth.ArchiveMode}}
{{- end}}
entrypoint: sh
command: "/usr/share/rocketpool/scripts/{{.GetEcStartScript}}"
command: "/opt/rocketpool/scripts/{{.GetEcStartScript}}"
cap_drop:
- all
cap_add:
Expand Down
4 changes: 2 additions & 2 deletions install/deploy/templates/eth2.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
{{- end}}
volumes:
- {{.BeaconNodeDataVolume}}:/ethclient
- /usr/share/rocketpool/scripts:/usr/share/rocketpool/scripts:ro
- /opt/rocketpool/scripts:/opt/rocketpool/scripts:ro
- /var/lib/rocketpool/data/{{.ProjectName}}:/secrets:ro
networks:
- net
Expand Down Expand Up @@ -61,7 +61,7 @@ services:
- BN_P2P_QUIC_PORT={{.LocalBeaconClient.Lighthouse.P2pQuicPort}}
{{- end}}
entrypoint: sh
command: "/usr/share/rocketpool/scripts/{{.GetBnStartScript}}"
command: "/opt/rocketpool/scripts/{{.GetBnStartScript}}"
cap_drop:
- all
cap_add:
Expand Down
4 changes: 2 additions & 2 deletions install/deploy/templates/mev-boost.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ services:
restart: unless-stopped
ports: [{{.GetMevBoostOpenPorts}}]
volumes:
- /usr/share/rocketpool/scripts:/usr/share/rocketpool/scripts:ro
- /opt/rocketpool/scripts:/opt/rocketpool/scripts:ro
networks:
- net
environment:
- NETWORK={{.Network}}
- MEV_BOOST_PORT={{.MevBoost.Port}}
- MEV_BOOST_RELAYS={{.MevBoost.GetRelayString}}
entrypoint: sh
command: "/usr/share/rocketpool/scripts/{{.GetMevBoostStartScript}}"
command: "/opt/rocketpool/scripts/{{.GetMevBoostStartScript}}"
cap_drop:
- all
cap_add:
Expand Down
4 changes: 2 additions & 2 deletions install/deploy/templates/validator.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
restart: unless-stopped
stop_grace_period: 3m
volumes:
- /usr/share/rocketpool/scripts:/usr/share/rocketpool/scripts:ro
- /opt/rocketpool/scripts:/opt/rocketpool/scripts:ro
- {{.GetValidatorsFolderPath}}:{{.GetValidatorsFolderPath}}
- {{.GetAddonsFolderPath}}:{{.GetAddonsFolderPath}}
networks:
Expand Down Expand Up @@ -45,7 +45,7 @@ services:
- TEKU_SHUT_DOWN_WHEN_SLASHED={{.ValidatorClient.Teku.UseSlashingProtection}}
{{- end}}
entrypoint: sh
command: "/usr/share/rocketpool/scripts/{{.GetVcStartScript}}"
command: "/opt/rocketpool/scripts/{{.GetVcStartScript}}"
cap_drop:
- all
cap_add:
Expand Down
15 changes: 7 additions & 8 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,11 @@ install() {
fi

# Create rocket pool dir & files
RP_BIN_PATH=/usr/bin/rocketpool
RP_SHARE_PATH=/usr/share/rocketpool
RP_SYS_PATH=/opt/rocketpool
RP_VAR_PATH=/var/lib/rocketpool

progress 4 "Creating Rocket Pool directory structure..."
{ mkdir -p "$RP_SHARE_PATH" || fail "Could not create the Rocket Pool resources directory."; } >&2
{ mkdir -p "$RP_SYS_PATH" || fail "Could not create the Rocket Pool resources directory."; } >&2
{ mkdir -p "$RP_VAR_PATH/data" || fail "Could not create the Rocket Pool system data directory."; } >&2
{ chmod 0700 "$RP_VAR_PATH/data" || fail "Could not set the Rocket Pool data directory permissions."; } >&2

Expand All @@ -359,11 +358,11 @@ install() {

# Copy package files
progress 6 "Copying package files to Rocket Pool system directory..."
{ cp -r "$PACKAGE_FILES_PATH/addons" "$RP_SHARE_PATH" || fail "Could not copy addons folder to the Rocket Pool system directory."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/override" "$RP_SHARE_PATH" || fail "Could not copy override folder to the Rocket Pool system directory."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/scripts" "$RP_SHARE_PATH" || fail "Could not copy scripts folder to the Rocket Pool system directory."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/templates" "$RP_SHARE_PATH" || fail "Could not copy templates folder to the Rocket Pool system directory."; } >&2
{ find "$RP_SHARE_PATH/scripts" -name "*.sh" -exec chmod +x {} \; 2>/dev/null || fail "Could not set executable permissions on package files."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/addons" "$RP_SYS_PATH" || fail "Could not copy addons folder to the Rocket Pool system directory."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/override" "$RP_SYS_PATH" || fail "Could not copy override folder to the Rocket Pool system directory."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/scripts" "$RP_SYS_PATH" || fail "Could not copy scripts folder to the Rocket Pool system directory."; } >&2
{ cp -r "$PACKAGE_FILES_PATH/templates" "$RP_SYS_PATH" || fail "Could not copy templates folder to the Rocket Pool system directory."; } >&2
{ find "$RP_SYS_PATH/scripts" -name "*.sh" -exec chmod +x {} \; 2>/dev/null || fail "Could not set executable permissions on package files."; } >&2


# Clean up unnecessary files from old installations
Expand Down
6 changes: 3 additions & 3 deletions install/packages/debian/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ override_dh_auto_install:
# Create the folder structure and copy the deploy files over
install -dm 0700 debian/rocketpool/var/lib/rocketpool/data
install -dm 0700 debian/rocketpool/var/lib/rocketpool/global
mkdir -p debian/rocketpool/usr/share/rocketpool/
cp -r deploy/* debian/rocketpool/usr/share/rocketpool/
chmod -R +x debian/rocketpool/usr/share/rocketpool/scripts
mkdir -p debian/rocketpool/opt/rocketpool/
cp -r deploy/* debian/rocketpool/opt/rocketpool/
chmod -R +x debian/rocketpool/opt/rocketpool/scripts

override_dh_auto_test:
8 changes: 4 additions & 4 deletions rocketpool-cli/client/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
)

const (
templatesDir string = "/usr/share/rocketpool/templates"
addonsSourceDir string = "/usr/share/rocketpool/addons"
overrideSourceDir string = "/usr/share/rocketpool/override"
nativeScriptsSourceDir string = "/usr/share/rocketpool/scripts/native"
templatesDir string = "/opt/rocketpool/templates"
addonsSourceDir string = "/opt/rocketpool/addons"
overrideSourceDir string = "/opt/rocketpool/override"
nativeScriptsSourceDir string = "/opt/rocketpool/scripts/native"
overrideDir string = "override"
runtimeDir string = "runtime"
extraScrapeJobsDir string = "extra-scrape-jobs"
Expand Down
4 changes: 2 additions & 2 deletions v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NOTE: for actual installation instructions, please see the [section below](#inst
- The Smart Node now comes in a `.deb` package, so users running Debian or Debian-derivative distributions can now install it via `sudo apt install rocketpool` and update it via `sudo apt update && sudo apt dist-upgrade` once the Rocket Pool repository is set up.
- Packages for other distributions, such as RHEL or Fedora, will be introduced at a later date.
- For now, users not on Debian-based systems can install via the traditional `rocketpool service install` command. It will still pull the necessary files from GitHub as it did before.
- Installation no longer puts all core system files into your `~/.rocketpool` directory. System files (such as Docker compose templates and execution scripts) are now put into `/usr/share/rocketpool`. The CLI binary is now installed to `/usr/bin/rocketpool`.
- Installation no longer puts all core system files into your `~/.rocketpool` directory. System files (such as Docker compose templates and execution scripts) are now put into `/opt/rocketpool`. The CLI binary is now installed to `/usr/bin/rocketpool`.
- Runtime files, such as your Docker compose overrides and logging, are still put into `~/.rocketpool` by default.
- Installation via the CLI can optionally now be done with local install scripts and packages on your filesystem instead of needing to reach out to GitHub. This is helpful in places where GitHub can't be accessed.
- (*For developers*) The old `smartnode-install` repository has been migrated into the `smartnode` repository.
Expand Down Expand Up @@ -264,7 +264,7 @@ Running the Smart Node is, for all practical purposes, the same as it was in `v1
- Use `rocketpool service node-logs api` to view the new API logs
- Use `rocketpool service node-logs tasks` to view the node task loop logs (previously `rocketpool service logs node`)
- Use `rocketpool service node-logs watchtower` to view the watchtower task loop logs (`rocketpool service logs watchtower`)
- The "non-modifiable" files like Docker compose templates and scripts are now in `/usr/share/rocketpool` instead of your user home directory (though personal files like overrides are still in your home directory)
- The "non-modifiable" files like Docker compose templates and scripts are now in `/opt/rocketpool` instead of your user home directory (though personal files like overrides are still in your home directory)
- The CLI (if installed via the package manager) is now at `/usr/bin/rocketpool` instead of `~/bin/rocketpool`
- Some CLI commands have moved and/or have new flags (see the overview section above)
- Commands that involve selecting multiple items (such as distributing minipool balances) will now let you select arbitrary options, and submit all of the transactions at once. The overall flow will feel much faster.
Expand Down

0 comments on commit 6e7c684

Please sign in to comment.