-
Notifications
You must be signed in to change notification settings - Fork 129
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
feat(devnet): add substrate docker images to dockerfile #2263
Changes from 2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,48 @@ | ||
FROM parity/polkadot:v0.9.10 AS polkadot | ||
FROM golang:1.17 | ||
# Copyright 2022 ChainSafe Systems (ON) | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
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:v0.9.17 | ||
|
||
ARG CHAIN=cross-client | ||
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 is the difference between the 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. Both have 3 authority nodes, however, the
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. Ideally we should have one chain all cross client, and gossamer only setups. We may end up having multiple of these chains that differ based on number of authority nodes. @kishansagathiya is working on secondary vrf slot mode for babe #2307. We need to ensure that the genesis file is using this mode and we should be updating to v0.9.16 of polkadot. It would be nice to have some sort of readme or something in the devnet readme that describes how to generate these files. I know you were following the steps provided by Kishan, but where did the original genesis-spec.json come from? What pallets are in the runtime? These are questions we should have answers to. It may make sense to have another repo and associated github CI workflows to generate these genesis files that the devnets can pull down as part of the docker image build process. Rather than just putting arbitrary files in this repo. 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.
And then you run something like this to get a genesis.json file Will make a pr to add this to read me. New versions have a different genesis-spec file than 0.9.10. 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. can we rename this to something more descriptive. 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. Also we could have i.e. ARG POLKADOT_VERSION=v0.9.10
FROM parity/polkadot:${POLKADOT_VERSION} AS polkadot
FROM golang:1.17
ARG CHAIN=3-auth-node-${POLKADOT_VERSION} 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. @qdm12 I was having problems trying to use arguments declared before Basically, all the
|
||
ARG VERSION=v0.9.10 | ||
ARG DD_API_KEY=somekey | ||
ARG METRICS_NAMESPACE=substrate.local.devnet | ||
|
||
ENV CHAIN=${CHAIN} | ||
ENV DD_API_KEY=${DD_API_KEY} | ||
ENV CHAIN=${CHAIN} | ||
|
||
RUN DD_AGENT_MAJOR_VERSION=7 DD_INSTALL_ONLY=true DD_SITE="datadoghq.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh)" | ||
USER root | ||
RUN apt update && apt install -y curl | ||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
COPY --from=polkadot /usr/bin/polkadot /usr/bin/polkadot | ||
WORKDIR /cross-client | ||
|
||
WORKDIR /gossamer | ||
RUN curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh --output install_script.sh && \ | ||
chmod +x ./install_script.sh | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
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/ | ||
|
||
COPY . . | ||
RUN service datadog-agent start | ||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
WORKDIR /gossamer/devnet | ||
USER polkadot | ||
|
||
RUN go run cmd/update-dd-agent-confd/main.go -n=${METRICS_NAMESPACE} -t=key:alice > /etc/datadog-agent/conf.d/openmetrics.d/conf.yaml | ||
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 \ | ||
ENTRYPOINT /usr/bin/polkadot \ | ||
--chain ./chain/$CHAIN/genesis-raw.json \ | ||
--alice \ | ||
--port 7001 \ | ||
--rpc-port 8545 \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this? won't
go run ...
on line 13 just auto-download dependencies?There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.