Skip to content

Commit

Permalink
Merge branch 'main' into al-88-add-remove-invulnerables
Browse files Browse the repository at this point in the history
  • Loading branch information
lazam committed Nov 2, 2023
2 parents 7c23bf9 + ab570e3 commit fa8020f
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 28 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/gitspiegel-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: gitspiegel sync

on:
pull_request:
types:
- opened
- synchronize
- unlocked
- ready_for_review
- reopened

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Trigger sync via API
run: |
curl --fail-with-body -XPOST "https://gitspiegel.parity-prod.parity.io/api/v1/mirror/${{ github.repository }}/pull/${{ github.event.number }}" \
-H "Content-Type: application/json" \
-H "x-auth: ${{ secrets.GITSPIEGEL_TOKEN }}"
8 changes: 0 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ deploy-to-versi:
DOMAIN: parity-versi
APP: testnet-manager

deploy-to-wococo:
<<: *release-refs
extends: .deploy-with-argocd
environment: parity-testnet-wococo
variables:
DOMAIN: parity-testnet
APP: testnet-manager-wococo

deploy-to-rococo:
<<: *release-refs
extends: .deploy-with-argocd
Expand Down
16 changes: 10 additions & 6 deletions app/lib/network_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def list_parachains():
collator_pods = list_collator_pods()
# If the paraId is not set on pod labels, we fall back to 0
cluster_parachain_tuple_set = set(
map(lambda pod: (pod.metadata.labels.get('paraId', '0'), pod.metadata.labels.get('chain')), collator_pods))
map(lambda pod: (int(pod.metadata.labels.get('paraId', '0')), pod.metadata.labels.get('chain')), collator_pods))

parachains = {}
for cluster_parachain_tuple in cluster_parachain_tuple_set:
Expand All @@ -470,16 +470,20 @@ def list_parachains():
parachain_leases_count = get_all_parachain_leases_count(substrate_client)
parachain_current_code_hashes = get_all_parachain_current_code_hashes(substrate_client)
parachain_heads = get_all_parachain_heads(substrate_client)

for para_id in para_ids:
if para_id in parachains and 'name' in parachains[para_id]:
para_name = parachains[para_id]['name']
para_location = parachains[para_id]['location']
else:
para_name = relay_chain_network_name + '-para-' + para_id
para_location = 'external'
parachains[para_id] = {
'name': relay_chain_network_name + '-para-' + str(para_id) if not parachains.get(para_id) else parachains[para_id][
'name'],
'name': para_name,
'location': para_location,
'lifecycle': parachain_lifecycles.get(para_id),
'leases_count': parachain_leases_count.get(para_id),
'current_code_hash': parachain_current_code_hashes.get(para_id),
'head': parachain_heads.get(para_id),
'location': 'external ' if not parachains.get(para_id) else parachains[para_id]['location'],
'head': parachain_heads.get(para_id)
}
return parachains

Expand Down
2 changes: 1 addition & 1 deletion app/templates/validators.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3>{{ network_name.capitalize() }} Validators : {{ external_validator_count }}
<td><a href="/nodes/{{ validator.name }}">{{ validator.name }}</a></td>
<td><a target="_blank" href="{{ node_logs_link | replace('{node}',validator.name) }}">🔎</a></td>
{% else %}
<td>{{ validator.name }}/td>
<td>{{ validator.name }}</td>
<td></td>
{% endif %}
<td>{{ validator.address }}</td>
Expand Down
22 changes: 17 additions & 5 deletions local-kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# ============================================================================================
# Validator-manager Quick Deploy Makefile for Development and Testing
# Testnet Manager Quick Deploy Makefile for Development and Testing
# ============================================================================================

KUBERNETES_CONTEXT = minikube # minikube or rancher-desktop
# rococo or wococo (don't put space at the end of the variable it will be used as is)
CHAIN_NAMESPACE = rococo
# docker or podman
MINIKUBE_DRIVER = docker

# ============================================================================================

all: kube check build install
ifeq ($(MINIKUBE_DRIVER),podman)
TARGETS := kube_minikube-podman check install
else
TARGETS := kube check install
endif

all: $(TARGETS)

# ============================================================================================

Expand Down Expand Up @@ -37,17 +45,21 @@ setup: setup_${KUBERNETES_CONTEXT}

setup_minikube:
@kubectl --context ${KUBERNETES_CONTEXT} apply -f ./kube-setup
@echo "Waiting 20 seconds for chainspec pod readiness before continuing"
@sleep 20

setup_rancher-desktop:
@kubectl --context ${KUBERNETES_CONTEXT} apply -f ./kube-setup -f ./rancher-desktop/kube-setup
@echo "Waiting 20 seconds for chainspec pod readiness before continuing"
@sleep 20

build: check build_${KUBERNETES_CONTEXT}

build_minikube:
cd ../. && minikube image build . -t local/testnet-manager
cd ../. && minikube image build . -t localhost/testnet-manager

build_rancher-desktop:
cd ../. && docker image build -t local/testnet-manager:latest .
cd ../. && docker image build -t localhost/testnet-manager:latest .

# ============================================================================================

Expand Down Expand Up @@ -108,4 +120,4 @@ uninstall: check
@kubectl --context ${KUBERNETES_CONTEXT} delete pvc -n ${CHAIN_NAMESPACE} --all

cleanup: check
@kubectl --context ${KUBERNETES_CONTEXT} delete namespace ${CHAIN_NAMESPACE}
@kubectl --context ${KUBERNETES_CONTEXT} delete namespace rococo wococo
4 changes: 2 additions & 2 deletions local-kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Requirements

1. Helm
a. Helmdiff
a. Helm diff plugin
b. Helmfile
2. Minikube or Rancher-desktop

Expand Down Expand Up @@ -46,7 +46,7 @@ make rpc
This command will open browser and port-forward the 9944
> Note: you should have port `9944` free in your host before running `make rpc`
### Validator-manager web endpoint
### Testnet Manager web endpoint
Run:
```
make web
Expand Down
3 changes: 0 additions & 3 deletions local-kubernetes/charts/values-moonbase-collator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ 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
2 changes: 1 addition & 1 deletion local-kubernetes/charts/values-testnet-manager.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
image:
repository: "local/testnet-manager"
repository: "localhost/testnet-manager"
tag: latest
pullPolicy: IfNotPresent

Expand Down
2 changes: 1 addition & 1 deletion skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: testnet-manager
build:
artifacts:
- image: local/testnet-manager
- image: localhost/testnet-manager
docker: {}
local:
useBuildkit: true
Expand Down
2 changes: 1 addition & 1 deletion tests/stash_account_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def tearDown(self):
def test_get_account_funds(self):
alice_key = Keypair.create_from_uri("//Alice")
alice_funds = get_account_funds(self.polkadot_rpc_ws_url, alice_key.ss58_address)
self.assertEqual(alice_funds, 10000000000000000, "Alice's funds successfully retrieved")
self.assertEqual(alice_funds, 1000000000000000000, "Alice's funds successfully retrieved")

if __name__ == '__main__':
unittest.main()

0 comments on commit fa8020f

Please sign in to comment.