This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation and scripts to explain the provisioning of a stable hosted `upstream-seed`. Fixes #2620. Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
- Loading branch information
1 parent
238fa1d
commit a05b9b4
Showing
10 changed files
with
175 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Upstream Seed Node infrastructure | ||
|
||
Provides a GCP instance `seed-node-2` running `upstream-seed` in the cloud. The | ||
Upstream team uses the seed to collaborate. | ||
|
||
The peer address is `hydyq6xmgp3amt44z41n6cbods1osx73j5z6fky5xx4yx33afycyfc@34.88.37.244:8776`. | ||
|
||
## Configuration | ||
|
||
The list of projects the seed node tracks is set in `/etc/upstream-seed.env`. | ||
|
||
## Logging | ||
|
||
You can find logs for the seed [here](https://cloudlogging.app.goo.gl/AEcmLeCyix5iY4AY8). | ||
|
||
## Update the binary | ||
|
||
You can update the `upstream-seed` binary to the latest build of the `main` | ||
branch by running | ||
|
||
```bash | ||
/home/ubuntu/radicle-upstream/infa/seed-node/update-upstream-seed.sh | ||
``` | ||
|
||
The script accepts a commit hash as an optional argument. If provided, it | ||
downloads the binary build for the given commit hash. | ||
|
||
## Setup | ||
|
||
To setup the instance, first log into the instance. | ||
|
||
```bash | ||
gcloud compute ssh ubuntu@seed-node-2 --zone=europe-north1-a | ||
``` | ||
|
||
Then run the following commands | ||
|
||
```bash | ||
git clone https://github.com/radicle-dev/radicle-upstream | ||
cd radicle-upstream | ||
sudo infra/seed-node/setup.sh | ||
``` | ||
|
||
The setup script can be re-run at a later point to upgrade the deployment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# <== Enter custom agent configurations in this file. | ||
# See https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/configuration | ||
# for more details. | ||
logging: | ||
receivers: | ||
journald: | ||
type: systemd_journald | ||
processors: | ||
journald-json: | ||
type: parse_json | ||
field: MESSAGE | ||
service: | ||
log_level: error | ||
pipelines: | ||
default_pipeline: | ||
receivers: [journald] | ||
processors: [journald-json] | ||
metrics: | ||
service: | ||
log_level: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright © 2021 The Radicle Upstream Contributors | ||
# | ||
# This file is part of radicle-upstream, distributed under the GPLv3 | ||
# with Radicle Linking Exception. For full terms see the included | ||
# LICENSE file. | ||
|
||
set -euo pipefail | ||
|
||
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh | ||
sudo bash add-google-cloud-ops-agent-repo.sh --also-install | ||
|
||
ln -sf "$(pwd)/infra/seed-node/google-cloud-ops-agent-config.yaml" /etc/google-cloud-ops-agent/config.yaml | ||
systemctl restart "google-cloud-ops-agent*" | ||
|
||
mkdir -p /var/local/upstream-seed | ||
chown 1000:1000 /var/local/upstream-seed | ||
|
||
if [[ ! -f /etc/upstream-seed.env ]]; then | ||
cp "$(pwd)/infra/seed-node/upstream-seed.env" /etc | ||
fi | ||
|
||
ln -sf "$(pwd)/infra/seed-node/upstream-seed.service" /etc/systemd/system/ | ||
systemctl daemon-reload | ||
systemctl enable upstream-seed | ||
systemctl stop upstream-seed | ||
|
||
curl -fsSL \ | ||
https://storage.googleapis.com/radicle-upstream-build-artifacts/v1/main/x86_64-linux/upstream-seed \ | ||
-o /usr/local/bin/upstream-seed | ||
chmod +x /usr/local/bin/upstream-seed | ||
|
||
systemctl start upstream-seed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright © 2021 The Radicle Upstream Contributors | ||
# | ||
# This file is part of radicle-upstream, distributed under the GPLv3 | ||
# with Radicle Linking Exception. For full terms see the included | ||
# LICENSE file. | ||
|
||
set -euo pipefail | ||
|
||
if [[ -n "${1:-}" ]]; then | ||
path="by-commit/${1}" | ||
else | ||
path="main" | ||
fi | ||
|
||
systemctl stop upstream-seed | ||
curl -fsSL \ | ||
"https://storage.googleapis.com/radicle-upstream-build-artifacts/v1/${path}/x86_64-linux/upstream-seed" \ | ||
-o /usr/local/bin/upstream-seed | ||
chmod +x /usr/local/bin/upstream-seed | ||
|
||
systemctl start upstream-seed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Comma-separated list of projects to track | ||
PROJECTS="rad:git:hnrk8ueib11sen1g9n1xbt71qdns9n4gipw1o" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Upstream seed node | ||
|
||
[Service] | ||
ExecStart=/usr/local/bin/upstream-seed \ | ||
--log-json \ | ||
--rad-home /var/local/upstream-seed \ | ||
--identity-key /var/local/upstream-seed/identity.key \ | ||
--project ${PROJECTS} | ||
EnvironmentFile=/etc/upstream-seed.env | ||
User=1000 | ||
Group=1000 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters