Skip to content

Commit

Permalink
Rename and update version, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lazam committed Aug 23, 2023
1 parent 9d0098e commit 91870df
Show file tree
Hide file tree
Showing 25 changed files with 4,339 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/smoke_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
make kube
make install
kubectl get pod -n rococo
kubectl wait --for=condition=Ready pods --all -n rococo --timeout=900s
kubectl wait --for=condition=Ready pods --all -n rococo --timeout=1200s
kubectl get pod -n rococo
- name: Tests
Expand Down
4 changes: 3 additions & 1 deletion app/lib/collator_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def get_derived_collator_session_keys(node_name):
}
except Exception as e:
log.error("Unable to get_derived_collator_session_keys. Error: {}, stacktrace:\n".format(e, traceback.print_exc()))
return None
return {
'aura': None
}


def get_moon_node_collator_uri(root_seed, node_name):
Expand Down
34 changes: 20 additions & 14 deletions local-kubernetes/charts/helmfile-rococo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,36 @@ releases:
- ./values-testnet-manager.yml

## relay chain Rococo ##
- name: localrococo-bootnode
- name: local-rococo-bootnode
namespace: rococo
chart: parity/node
version: &node_version 5.1.7
values:
- ./values-localrococo-bootnode.yaml
- ./values-local-rococo-bootnode.yaml
- node:
flags:
- "--alice"
extraLabels:
validatorAccount: "5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY" # Alice address

- name: localrococo-bootnode-bob
- name: local-rococo-bootnode-bob
namespace: rococo
chart: parity/node
version: *node_version
values:
- ./values-localrococo-bootnode.yaml
- ./values-local-rococo-bootnode.yaml
- node:
flags:
- "--bob"
extraLabels:
validatorAccount: "5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc" # Bob address

- name: localrococo-validator-a
- name: local-rococo-validator-a
namespace: rococo
chart: parity/node
version: *node_version
values:
- ./values-localrococo-bootnode.yaml
- ./values-local-rococo-bootnode.yaml
- node:
replicas: 1
- node:
Expand All @@ -60,15 +60,15 @@ releases:
extraDerivation: "//validator//${HOSTNAME}"

## Para chain Shell ##
- name: localrococo-shell-collator
- name: local-rococo-shell-collator
namespace: rococo
chart: parity/node
version: *node_version
values:
- values-shell-collator.yaml

# Para chain Statemint ##
- name: localrococo-statemint-alice
- name: local-rococo-statemint-alice
namespace: rococo
chart: parity/node
version: *node_version
Expand All @@ -81,7 +81,7 @@ releases:
paraId: "1003"
ss58Format: "0"
collatorAccount: "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5" # Alice Polkadot address
- name: localrococo-statemint-bob
- name: local-rococo-statemint-bob
namespace: rococo
chart: parity/node
version: *node_version
Expand All @@ -94,7 +94,7 @@ releases:
paraId: "1003"
ss58Format: "0"
collatorAccount: "14E5nqKAp3oAJcmzgZhUD2RcptBeUBScxKHgJKU4HPNcKVf3" # Bob Polkadot address
- name: localrococo-statemint-a
- name: local-rococo-statemint-a
namespace: rococo
chart: parity/node
version: *node_version
Expand All @@ -107,7 +107,7 @@ releases:
seed: "test test test test test test test test test test test junk"
extraDerivation: "//collator//${HOSTNAME}"
## Para chain Moonbase ##
- name: localrococo-moonbase-alice
- name: local-rococo-moonbase-alice
namespace: rococo
chart: parity/node
version: *node_version
Expand All @@ -120,18 +120,24 @@ releases:
extraLabels:
paraId: "1001"
collatorAccount: "0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac"
# collators
- name: localrococo-moonbase-collator
# collators
- name: local-rococo-moonbase-collator
namespace: rococo
chart: parity/node
version: *node_version
values:
- values-moonbase-collator.yml

## Para chain Tick ##
- name: localrococo-tick-collator
- name: local-rococo-tick-collator
namespace: rococo
chart: parity/node
version: *node_version
values:
- values-tick-collator.yml
- node:
keys:
- type: aura
scheme: "sr25519"
seed: "test test test test test test test test tick tick tick tick"
extraDerivation: "//collator//${HOSTNAME}"
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:
# also update version in manifests/chainspec.yml
# also update version in kube-setup/validators-chainspec.yml
repository: parity/polkadot
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always

initContainer:
debug: true
Expand All @@ -21,7 +21,7 @@ node:
sizeLimit: 10Mi
podManagementPolicy: Parallel
allowUnsafeRpcMethods: true
# kube-setup/chainspec.yml
# kube-setup/validators-chainspec.yml
customChainspecUrl: http://chainspec.rococo/rococo-local.json
forceDownloadChainspec: true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:
# also update version in manifests/chainspec.yml
# also update version in kube-setup/validators-chainspec.yml
repository: parity/polkadot
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always

initContainer:
debug: true
Expand Down
11 changes: 7 additions & 4 deletions local-kubernetes/charts/values-moonbase-collator.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:
# also update version in manifests/chainspec.yml
repository: purestake/moonbeam
# also update version in kube-setup/validators-chainspec.yml
repository: moonbeamfoundation/moonbeam
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always

initContainer:
debug: true
Expand All @@ -19,7 +19,7 @@ node:
role: collator
replicas: 1
command: "/moonbeam/moonbeam"
# manifests/chainspec.yml
# kube-setup/validators-chainspec.yml
forceDownloadChainspec: true
customChainspecUrl: "http://chainspec.rococo/moonbase.json"
customChainspecPath: "/chain-data/moonbase.json"
Expand All @@ -30,6 +30,9 @@ node:
chainKeystore: *chainKeystore
persistGeneratedNodeKey: true
allowUnsafeRpcMethods: true
# To be removed once https://github.com/moonbeam-foundation/moonbeam/pull/2359
# is included in release
legacyRpcFlags: true
flags:
- "--allow-private-ipv4"

Expand Down
8 changes: 3 additions & 5 deletions local-kubernetes/charts/values-shell-collator.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:
# also update version in kube-setup/chainspec.yml
repository: parity/polkadot-collator
repository: parity/polkadot-parachain
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always

initContainer:
debug: true
Expand All @@ -18,7 +18,7 @@ node:
chain: shell
role: collator
replicas: 1
command: "/usr/local/bin/polkadot-collator"
command: "/usr/local/bin/polkadot-parachain"
# manifests/chainspec.yml
forceDownloadChainspec: true
customChainspecUrl: "http://chainspec.rococo/shell.json"
Expand All @@ -28,8 +28,6 @@ node:
chainData: *chainData
chainKeystore: *chainKeystore
persistGeneratedNodeKey: true
flags:
- "--unsafe-pruning"

extraLabels:
paraId: "1000"
4 changes: 2 additions & 2 deletions local-kubernetes/charts/values-statemint-collator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ image:
# also update version in kube-setup/chainspec.yml
repository: parity/polkadot-parachain
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always

initContainer:
debug: true
Expand All @@ -19,7 +19,7 @@ node:
role: collator
replicas: 1
command: "/usr/local/bin/polkadot-parachain"
# manifests/chainspec.yml
# kube-setup/validators-chainspec.yml
forceDownloadChainspec: true
customChainspecUrl: "http://chainspec.rococo/statemint.json"
isParachain: true
Expand Down
2 changes: 1 addition & 1 deletion local-kubernetes/charts/values-testnet-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ secret:

configmap:
LOG_LEVEL: DEBUG
RELAY_CHAIN_RPC_URL: "ws://localrococo-bootnode.rococo:9944"
RELAY_CHAIN_RPC_URL: "ws://local-rococo-bootnode.rococo:9944"
RPC_NODE_URL_PATTERN: "NODE_NAME.rococo:9944"
HEALTHY_MIN_PEER_COUNT: "1"
TASKS_CRON_SCHEDULE: "0 0 30 2 *" # Every February 30th aka never
Expand Down
9 changes: 4 additions & 5 deletions local-kubernetes/charts/values-tick-collator.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:
# also update version in manifests/chainspec.yml
repository: parity/polkadot-collator
repository: parity/polkadot-parachain
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always

initContainer:
debug: true
Expand All @@ -18,8 +18,8 @@ node:
chain: tick
role: collator
replicas: 2
command: "/usr/local/bin/polkadot-collator"
# manifests/chainspec.yml
command: "/usr/local/bin/polkadot-parachain"
# kube-setup/validators-chainspec.yml
forceDownloadChainspec: true
customChainspecUrl: "http://chainspec.rococo/tick.json"
isParachain: true
Expand All @@ -31,7 +31,6 @@ node:
allowUnsafeRpcMethods: true
flags:
- "--allow-private-ipv4"
- "--unsafe-pruning"

extraLabels:
paraId: "1002"
Expand Down
6 changes: 3 additions & 3 deletions local-kubernetes/kube-setup/validators-chainspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
- name: dir
mountPath: /dir
- name: create-chainspec-moonbase
image: purestake/moonbeam:latest
image: moonbeamfoundation/moonbeam:latest
imagePullPolicy: IfNotPresent
command: [ "/bin/sh" ]
args:
Expand Down Expand Up @@ -112,8 +112,8 @@ spec:
sed 's/5GsHTRwWBzPixrft2FVYG7SvjFjj3jsBB1Kx6zhEDzgZvczS/5HGJty2oZ8nv1x3JPNtFps11Xw787ZwPdzixX1TtuhbC5Fhq/' -i /dir/tick-dev-plain.json;
polkadot-parachain build-spec --chain /dir/tick-dev-plain.json --raw > /dir/tick.json;
# 5G4849RFENXy6xMyXDZB2aEBs8tNaVsjjkWDQao3CewdFyZm - DERIVATION_ROOT_SEED//Alice
# 5Fnv5ZJJNhxQdQJm43pcGJSQigoZxqgJSoha8SVpXbJ8iknD - DERIVATION_ROOT_SEED//collator//localrococo-tick-collator-node-0
# 5HGJty2oZ8nv1x3JPNtFps11Xw787ZwPdzixX1TtuhbC5Fhq - DERIVATION_ROOT_SEED//collator//localrococo-tick-collator-node-1
# 5Fnv5ZJJNhxQdQJm43pcGJSQigoZxqgJSoha8SVpXbJ8iknD - DERIVATION_ROOT_SEED//collator//local-rococo-tick-collator-node-0
# 5HGJty2oZ8nv1x3JPNtFps11Xw787ZwPdzixX1TtuhbC5Fhq - DERIVATION_ROOT_SEED//collator//local-rococo-tick-collator-node-1
volumeMounts:
- name: dir
mountPath: /dir
Expand Down
86 changes: 86 additions & 0 deletions tests/output/1000.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<title>Rococo Para #1000 Collators</title>
<link rel="stylesheet" type="text/css" href="/static/libs/datatables.min.css">
</head>

<body>
<h3>Shell [Rococo Para #1000] Collators : 0 External / 0 Active in K8S / 1 Inactive in K8S </h3>
<h4>Runtime: 2, Status: off-boarded</h4>
<select onchange="location = '/collators/1000?statefulset=' + this.value">
<option value="" selected>all</option>

<option value="local-rococo-shell-collator-node" >local-rococo-shell-collator-node</option>

</select>

<table id="table" class="display compact" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Logs</th>
<th>Account</th>
<th>PodStatus</th>
<th>CollatorStatus</th>
<th>Image</th>
<th>Location</th>
</tr>
</thead>
<tbody>

<tr>
<td><a href="/nodes/local-rococo-shell-collator-node-0">local-rococo-shell-collator-node-0</a></td>
<td><a target="_blank" href="/api/nodes/local-rococo-shell-collator-node-0/logs">🔎</a></td>
<td>5HEmETnXC8yHzjPfe3pMLh14wSgG5afJkQG42PkPioqJaaMh</td>
<td>Running</td>
<td>False</td>
<td>parity/polkadot-parachain:latest</td>
<td>in_cluster</td>
</tr>

</tbody>
</table>
<script
src="/static/libs/jquery-3.6.0.slim.min.js"
integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI="
crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf8" src="/static/libs/datatables.min.js"></script>
<script>
$(document).ready( function () {
$('#table').DataTable({
// https://datatables.net/reference/option/
"lengthMenu": [[30, -1], [30, "All"]]
});

const registerButton = document.querySelector("#register")
document.querySelector("#register").addEventListener("click", () => {
registerButton.disabled = true
fetch("/api/collators/1000/register?statefulset=", {method: "POST"})
.then(() => {
registerButton.textContent = "Registration in progress"
registerButton.style.backgroundColor = 'lightgreen'
})
.catch(error => {
registerButton.textContent = "Registration Failed: " + error
registerButton.style.backgroundColor = 'red'
});
});

const deregisterButton = document.querySelector("#deregister")
document.querySelector("#deregister").addEventListener("click", () => {
deregisterButton.disabled = true
fetch("/api/collators/1000/deregister?statefulset=", {method: "POST"})
.then(() => {
deregisterButton.textContent = "Deregistration in progress"
deregisterButton.style.backgroundColor = 'lightgreen'
})
.catch(error => {
deregisterButton.textContent = "Deregistration Failed: " + error
deregisterButton.style.backgroundColor = 'red'
});
});
});
</script>
</body>
</html>
Loading

0 comments on commit 91870df

Please sign in to comment.