Skip to content

Commit

Permalink
[Docs] Update Infra docs (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk authored May 29, 2024
1 parent c47bb4c commit 729aa6b
Show file tree
Hide file tree
Showing 19 changed files with 144 additions and 23 deletions.
16 changes: 14 additions & 2 deletions .github/label-actions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# When `devnet-test-e2e` is added, also assign `devnet` and `push-image` to the PR.
devnet-test-e2e:
prs:
comment: The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. If you just created a pull request, you might need to push another commit to produce a container image DevNet can utilize to spin up infrastructure. You can use `make trigger_ci` to push an empty commit.
comment: |
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks.
You may need to run `make trigger_ci` to submit an empty commit that'll trigger the tests.
[GCP workloads (requires changing the namespace to {issue-id})](https://console.cloud.google.com/kubernetes/workload/overview?project=protocol-us-central1-d505&pageState=(%22savedViews%22:(%22c%22:%5B%5D,%22n%22:%5B%22devnet-issue-{issue-id}%22%5D)))
[Grafana network dashboard for devnet-issue-{issue-id}](https://grafana.poktroll.com/d/b799a130-3789-416d-aa7f-de5f4599cf03/network-overview?orgId=1&var-namespace=devnet-issue-{issue-id})
label:
- devnet
- push-image
Expand All @@ -27,7 +34,12 @@ devnet:
# Let the developer know that they need to push another commit after attaching the label to PR.
push-image:
prs:
comment: The image is going to be pushed after the next commit. You can use `make trigger_ci` to push an empty commit. If you also want to run an E2E test, please add `devnet-test-e2e` label.
comment: |
The image is going to be pushed after the next commit.
You can use `make trigger_ci` to push an empty commit.
If you also want to run E2E tests, please add `devnet-test-e2e` label.
# When `push-image` is removed, also delete `devnet` from the PR.
-push-image:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/label-actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Label Actions'
name: "Label Actions"

on:
issues:
Expand All @@ -18,4 +18,5 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v3
# TODO: switch to `dessant/label-actions@v3` when https://github.com/dessant/label-actions/pull/29 is merged.
- uses: okdas/label-actions@patch-1
6 changes: 3 additions & 3 deletions docusaurus/docs/develop/developer_guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Install the following dependencies:
6. [Tilt](https://docs.tilt.dev/install.html) - k8s local development tool & environment manager

:::note
If you've followed the [LocalNet instructions](../internal_infrastructure/localnet.md),
If you've followed the [LocalNet instructions](../../operate/infrastructure/localnet.md),
you may already have them installed.
:::

Expand All @@ -90,7 +90,7 @@ and inspect it so you have an idea of what's going on!

We'll be manually configuring a few actors to run in your shell for the sake of
the tutorial so you have visibility into the types of on-chain and off-chain
actors. In practice, you should be using [localnet](./../internal_infrastructure/localnet.md)
actors. In practice, you should be using [localnet](../../operate/infrastructure/localnet.md)
to dynamically scale your actors.

To learn more about the different actors type, see the docs [here](../../protocol/actors/actors.md).
Expand Down Expand Up @@ -655,7 +655,7 @@ We went through a low of steps above just so you can get a feel for how things w

That said, you can dynamically scale the number of any actors in LocalNet by ony changing one line!

Go to our [localnet tutorial](./../internal_infrastructure/localnet.md) to learn more.
Go to our [localnet tutorial](../../operate/infrastructure/localnet.md) to learn more.

## 7. Explore the tools

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion docusaurus/docs/operate/configs/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Configs",
"position": 4,
"position": 3,
"link": {
"type": "generated-index",
"description": "Poktroll Configs"
Expand Down
8 changes: 8 additions & 0 deletions docusaurus/docs/operate/infrastructure/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Infrastructure",
"position": 6,
"link": {
"type": "generated-index",
"description": "Infrastructure related to deploying, maintaining and testing various (Local, Dev, Test) environments."
}
}
56 changes: 56 additions & 0 deletions docusaurus/docs/operate/infrastructure/devnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
sidebar_position: 3
title: DevNet
---

# DevNet <!-- omit in toc -->

:::note

This page is only relevant to you if you are part of the core protocol team at Grove.

Make sure to follow the instructions [here](https://www.notion.so/buildwithgrove/Infrastructure-Setup-79b1431b70374e24b10cd9da556c7645?pvs=4) if you are unsure how
to set up your access to GCP.

:::

## Table of Contents <!-- omit in toc -->

- [GCP Console](#gcp-console)
- [Grafana logs](#grafana-logs)
- [Infrastructure Provisioning](#infrastructure-provisioning)
- [Configuration](#configuration)

## GCP Console

As an example, this [GCP link](<https://console.cloud.google.com/kubernetes/workload/overview?project=protocol-us-central1-d505&pageState=(%22savedViews%22:(%22i%22:%22a39690ef57a74a59b7550d42ac7655bc%22,%22c%22:%5B%5D,%22n%22:%5B%22devnet-issue-498%22%5D))>) links to `devnet-issue-498` created
from [PR #498](https://github.com/pokt-network/poktroll/pull/498).

![GCP console](./gcp_workloads.png)

## Grafana logs

As an example, this [Grafana link](https://grafana.poktroll.com/explore?schemaVersion=1&panes=%7B%22TtK%22:%7B%22datasource%22:%22P8E80F9AEF21F6940%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcontainer%3D%5C%22poktrolld%5C%22,%20namespace%3D%5C%22devnet-issue-477%5C%22%7D%20%7C%3D%20%60%60%20%7C%20json%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22P8E80F9AEF21F6940%22%7D,%22editorMode%22:%22builder%22%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D,%22panelsState%22:%7B%22logs%22:%7B%22logs%22:%7B%22visualisationType%22:%22logs%22%7D%7D%7D%7D%7D&orgId=1) links to the logs for `devnet-issue-477` from [PR #477](https://github.com/pokt-network/poktroll/pull/477)

![Grafana logs explorer](./grafana_explore_logs.png)

## Infrastructure Provisioning

The following is a list of details to know how our DevNet infrastructure is provisioned:

- **Grove & Kubernetes**: The Kubernetes cluster is provisioned using Grove's internal tooling.
- **Main Cluster**: We set up ArgoCD on the cluster and configure it to sync the [main/root application on the cluster](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1-app.yaml).
- **App of Apps**: ArgoCD provisions all the necessary resources and other ArgoCD Applications included in that Application, following the [ArgoCD App of Apps pattern](https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/).
- **PR `devnet` label**: One of the manifests provisioned is an [ArgoCD ApplicationSet](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1/devnets-github-label.yaml), which monitors our GitHub labels and provisions a network for each GitHub issue tagged with the `devnet` label.
- **PR `devnet-test-e2e` label**: As part of our CI process, when a GitHub issue is labeled `devnet-test-e2e`, we execute a [script](https://github.com/pokt-network/poktroll/blob/main/.github/workflows-helpers/run-e2e-test.sh#L1) that creates a [Kubernetes Job](https://github.com/pokt-network/poktroll/blob/main/.github/workflows-helpers/run-e2e-test-job-template.yaml) to for that `DevNet`.
- **Ephemeral DevNet**: The DevNet deplyed using the labels described above are considered to be ephemeral.
- **Closing PR**s: When the PR is closed or the label is removed, the infrastructure is cleaned up.
- **Persistent DevNet**: We have an option to provision `persistent DevNets` by creating a DevNet yaml file in [this directory](https://github.com/pokt-network/protocol-infra/tree/main/devnets-configs) ([ArgoCD Application that monitors this directory](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1/devnets-persistent.yaml) for reference).

## Configuration

Each DevNet ArgoCD App (following the App of Apps pattern) provisions a Helm chart called [full-network](https://github.com/pokt-network/protocol-infra/tree/main/charts/full-network).

Each `full-network` includes other ArgoCD applications that deploy Validators and off-chain actors.

Each Helm chart receives a list of configuration files. For example, see the [relayminer configuration](https://github.com/pokt-network/protocol-infra/blob/main/charts/full-network/templates/Application-Relayminer.yaml#L37). All possible values can be found in the `values.yaml` of the Helm chart, such as the [relayminer Helm chart](https://github.com/pokt-network/helm-charts/blob/main/charts/relayminer/values.yaml).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 2
title: LocalNet
---

Expand All @@ -21,7 +21,7 @@ needed to send an end-to-end relay.
- [Report issues](#report-issues)
- [TL;DR](#tldr)
- [Developing with LocalNet](#developing-with-localnet)
- [localnet\_config.yaml](#localnet_configyaml)
- [localnet_config.yaml](#localnet_configyaml)
- [Scaling network actors](#scaling-network-actors)
- [Off-chain actors configuration](#off-chain-actors-configuration)
- [Modify Kubernetes workloads](#modify-kubernetes-workloads)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Private TestNet
sidebar_position: 1
sidebar_position: 5
---

# Private TestNet <!-- omit in toc -->
Expand Down
15 changes: 15 additions & 0 deletions docusaurus/docs/operate/infrastructure/repositories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
sidebar_position: 1
title: Repositories
---

# Repositories <!-- omit in toc -->

- [pokt-network/protocol-infra](https://github.com/pokt-network/protocol-infra):
Repository describing our `kubernetes` infrastructure following `GitOps` patterns.
`ArgoCD` consumes different manifests and provisions/maintains workloads using these manifests.
- [pokt-network/poktroll-docker-compose-example](https://github.com/pokt-network/poktroll-docker-compose-example):
Repository containing an example of how to provision the `poktroll` stack using `docker-compose`.
It includes instructions on configuring, staking and deploying Full Nodes, RelayMiner and AppGate Servers.
- [pokt-network/helm-charts](https://github.com/pokt-network/helm-charts): helm charts to simplify the deployment of our software on `kubernetes`.
- [pokt-network/pocket-network-genesis](https://github.com/pokt-network/pocket-network-genesis): repository containing genesis files for all networks.
37 changes: 37 additions & 0 deletions docusaurus/docs/operate/infrastructure/testnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
sidebar_position: 4
title: TestNet
---

# TestNet <!-- omit in toc -->

:::note

This page is only relevant to you if you are part of the core protocol team at Grove.

:::

## Table of Contents <!-- omit in toc -->

- [Infrastructure provisioning](#infrastructure-provisioning)
- [Version upgrade](#version-upgrade)
- [Regenesis procedure](#regenesis-procedure)

## Infrastructure provisioning

- **Grove & Kubernetes**: The Kubernetes cluster is provisioned using Grove's internal tooling.
- **Main Cluster**: We set up ArgoCD on the cluster and configure it to sync the [main/root application on the cluster](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1-app.yaml).
- **App of Apps**: ArgoCD provisions all the necessary resources and other ArgoCD Applications included in that Application, following the [ArgoCD App of Apps pattern](https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/).
- As a part of that ArgoCD Application we have resources such as StatefulSets and ConfigMaps that describe configuration and infrastructure to run validators and seed nodes. Examples:
- [testnet-validated.yaml](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1/testnet-validated.yaml)
- [testnet-validated-seed.yaml](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1/testnet-validated-seed.yaml)
<!-- TODO(@okdas): improve the setup because this requires an abstraction. -->

## Version upgrade

The notion doc on how to upgrade Grove's validator can be found [here](https://www.notion.so/How-to-upgrade-validator-seed-node-ee85c4de651047f29151c0c51cd8f14a?pvs=4)

## Regenesis procedure

- [Genesis generation notion doc](https://www.notion.so/Generating-a-new-genesis-json-file-b6a41c010a114713b6b0cdc2ebb6e264?pvs=4)
- [Step-by-step guide to do a full re-genesis](https://www.notion.so/How-to-re-genesis-a-Shannon-TestNet-a6230dd8869149c3a4c21613e3cfad15?pvs=4)
2 changes: 1 addition & 1 deletion docusaurus/docs/operate/run_a_node/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Run a Node",
"position": 8,
"position": 2,
"link": {
"type": "generated-index",
"description": "Guides on how to deploy and operated various type of Pocket Network nodes."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"label": "Testing",
"position": 1,
"position": 10,
"link": {
"type": "generated-index",
"description": "Documentation related to the type of end-to-end testing (load or other) we are doing."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ We use [k6](https://k6.io/) for load testing. For detailed information about k6
## Dependencies

- [k6](https://grafana.com/docs/k6/latest/get-started/installation/)
- (For local suite execution) [LocalNet](../localnet.md)
- (For local suite execution) [LocalNet](../infrastructure/localnet.md)

## How to run tests

Expand Down

0 comments on commit 729aa6b

Please sign in to comment.