-
Notifications
You must be signed in to change notification settings - Fork 140
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 7 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.
This file was deleted.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,54 @@ | ||||||
services: | ||||||
prometheus: | ||||||
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. why are we running prometheus in this docker-compose? 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 added Prometheus while testing the exported metric data from authority nodes, I decided to keep it in the same file to easily start a Prometheus server with authorities nodes, should I remove it? |
||||||
image: prom/prometheus | ||||||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
volumes: | ||||||
- ./../prometheus.yml:/etc/prometheus/prometheus.yml | ||||||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
command: | ||||||
- '--config.file=/etc/prometheus/prometheus.yml' | ||||||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- '--storage.tsdb.path=/prometheus' | ||||||
- '--web.console.libraries=/usr/share/prometheus/console_libraries' | ||||||
- '--web.console.templates=/usr/share/prometheus/consoles' | ||||||
ports: | ||||||
- 9090:9090 | ||||||
restart: always | ||||||
|
||||||
alice: | ||||||
platform: linux/amd64 | ||||||
build: | ||||||
context: ./.. | ||||||
dockerfile: devnet/substrate_alice.Dockerfile | ||||||
ports: | ||||||
- 30333 | ||||||
- 9933 | ||||||
- 9944 | ||||||
- 9615:9615 | ||||||
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.
Suggested change
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 make these exposed ports the same as gossamer? Or we should at least comment what the diff ports do. 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. Yes, it is possible! |
||||||
|
||||||
bob: | ||||||
platform: linux/amd64 | ||||||
build: | ||||||
context: ./.. | ||||||
dockerfile: devnet/substrate_bob.Dockerfile | ||||||
args: | ||||||
key: bob | ||||||
ports: | ||||||
- 30333 | ||||||
- 9933 | ||||||
- 9944 | ||||||
- 9615 | ||||||
depends_on: | ||||||
- alice | ||||||
|
||||||
charlie: | ||||||
platform: linux/amd64 | ||||||
build: | ||||||
context: ./.. | ||||||
dockerfile: devnet/substrate_bob.Dockerfile | ||||||
args: | ||||||
key: charlie | ||||||
ports: | ||||||
- 30333 | ||||||
- 9933 | ||||||
- 9944 | ||||||
- 9615 | ||||||
depends_on: | ||||||
- alice |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM parity/polkadot:v0.9.10 as polkadot | ||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FROM golang:1.17 | ||
|
||
ARG VERSION=v0.9.10 | ||
ARG DD_API_KEY=somekey | ||
ENV DD_API_KEY=${DD_API_KEY} | ||
ARG METRICS_NAMESPACE=substrate.local.devnet | ||
|
||
RUN apt-get update | ||
|
||
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)" | ||
|
||
COPY --from=polkadot /usr/bin/polkadot /usr/bin/polkadot | ||
COPY devnet/chain/gssmr/genesis-raw.json genesis-spec.json | ||
|
||
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 | ||
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 port is prometheus running on? 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. Changed substrate nodes to expose Prometheus at port 9876 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 port does substrate uses? Shouldn't we use the standard 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. by default the port 9090 is the one Prometheus docker image prom/prometheus uses to bootstrap its own server to collect metrics. I just standardized the port which substrate and gossamer will expose metrics 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. Yes but by default what's the port substrate/polkadot uses for Prometheus? We force it to As far as I know, applications usually have their Prom registry server listening on |
||
|
||
ENTRYPOINT ./polkadot \ | ||
--chain genesis-spec.json \ | ||
--alice \ | ||
--node-key 0000000000000000000000000000000000000000000000000000000000000000 \ | ||
--tmp \ | ||
--prometheus-external | ||
|
||
|
||
EXPOSE 30333 9933 9944 9615 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This is the build stage for Substrate. Here we create the binary. | ||
EclesioMeloJunior marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FROM parity/polkadot:v0.9.10 | ||
FROM docker.io/library/ubuntu:20.04 | ||
|
||
ARG key | ||
ARG DD_API_KEY=somekey | ||
ARG METRICS_NAMESPACE=substrate.local.devnet | ||
|
||
ENV key=${key} | ||
ENV DD_API_KEY=${DD_API_KEY} | ||
qdm12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
RUN test -n "$key" | ||
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)" | ||
|
||
COPY --from=polkadot /usr/bin/polkadot /usr/bin/polkadot | ||
COPY devnet/chain/gssmr/genesis-raw.json genesis-spec.json | ||
|
||
RUN go run cmd/update-dd-agent-confd/main.go -n=${METRICS_NAMESPACE} -t=key:${key} > /etc/datadog-agent/conf.d/openmetrics.d/conf.yaml | ||
|
||
ENTRYPOINT service datadog-agent start && /usr/bin/polkadot \ | ||
--bootnodes=/dns/substrate-alice/tcp/30333/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN \ | ||
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. if I were to use this Dockerfile to connect to a gossamer The libp2p id would have to be the same for both substrate and gossamer 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. Now both substrate and gossamer |
||
--chain genesis-spec.json \ | ||
--${key} \ | ||
--tmp \ | ||
--prometheus-external | ||
|
||
EXPOSE 30333 9933 9944 9615 |
Uh oh!
There was an error while loading. Please reload this page.