-
Notifications
You must be signed in to change notification settings - Fork 146
feat(devnet): add substrate docker images to dockerfile #2263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6139712
8c3fb1d
c0be6dc
eda4e4a
dae59e2
6ccf8fb
1407b3a
0d59fac
5108412
9fa7ffb
71a8f5e
f1fea2d
9b485f6
cff9c8c
262b329
012b4b9
1d158a3
f0689ee
604ce4b
237647a
ae0429e
843d361
bcb134e
579136c
c49bcf0
f03093a
25946ca
e8c1e9d
15f1377
94c6a87
17fd1f2
aacb438
a382561
ca63faa
a4bd83c
e476e23
e12686d
03c89c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| services: | ||
| alice: | ||
| platform: linux/amd64 | ||
| build: | ||
| context: ./.. | ||
| dockerfile: devnet/substrate_alice.Dockerfile | ||
| args: | ||
| DD_API_KEY: ${DD_API_KEY} | ||
| ports: | ||
| - 7001 | ||
| - 8545 | ||
| - 8546 | ||
| - 9876 | ||
|
|
||
| bob: | ||
| platform: linux/amd64 | ||
| build: | ||
| context: ./.. | ||
| dockerfile: devnet/substrate_bob.Dockerfile | ||
| args: | ||
| key: bob | ||
| DD_API_KEY: ${DD_API_KEY} | ||
| ports: | ||
| - 7001 | ||
| - 8545 | ||
| - 8546 | ||
| - 9876 | ||
| depends_on: | ||
| - alice | ||
|
|
||
| charlie: | ||
| platform: linux/amd64 | ||
| build: | ||
| context: ./.. | ||
| dockerfile: devnet/substrate_bob.Dockerfile | ||
| args: | ||
| key: charlie | ||
| DD_API_KEY: ${DD_API_KEY} | ||
| ports: | ||
| - 7001 | ||
| - 8545 | ||
| - 8546 | ||
| - 9876 | ||
| depends_on: | ||
| - alice |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Copyright 2022 ChainSafe Systems (ON) | ||
| # SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| ARG POLKADOT_VERSION=v0.9.10 | ||
|
|
||
| FROM golang:1.17 as openmetrics | ||
| ARG METRICS_NAMESPACE=substrate.local.devnet | ||
|
|
||
| WORKDIR /devnet | ||
|
|
||
| COPY ./devnet/go.mod ./devnet/go.sum ./ | ||
| RUN go mod download | ||
|
Comment on lines
+11
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this? won't
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for Docker layer caching, so dependencies are cached and rebuilds will be faster. |
||
|
|
||
| COPY ./devnet . | ||
| RUN go run cmd/update-dd-agent-confd/main.go -n=${METRICS_NAMESPACE} -t=key:alice > conf.yaml | ||
|
|
||
| FROM parity/polkadot:${POLKADOT_VERSION} | ||
|
|
||
| ARG POLKADOT_VERSION | ||
| # Using a genesis file with 3 authority nodes (alice, bob, charlie) generated using polkadot $POLKADOT_VERSION | ||
| ARG CHAIN=3-auth-node-${POLKADOT_VERSION} | ||
| ARG DD_API_KEY=somekey | ||
|
|
||
| ENV DD_API_KEY=${DD_API_KEY} | ||
| ENV CHAIN=${CHAIN} | ||
|
|
||
| USER root | ||
| RUN gpg --recv-keys --keyserver hkps://keys.mailvelope.com 9D4B2B6EB8F97156D19669A9FF0812D491B96798 | ||
| RUN gpg --export 9D4B2B6EB8F97156D19669A9FF0812D491B96798 > /usr/share/keyrings/parity.gpg | ||
| RUN apt update && apt install -y curl && rm -r /var/cache/* /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /cross-client | ||
|
|
||
| RUN curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh --output install_script.sh && \ | ||
| chmod +x ./install_script.sh | ||
|
|
||
| RUN DD_AGENT_MAJOR_VERSION=7 DD_INSTALL_ONLY=true DD_SITE="datadoghq.com" ./install_script.sh | ||
| COPY --from=openmetrics /devnet/conf.yaml /etc/datadog-agent/conf.d/openmetrics.d/ | ||
|
|
||
| USER polkadot | ||
|
|
||
| COPY ./devnet/chain ./chain/ | ||
|
|
||
| # The substrate node-key argument should be a 32 bytes long sr25519 secret key | ||
| # while gossamer nodes uses a 64 bytes long sr25519 key (32 bytes long to secret key + 32 bytes long to public key). | ||
| # Then to keep both substrate and gossamer alice nodes with the same libp2p node keys we just need to use | ||
| # the first 32 bytes from `alice.node.key` which means the 32 bytes long sr25519 secret key used here. | ||
| ENTRYPOINT service datadog-agent start && /usr/bin/polkadot \ | ||
| --chain ./chain/$CHAIN/genesis-raw.json \ | ||
| --alice \ | ||
| --port 7001 \ | ||
| --rpc-port 8545 \ | ||
| --ws-port 8546 \ | ||
| --node-key "93ce444331ced4d2f7bfb8296267544e20c2591dbf310c7ea3af672f2879cf8f" \ | ||
| --tmp \ | ||
| --prometheus-external \ | ||
qdm12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --prometheus-port 9876 \ | ||
| --unsafe-rpc-external \ | ||
| --unsafe-ws-external | ||
|
|
||
| EXPOSE 7001/tcp 8545/tcp 8546/tcp 9876/tcp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Copyright 2022 ChainSafe Systems (ON) | ||
| # SPDX-License-Identifier: LGPL-3.0-only | ||
| ARG POLKADOT_VERSION=v0.9.10 | ||
| FROM golang:1.17 as openmetrics | ||
|
|
||
| ARG METRICS_NAMESPACE=substrate.local.devnet | ||
|
|
||
| WORKDIR /devnet | ||
|
|
||
| COPY ./devnet/go.mod ./devnet/go.sum ./ | ||
| RUN go mod download | ||
|
|
||
| COPY ./devnet . | ||
| RUN go run cmd/update-dd-agent-confd/main.go -n=${METRICS_NAMESPACE} -t=key:alice > conf.yaml | ||
|
|
||
| FROM parity/polkadot:${POLKADOT_VERSION} | ||
|
|
||
| ARG POLKADOT_VERSION | ||
| # Using a genesis file with 3 authority nodes (alice, bob, charlie) generated using polkadot $POLKADOT_VERSION | ||
| ARG CHAIN=3-auth-node-${POLKADOT_VERSION} | ||
| ARG DD_API_KEY=somekey | ||
| ARG key | ||
|
|
||
| ENV DD_API_KEY=${DD_API_KEY} | ||
qdm12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ENV CHAIN=${CHAIN} | ||
| ENV key=${key} | ||
|
|
||
| USER root | ||
| RUN gpg --recv-keys --keyserver hkps://keys.mailvelope.com 9D4B2B6EB8F97156D19669A9FF0812D491B96798 | ||
| RUN gpg --export 9D4B2B6EB8F97156D19669A9FF0812D491B96798 > /usr/share/keyrings/parity.gpg | ||
|
Comment on lines
+29
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are these for?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was getting problem in the |
||
|
|
||
| RUN apt update && apt install -y curl && rm -r /var/cache/* /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /cross-client | ||
|
|
||
| RUN curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh --output install_script.sh && \ | ||
| chmod +x ./install_script.sh | ||
|
|
||
| RUN DD_AGENT_MAJOR_VERSION=7 DD_INSTALL_ONLY=true DD_SITE="datadoghq.com" ./install_script.sh | ||
| COPY --from=openmetrics /devnet/conf.yaml /etc/datadog-agent/conf.d/openmetrics.d/ | ||
|
|
||
| USER polkadot | ||
|
|
||
| COPY ./devnet/chain ./chain/ | ||
|
|
||
| ENTRYPOINT service datadog-agent start && /usr/bin/polkadot \ | ||
| --bootnodes /dns/alice/tcp/7001/p2p/12D3KooWMER5iow67nScpWeVqEiRRx59PJ3xMMAYPTACYPRQbbWU \ | ||
| --chain chain/$CHAIN/genesis-raw.json \ | ||
| --port 7001 \ | ||
| --rpc-port 8545 \ | ||
| --ws-port 8546 \ | ||
| --${key} \ | ||
| --tmp \ | ||
| --prometheus-external \ | ||
| --prometheus-port 9876 \ | ||
| --unsafe-rpc-external \ | ||
| --unsafe-ws-external | ||
|
|
||
| EXPOSE 7001/tcp 8545/tcp 8546/tcp 9876/tcp | ||
Uh oh!
There was an error while loading. Please reload this page.