Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c0c35ba
add polkadot build script
coriolinus Feb 6, 2020
32d9303
Add scripting to bring up a simple alice-bob example net
coriolinus Feb 6, 2020
35cd700
enable external rpc access to the nodes
coriolinus Feb 7, 2020
cd19677
Ensure external RPC access works
coriolinus Feb 12, 2020
1ff63a5
Add multi-stage dockerfile for building the cumulus-test-parachain-co…
coriolinus Feb 12, 2020
55d5e8d
Add services which generate genesis state, run the collator
coriolinus Feb 12, 2020
78a4e60
Merge remote-tracking branch 'origin/master' into prgn-collator-script
coriolinus Feb 13, 2020
e2ce4c8
Launch the collator node
coriolinus Feb 13, 2020
d244115
enable external websocket access to indexer nodes
coriolinus Feb 13, 2020
4a32d81
Reorganize for improved caching, again
coriolinus Feb 14, 2020
e698987
Get the collator talking to the indexer nodes
coriolinus Feb 14, 2020
8968c5a
Add runtime stage to collect runtime wasm blob into volume
coriolinus Feb 17, 2020
30bf185
WIP: add registrar service and partial work to actually register the …
coriolinus Feb 17, 2020
1c5ba4a
Add a parachain registrar which should properly register the parachain
coriolinus Feb 18, 2020
c683f80
BROKEN attempt to demo registrar communication with the blockchain
coriolinus Feb 20, 2020
54e98d4
Fix broken parachain registrar
coriolinus Feb 20, 2020
d2b0905
Merge remote-tracking branch 'origin/master' into prgn-collator-script
coriolinus Feb 21, 2020
ba59157
fixes which cause the collator to correctly produce new parachain blocks
coriolinus Feb 21, 2020
d53f004
add documentation for running the parachain automatically
coriolinus Feb 21, 2020
f260c00
Add health check to collator
coriolinus Feb 21, 2020
0ff7fb5
minor scripting improvements
coriolinus Feb 21, 2020
55d9701
Apply suggestions from code review
coriolinus Feb 21, 2020
e202ffc
Docker: copy the whole workspace in one go
coriolinus Feb 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add health check to collator
  • Loading branch information
coriolinus committed Feb 21, 2020
commit f260c007d86bb7f5a9cde7c975f5fd7ef50dca2b
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,11 @@ $ pjs query.parachains.heads 100
"heads": "0xe1efbf8cc2e1304da927986f4cd6964ce0888ce3995948bf71fe427b1a9d39b02101d2dac9c5342d7e8c4f4de2f5277ef860b3a518c1cd823b9a8cee175dce11bf7f57c5016e8a60a6cec16244b2cbf81a67a1dc7a825c288fc694997bc70e2d456400"
}
```

The collator includes its own health check, which you can inspect with

```sh
docker inspect --format='{{json .State.Health}}' cumulus_collator_1
```

The check runs every 5 minutes, and takes about a minute to complete each time. Most of that time is spent sleeping; it remains a very lightweight process.
10 changes: 8 additions & 2 deletions docker/test-parachain-collator.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@ RUN time cargo build --release -p cumulus-test-parachain-collator
FROM debian:buster-slim as collator
RUN apt-get update && apt-get install jq curl bash -y && \
curl -sSo /wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
chmod +x /wait-for-it.sh
chmod +x /wait-for-it.sh && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs && \
npm install --global yarn && \
yarn global add @polkadot/[email protected]
COPY --from=builder \
/paritytech/cumulus/target/release/cumulus-test-parachain-collator /usr/bin
COPY ./scripts/inject_bootnodes.sh /usr/bin
CMD ["/usr/bin/inject_bootnodes.sh"]
COPY ./scripts/healthcheck.sh /usr/bin/
HEALTHCHECK --interval=300s --timeout=75s --start-period=30s --retries=3 \
CMD ["/usr/bin/healthcheck.sh"]

# the runtime stage is normally built once, cached, and ignored, but can be
# specified with the --target build flag. This just preserves one of the builder's
Expand All @@ -52,7 +59,6 @@ COPY --from=builder \
/var/opt/
CMD ["cp", "-v", "/var/opt/cumulus_test_parachain_runtime.compact.wasm", "/runtime/"]


FROM debian:buster-slim
COPY --from=builder \
/paritytech/cumulus/target/release/cumulus-test-parachain-collator /usr/bin
Expand Down
14 changes: 14 additions & 0 deletions scripts/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

head () {
polkadot-js-api --ws ws://172.28.1.1:9944 query.parachains.heads 100 |\
jq -r .heads
}

start=$(head)
sleep 60
end=$(head)

[ "$start" != "$end" ]