Skip to content

Commit

Permalink
Merge branch 'main' into node-metrics-canister-front-end
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrodimarco-dfinity authored Aug 22, 2024
2 parents 90fa192 + 1f4df9a commit 7b28ddc
Show file tree
Hide file tree
Showing 24 changed files with 881 additions and 130 deletions.
10 changes: 5 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build --@rules_rust//:extra_rustc_flags=-Cdebug-assertions=on
build --@rules_rust//:extra_rustc_flag=-Dbindings_with_variant_name
build --strip=never

# build:dfinity --remote_cache=bazel-remote.idx.dfinity.network
build:dfinity --remote_cache=bazel-remote.idx.dfinity.network
# build --remote_cache=grpc://localhost:9092
build --remote_instance_name=default
build --google_default_credentials=false
Expand All @@ -46,14 +46,14 @@ build --remote_timeout=30s # Default is 60s.
build:ci --remote_timeout=5m # Default is 60s.
build:ci --remote_upload_local_results=true

# build:dfinity --experimental_remote_downloader=bazel-remote.idx.dfinity.network --experimental_remote_downloader_local_fallback
build:dfinity --experimental_remote_downloader=bazel-remote.idx.dfinity.network --experimental_remote_downloader_local_fallback
build:local --experimental_remote_downloader=

# Does not produce valid JSON. See https://github.com/bazelbuild/bazel/issues/14209
build --execution_log_json_file=bazel-build-log.json

# build:dfinity --bes_results_url=https://dash.idx.dfinity.network/invocation/
# build:dfinity --bes_backend=bes.idx.dfinity.network
build:dfinity --bes_results_url=https://dash.idx.dfinity.network/invocation/
build:dfinity --bes_backend=bes.idx.dfinity.network
build --bes_timeout=30s # Default is no timeout.
build:ci --bes_timeout=180s # Default is no timeout.
build:ci --bes_upload_mode=fully_async
Expand All @@ -72,7 +72,7 @@ build:fmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build:fmt --output_groups=+rustfmt_checks
build --@rules_rust//:rustfmt.toml=//:rustfmt.toml

test --test_output=errors
test --test_output=streamed
test --test_env=RUST_BACKTRACE=full

test:precommit --build_tests_only
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/qualify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,29 @@ jobs:
filename: ${{ inputs.version }}-${{ steps.date.outputs.date }}.tar
folderId: ${{ secrets.ARTIFACTS_DRIVE_FOLDER_ID }}
name: ${{ inputs.version }}-${{ steps.date.outputs.date }}.tar

- name: "Setup message"
id: slack
shell: bash
run: |
COMMIT="${{ inputs.version }}"
FULL_MESSAGE="Qualification of \`${COMMIT}\`: "
if [[ "${{ needs.qualify.result }}" =~ ^(success)$ ]]; then
FULL_MESSAGE="${FULL_MESSAGE} :white_check_mark:"
elif [[ "${{ needs.qualify.result }}" =~ ^(failure|timed_out)$ ]]; then
FULL_MESSAGE="${FULL_MESSAGE} :x:"
fi
echo "message=${FULL_MESSAGE}" >> $GITHUB_OUTPUT
- name: "Notify DRE on slack"
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: eng-release-bots
slack-message: |
${{ steps.slack.outputs.message }}
Artifacts of run: `${{ inputs.version }}-${{ steps.date.outputs.date }}.tar`
Artifacts can be found on <https://drive.google.com/drive/u/1/folders/${{secrets.ARTIFACTS_DRIVE_FOLDER_ID}}|Google Drive :open_file_folder:>
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
6 changes: 3 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ http_archive(
)

http_file(
name = "bazelisk_darwin",
sha256 = "9a4b169038a63ebf60a9b4f367b449ab9b484c4ec7d1ef9f6b7a4196dfd50f33",
url = "https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-darwin",
name = "target_determinator",
sha256 = "65000bba3a5eb1713d93b1e08e33b6fbe5787535664bbc1ba2f4166b0d26d0a1",
url = "https://github.com/bazel-contrib/target-determinator/releases/download/v0.27.0/target-determinator.linux.amd64",
)

http_file(
Expand Down
312 changes: 312 additions & 0 deletions docs/decentralization.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions docs/javascript/katex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document$.subscribe(({ body }) => {
renderMathInElement(body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true }
],
})
})
150 changes: 149 additions & 1 deletion docs/nns-proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,157 @@ dre propose remove-node-operators kdqam-hauon-sdvym-42eyg-5wyff-4ywbw-v6iij-2sw2
--summary "<An appropriate summary for the proposal, and a link to the forum post for further discussion, if possible>"
```
### Removing nodes from a subnet
There are situations where nodes need to be removed from subnets, such as for maintenance. Subnets are expected to maintain a certain size (number of nodes). Therefore, nodes cannot simply be removed from a subnet; new nodes must be added back into the subnet to maintain the required number.
To free up nodes from a specific data center (e.g., bo1) within subnets, follow these steps:
First, [open the public dashboard for the DC in question](https://dashboard.internetcomputer.org/center/bo1) to find a list of subnets that include nodes from the data center. Or, alternatively, you can bypass the public dashboard by querying the registry directly:
```bash
dre registry | jq '.nodes[] | select((.dc_id == "bo1") and (.subnet_id != null))'
```
**Explanation**: This command retrieves a dump of the registry, extracts the list of nodes, and selects only those that belong to the `bo1` data center and have a `subnet_id` set (i.e., not null).
<details>
<summary><i>Click here to see the output of the above command</i></summary>
```json
{
"node_id": "4jtgm-ywxcc-xh3o3-x2omx-tgmdm-gobca-agb3a-alvw4-dhmyn-khis6-xae",
"xnet": {
"ip_addr": "2600:c0d:3002:4:6801:dfff:fee7:5ae8",
"port": 2497
},
"http": {
"ip_addr": "2600:c0d:3002:4:6801:dfff:fee7:5ae8",
"port": 8080
},
"node_operator_id": "ut325-qbq5v-fli2f-e2a5h-qapdd-fsuyv-xej2j-ogvux-i3fc2-5nj3a-2ae",
"chip_id": null,
"hostos_version_id": "2e269c77aa2f6b2353ddad6a4ac3d5ddcac196b1",
"public_ipv4_config": null,
"subnet_id": "nl6hn-ja4yw-wvmpy-3z2jx-ymc34-pisx3-3cp5z-3oj4a-qzzny-jbsv3-4qe",
"dc_id": "bo1",
"node_provider_id": "lq5ra-f4ibl-t7wpy-hennc-m4eb7-tnfxe-eorgd-onpsl-wervo-7chjj-6qe",
"status": "Healthy"
}
{
"node_id": "af7ti-auyik-jfsne-tljmz-6purg-2msmy-jw34z-b4ie3-abk5f-h23xt-zae",
"xnet": {
"ip_addr": "2600:c0d:3002:4:6801:19ff:fe8c:de47",
"port": 2497
},
"http": {
"ip_addr": "2600:c0d:3002:4:6801:19ff:fe8c:de47",
"port": 8080
},
"node_operator_id": "ut325-qbq5v-fli2f-e2a5h-qapdd-fsuyv-xej2j-ogvux-i3fc2-5nj3a-2ae",
"chip_id": null,
"hostos_version_id": "2e269c77aa2f6b2353ddad6a4ac3d5ddcac196b1",
"public_ipv4_config": null,
"subnet_id": "w4rem-dv5e3-widiz-wbpea-kbttk-mnzfm-tzrc7-svcj3-kbxyb-zamch-hqe",
"dc_id": "bo1",
"node_provider_id": "lq5ra-f4ibl-t7wpy-hennc-m4eb7-tnfxe-eorgd-onpsl-wervo-7chjj-6qe",
"status": "Healthy"
}
{
"node_id": "fd5e4-a2xzl-lxu7m-kjvn6-2arnt-jghro-rdrgx-zvvkd-j2hza-pbwl4-5qe",
"xnet": {
"ip_addr": "2600:c0d:3002:4:6801:94ff:fec9:6b",
"port": 2497
},
"http": {
"ip_addr": "2600:c0d:3002:4:6801:94ff:fec9:6b",
"port": 8080
},
"node_operator_id": "ut325-qbq5v-fli2f-e2a5h-qapdd-fsuyv-xej2j-ogvux-i3fc2-5nj3a-2ae",
"chip_id": null,
"hostos_version_id": "2e269c77aa2f6b2353ddad6a4ac3d5ddcac196b1",
"public_ipv4_config": null,
"subnet_id": "tdb26-jop6k-aogll-7ltgs-eruif-6kk7m-qpktf-gdiqx-mxtrf-vb5e6-eqe",
"dc_id": "bo1",
"node_provider_id": "lq5ra-f4ibl-t7wpy-hennc-m4eb7-tnfxe-eorgd-onpsl-wervo-7chjj-6qe",
"status": "Healthy"
}
{
"node_id": "q2ucv-x7dv5-hheao-ocsye-jbg4z-enm75-ss62d-ehqhj-zwwm3-cap5q-tqe",
"xnet": {
"ip_addr": "2600:c0d:3002:4:6801:bcff:fee7:4008",
"port": 2497
},
"http": {
"ip_addr": "2600:c0d:3002:4:6801:bcff:fee7:4008",
"port": 8080
},
"node_operator_id": "ut325-qbq5v-fli2f-e2a5h-qapdd-fsuyv-xej2j-ogvux-i3fc2-5nj3a-2ae",
"chip_id": null,
"hostos_version_id": "2e269c77aa2f6b2353ddad6a4ac3d5ddcac196b1",
"public_ipv4_config": null,
"subnet_id": "io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe",
"dc_id": "bo1",
"node_provider_id": "lq5ra-f4ibl-t7wpy-hennc-m4eb7-tnfxe-eorgd-onpsl-wervo-7chjj-6qe",
"status": "Healthy"
}
```
</details>
To further refine the command and group nodes by subnets:
```bash
DC=bo1
dre registry | jq -r '.nodes | map(select((.dc_id == "'$DC'") and (.subnet_id != null))) | group_by(.subnet_id) | map("dre subnet replace --exclude '$DC' --nodes \([.[].node_id] | join(" "))") | .[]'
```
<details>
<summary><i>Click here to see the explanation of the jq command</i></summary>
1. **`-r` (raw output):**
- This option tells `jq` to output raw strings instead of JSON-formatted strings. This is particularly useful when you want to generate command-line strings like the one you're creating.
2. **`.nodes`:**
- This accesses the `nodes` array in the JSON structure.
3. **`map(select((.dc_id == "bo1") and (.subnet_id != null)))`:**
- This filters the nodes array. It keeps only the nodes where `dc_id` is `"bo1"` and `subnet_id` is not `null`. `map` applies this filter to each element of the array.
4. **`group_by(.subnet_id)`:**
- This groups the filtered nodes by their `subnet_id`. The result is an array of arrays, where each inner array contains nodes that share the same `subnet_id`.
5. **`map("dre subnet replace --exclude '$DC' --nodes \([.[].node_id] | join(" "))")`:**
- This `map` applies a transformation to each group (each inner array).
- The transformation constructs a string that starts with `"dre subnet replace --exclude '$DC' --nodes "`.
- `\([.[].node_id] | join(" "))`:
- `.[].node_id` accesses the `node_id` of each node in the current group.
- `join(" ")` joins all the `node_id`s into a single string separated by spaces.
- The result is a string for each subnet that lists all its nodes.
6. **`.[]`:**
- This unwraps the array of strings created by the previous `map` step into individual strings. This means the output will be a list of commands, one per line.
</details>
<details>
<summary><i>Click here to see the example output</i></summary>
```
dre subnet replace --exclude bo1 --nodes q2ucv-x7dv5-hheao-ocsye-jbg4z-enm75-ss62d-ehqhj-zwwm3-cap5q-tqe
dre subnet replace --exclude bo1 --nodes 4jtgm-ywxcc-xh3o3-x2omx-tgmdm-gobca-agb3a-alvw4-dhmyn-khis6-xae
dre subnet replace --exclude bo1 --nodes fd5e4-a2xzl-lxu7m-kjvn6-2arnt-jghro-rdrgx-zvvkd-j2hza-pbwl4-5qe
dre subnet replace --exclude bo1 --nodes af7ti-auyik-jfsne-tljmz-6purg-2msmy-jw34z-b4ie3-abk5f-h23xt-zae
```
</details>
You would now go through each of these output lines (subnets) and submit proposals. Remember to include a motivation for each proposal. For example:
```bash
dre subnet replace --exclude bo1 --nodes q2ucv-x7dv5-hheao-ocsye-jbg4z-enm75-ss62d-ehqhj-zwwm3-cap5q-tqe --motivation "Removing BO1 nodes for maintenance"
```
### Removing nodes from the registry
Here is an example where we remove all AW1 nodes for redeployment.
Here is an example where we remove all AW1 nodes from the registry, for redeployment. Note that the nodes should already be removed from the subnet(s), so they should in unassigned state (awaiting subnet).
You can get the node status by checking [the public dashboard](https://dashboard.internetcomputer.org/center/aw1) or with `dre registry` and then analyzing the generated JSON from the command.
After all relevant nodes are removed from their subnets, you can also remove them from the registry with:
```bash
dre nodes remove aw1 --motivation "Removing AW1 nodes for redeployment"
Expand Down
10 changes: 10 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,13 @@ markdown_extensions:
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- tables
- pymdownx.arithmatex:
generic: true

extra_javascript:
- javascript/katex.js
- https://unpkg.com/katex@0/dist/katex.min.js
- https://unpkg.com/katex@0/dist/contrib/auto-render.min.js

extra_css:
- https://unpkg.com/katex@0/dist/katex.min.css
85 changes: 0 additions & 85 deletions node-labels/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2634,90 +2634,6 @@ data:
2a00:fc0:5000:300:6801:ffff:fe54:b396:
dc: mb1
label: dll14
2a01:138:900a:0:6801:21ff:fec5:3a04:
dc: mu1
label: dll06
2a01:138:900a:0:6801:22ff:feff:a6e:
dc: mu1
label: dll15
2a01:138:900a:0:6801:31ff:feb4:bbd1:
dc: mu1
label: dll17
2a01:138:900a:0:6801:32ff:fec6:c12:
dc: mu1
label: dll14
2a01:138:900a:0:6801:33ff:fe92:8893:
dc: mu1
label: dll26
2a01:138:900a:0:6801:58ff:fe37:d524:
dc: mu1
label: dll21
2a01:138:900a:0:6801:5cff:feed:7be2:
dc: mu1
label: dll11
2a01:138:900a:0:6801:62ff:fe6b:7d8f:
dc: mu1
label: dll12
2a01:138:900a:0:6801:74ff:feab:762b:
dc: mu1
label: dll03
2a01:138:900a:0:6801:7aff:fe41:3051:
dc: mu1
label: dll22
2a01:138:900a:0:6801:87ff:fe34:eed7:
dc: mu1
label: dll01
2a01:138:900a:0:6801:88ff:fed5:853b:
dc: mu1
label: dll18
2a01:138:900a:0:6801:8fff:fe1d:e5bf:
dc: mu1
label: dll28
2a01:138:900a:0:6801:90ff:fe63:2c5d:
dc: mu1
label: dll04
2a01:138:900a:0:6801:96ff:fe5a:f63:
dc: mu1
label: dll05
2a01:138:900a:0:6801:96ff:febd:4be1:
dc: mu1
label: dll16
2a01:138:900a:0:6801:98ff:fe7c:2c57:
dc: mu1
label: dll19
2a01:138:900a:0:6801:a4ff:fef0:c947:
dc: mu1
label: dll13
2a01:138:900a:0:6801:b5ff:fe42:bc61:
dc: mu1
label: dll23
2a01:138:900a:0:6801:baff:fe5f:a337:
dc: mu1
label: dll02
2a01:138:900a:0:6801:beff:fed6:43de:
dc: mu1
label: dll10
2a01:138:900a:0:6801:c4ff:fe39:29d9:
dc: mu1
label: dll07
2a01:138:900a:0:6801:c6ff:fe4e:789b:
dc: mu1
label: dll20
2a01:138:900a:0:6801:d3ff:febe:73a0:
dc: mu1
label: dll27
2a01:138:900a:0:6801:e2ff:fe80:b65:
dc: mu1
label: dll08
2a01:138:900a:0:6801:e7ff:fe6d:75a1:
dc: mu1
label: dll25
2a01:138:900a:0:6801:e9ff:fe7a:68ae:
dc: mu1
label: dll09
2a01:138:900a:0:6801:ebff:fef3:1625:
dc: mu1
label: dll24
2a01:2a8:a13c:1:6801:18ff:fec5:5f32:
dc: zh6
label: dll26
Expand Down Expand Up @@ -3381,4 +3297,3 @@ data:
2a0f:cd00:2:1:6801:fdff:fe1d:d6e7:
dc: ge1
label: dll04

Loading

0 comments on commit 7b28ddc

Please sign in to comment.