Skip to content
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(cross-client): create docker-compose.yml for local devnet #2282

Merged
merged 33 commits into from
Mar 28, 2022
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6139712
feat: include substrate docker image
EclesioMeloJunior Jan 31, 2022
8c3fb1d
chore: add substrate docker images
EclesioMeloJunior Feb 2, 2022
c0be6dc
chore: formatting and add depends on yaml key
EclesioMeloJunior Feb 2, 2022
eda4e4a
chore: add datadog stuff again
EclesioMeloJunior Feb 2, 2022
dae59e2
chore: use alice peer id
EclesioMeloJunior Feb 2, 2022
6ccf8fb
chore: split substrate docker compose services into another file
EclesioMeloJunior Feb 2, 2022
1407b3a
chore: enable prometheus external and add datadog
EclesioMeloJunior Feb 2, 2022
0d59fac
Merge branch 'development' into eclesio/substrate-docker-image
EclesioMeloJunior Feb 4, 2022
5108412
chore: keep substrate ports same as gossamer node ports
EclesioMeloJunior Feb 4, 2022
9fa7ffb
chore: expose rpc and ws calls in substrate docker file
EclesioMeloJunior Feb 4, 2022
71a8f5e
chore: use same dns name and p2p id
EclesioMeloJunior Feb 4, 2022
f1fea2d
chore: use same key for both alice gossamer and substrate nodes
EclesioMeloJunior Feb 4, 2022
9b485f6
chore: fix dd golang cmd
EclesioMeloJunior Feb 4, 2022
cff9c8c
Update devnet/README.md
EclesioMeloJunior Feb 7, 2022
262b329
Update devnet/README.md
EclesioMeloJunior Feb 7, 2022
012b4b9
chore: update `substrate_alice` readme info
EclesioMeloJunior Feb 7, 2022
1d158a3
Update devnet/README.md
EclesioMeloJunior Feb 7, 2022
f0689ee
chore: add `/tcp` to expose ports
EclesioMeloJunior Feb 7, 2022
604ce4b
Merge branch 'eclesio/substrate-docker-image' of github.com:ChainSafe…
EclesioMeloJunior Feb 7, 2022
237647a
chore: adjust args and envs
EclesioMeloJunior Feb 7, 2022
ae0429e
chore: pin prometheus version, add read only volume and add trailing …
EclesioMeloJunior Feb 7, 2022
843d361
chore: improve README.md
EclesioMeloJunior Feb 7, 2022
bcb134e
Merge branch 'development' into eclesio/substrate-docker-image
EclesioMeloJunior Feb 7, 2022
579136c
chore: add port 7001 explicitly
EclesioMeloJunior Feb 7, 2022
17e4d2d
chore: use a custome entrypoint
EclesioMeloJunior Feb 8, 2022
f66898c
chore: update genesis with version 9100
EclesioMeloJunior Feb 9, 2022
e37cb77
Merge branch 'development' into eclesio/cross-client-docker-compose
EclesioMeloJunior Mar 14, 2022
a84b87d
chore: use only one genesis
EclesioMeloJunior Mar 14, 2022
ea33699
chore: remove `chain` argument from cross-client/docker-compose.yml
EclesioMeloJunior Mar 14, 2022
65f1d31
chore: bind pprof port to bob gossamer node
EclesioMeloJunior Mar 22, 2022
5350fc9
Merge branch 'development' into eclesio/cross-client-docker-compose
EclesioMeloJunior Mar 24, 2022
8d86312
adding trailing new line
EclesioMeloJunior Mar 28, 2022
a735532
chore: add comment about ports
EclesioMeloJunior Mar 28, 2022
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
Next Next commit
feat: include substrate docker image
EclesioMeloJunior committed Jan 31, 2022
commit 6139712a85025f9f7258ca81caabf9068e21d4e1
10 changes: 5 additions & 5 deletions devnet/alice.Dockerfile
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@

FROM golang:1.17

ARG DD_API_KEY=somekey
ENV DD_API_KEY=${DD_API_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)"
#ARG DD_API_KEY=somekey
#ENV DD_API_KEY=${DD_API_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)"

WORKDIR /gossamer

@@ -28,10 +28,10 @@ ARG METRICS_NAMESPACE=gossamer.local.devnet

WORKDIR /gossamer/devnet

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
# 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

WORKDIR /gossamer

ENTRYPOINT service datadog-agent start && gossamer --key=alice --babe-lead --publish-metrics --rpc --rpc-external=true --pubdns=alice
ENTRYPOINT gossamer --key=alice --babe-lead --publish-metrics --rpc --rpc-external=true --pubdns=alice

EXPOSE 7001/tcp 8545/tcp 8546/tcp 8540/tcp 9876/tcp
10 changes: 5 additions & 5 deletions devnet/bob.Dockerfile
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@

FROM golang:1.17

ARG DD_API_KEY=somekey
ENV DD_API_KEY=${DD_API_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)"
#ARG DD_API_KEY=somekey
#ENV DD_API_KEY=${DD_API_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)"

WORKDIR /gossamer

@@ -29,10 +29,10 @@ ARG METRICS_NAMESPACE=gossamer.local.devnet

WORKDIR /gossamer/devnet

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
# 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

WORKDIR /gossamer

ENTRYPOINT service datadog-agent start && gossamer --key=${key} --bootnodes=/dns/alice/tcp/7001/p2p/12D3KooWMER5iow67nScpWeVqEiRRx59PJ3xMMAYPTACYPRQbbWU --publish-metrics --rpc --pubdns=${key}
ENTRYPOINT gossamer --key=${key} --bootnodes=/dns/alice/tcp/7001/p2p/12D3KooWMER5iow67nScpWeVqEiRRx59PJ3xMMAYPTACYPRQbbWU --publish-metrics --rpc --pubdns=${key}

EXPOSE 7001/tcp 8545/tcp 8546/tcp 8540/tcp 9876/tcp
16 changes: 16 additions & 0 deletions devnet/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
alice:
platform: linux/amd64
build:
context: ./..
dockerfile: devnet/alice.Dockerfile
@@ -13,6 +14,7 @@ services:
- 9876

bob:
platform: linux/amd64
build:
context: ./..
dockerfile: devnet/bob.Dockerfile
@@ -29,6 +31,7 @@ services:
- alice

charlie:
platform: linux/amd64
build:
context: ./..
dockerfile: devnet/bob.Dockerfile
@@ -41,5 +44,18 @@ services:
- 8546
- 8540
- 9876
depends_on:
- alice

substrate:
platform: linux/amd64
build:
context: ./..
dockerfile: devnet/substrate.Dockerfile
ports:
- 30333
- 9933
- 9944
- 9615
depends_on:
- alice
43 changes: 43 additions & 0 deletions devnet/substrate.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This is the build stage for Substrate. Here we create the binary.
FROM docker.io/paritytech/ci-linux:production as builder

WORKDIR /substrate
COPY . /substrate
RUN cargo build --locked --release

# This is the 2nd stage: a very small image where we copy the Substrate binary."
FROM docker.io/library/ubuntu:20.04
RUN cp -f devnet/chain/gssmr/genesis-spec.json chain/gssmr/genesis-spec.json

LABEL description="Multistage Docker image for Substrate: a platform for web3" \
io.parity.image.type="builder" \
io.parity.image.authors="[email protected], [email protected]" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.description="Substrate is a next-generation framework for blockchain innovation 🚀" \
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/docker/substrate_builder.Dockerfile" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/"

COPY --from=builder /substrate/target/release/substrate /usr/local/bin
COPY --from=builder /substrate/target/release/subkey /usr/local/bin
COPY --from=builder /substrate/target/release/node-template /usr/local/bin
COPY --from=builder /substrate/target/release/chain-spec-builder /usr/local/bin

RUN useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate && \
mkdir -p /data /substrate/.local/share/substrate && \
chown -R substrate:substrate /data && \
ln -s /data /substrate/.local/share/substrate && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# Sanity checks
ldd /usr/local/bin/substrate && \
/usr/local/bin/substrate --version

USER substrate

ENTRYPOINT /usr/local/bin/substrate \
--bootnodes=/dns/alice/tcp/7001/p2p/12D3KooWMER5iow67nScpWeVqEiRRx59PJ3xMMAYPTACYPRQbbWU \
--chain chain/gssmr/genesis-spec.json \
--tmp

EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]