This question follows those questions below:
Q1 Zombienet: how to test custom parachain collator - block height(producing blocks) test
Q2 Zombienet: Substrate-Parachain-Template ... block height(block producing) test failed
Regarding this Docker template: https://github.com/paritytech/polkadot/blob/master/scripts/ci/dockerfiles/collator_injected.Dockerfile, I got this answer from Q2 is "yes you can that one and add the build phase to inject then the binary."
That Dockerfile for making adder-collator image:
# this file copies from scripts/ci/dockerfiles/Dockerfile and changes only the binary name
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG IMAGE_NAME
LABEL io.parity.image.authors="[email protected]" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.title="${IMAGE_NAME}" \
io.parity.image.description="Injected adder-collator Docker image" \
io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/collator_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/"
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl1.1 \
ca-certificates && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
find /var/lib/apt/lists/ -type f -not -name lock -delete; \
# add user and link ~/.local/share/adder-collator to /data
useradd -m -u 1000 -U -s /bin/sh -d /adder-collator adder-collator && \
mkdir -p /data /adder-collator/.local/share && \
chown -R adder-collator:adder-collator /data && \
ln -s /data /adder-collator/.local/share/polkadot
# add adder-collator binary to docker image
COPY ./adder-collator /usr/local/bin
COPY ./undying-collator /usr/local/bin
USER adder-collator
# check if executable works in this container
RUN /usr/local/bin/adder-collator --version
RUN /usr/local/bin/undying-collator --version
EXPOSE 30333 9933 9944
VOLUME ["/adder-collator"]
ENTRYPOINT ["/usr/local/bin/adder-collator"]
Then I used that to make my parachain collator image:
FROM gcr.io/p-network-202104/collator:c1 AS builder
# This c1 image has all the substrate-parachain-template code compiled
FROM debian@sha256:6ef4731388c03b38e58ea77aef9396c216095e1843742fc7cf5038901cc1f081
#FROM debian:stretch-slim
#buster-slim
COPY --from=builder ./builds/collator/target/release/parachain-collator /usr/local/bin
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl1.1 \
ca-certificates && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
find /var/lib/apt/lists/ -type f -not -name lock -delete; \
# add user and link ~/.local/share/adder-collator to /data
useradd -m -u 1000 -U -s /bin/sh -d /adder-collator adder-collator && \
mkdir -p /data /adder-collator/.local/share && \
chown -R adder-collator:adder-collator /data && \
ln -s /data /adder-collator/.local/share/polkadot
# adder-collator and undying-collator are not found. do I need them?
#COPY ./adder-collator /usr/local/bin
#COPY ./undying-collator /usr/local/bin
USER adder-collator
# adder-collator and undying-collator are not found
#RUN /usr/local/bin/adder-collator --version
#RUN /usr/local/bin/undying-collator --version
# adding code for new parachain collator
RUN /usr/local/bin/parachain-collator --version
EXPOSE 30333 9933 9944
VOLUME ["/adder-collator"]
#ENTRYPOINT ["/usr/local/bin/adder-collator"] ... files not found
ENTRYPOINT ["/usr/local/bin/parachain-collator"]
In above Dockerfile, I removed adder-collator
and undying-collator
because they are not in the Substrate-Parachain-template repo. Do I need them?
My Zombienet network definition:
[relaychain]
default_image = "docker.io/parity/polkadot:v0.9.18"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]
chain = "rococo-local"
[[relaychain.nodes]]
name = "alice"
validator = true
[[relaychain.nodes]]
name = "bob"
validator = true
[[parachains]]
id = 2000
cumulus_based = true
[parachains.collator]
name = "collator01"
image = "gcr.io/p-network-202104/collator:t5"
command = "parachain-collator"
[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
I made an image from the above Dockerfile, then ran the same Zombienet tests as those in my previous posts. But the test failed for the same error: parachain block height is still zero
About ENTRYPOINT, what executable should I put there?
Should I use parachain-collator
in ENTRYPOINT?
ENTRYPOINT ["/usr/local/bin/parachain-collator"]
The code repo: https://github.com/AuroraLantean/-substrate-parachain-template0918