Closed evilrobot-01 closed 5 months ago
I run ZN in container well via nix. If you know nix you can find here https://github.com/ComposableFi/composable codespace and docker tools build, we publish devnet-picasso with zombienet on docker hub too.
Arm works sure (we have CI to check).
So we use nix built binaries.
@evilrobot-01 I find your approach very good, simple and elegant.
I am going to try to use it for my project to. @dzmitry-lahoda I dont understand what nix adds to make this work, do you have any idea?
@evilrobot-01 I can reproduce your problem.
While trying to debug it I accidentally made it work with the following Dockerfile:
FROM node:18
RUN curl -sL -o polkadot https://github.com/paritytech/polkadot/releases/download/v0.9.42/polkadot \
&& chmod +x polkadot \
&& mv polkadot /usr/local/bin;
RUN npm install -g @zombienet/cli
RUN useradd -m zombienet
USER zombienet
WORKDIR /home/zombienet
COPY ./config.toml .
CMD ["zombienet", "spawn", "/home/zombienet/config.toml", "-p", "native"]
I have no idea what the issue was, but it could be that the debian slim is too slim and something required by the stack is missing or that the pkg
tool used to distribute zombienet as a binary is docker unfriendly (perhaps init related issue?).
I have no idea, however, using zombienet from NPM is good for me.
does it work for you also?
we run devnet in many places
buildDevnetImage = { name, devNet, container-tools }:
pkgs.dockerTools.buildImage {
inherit name;
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [ devNet pkgs.glibc.bin ] ++ container-tools;
pathsToLink = [ "/bin" ];
};
config = {
Entrypoint =
[ "${pkgs.lib.getBin devNet}/bin/${pkgs.lib.getName devNet}" ];
Env = [ "USER=actions-runner" ];
};
runAsRoot = ''
#!${pkgs.runtimeShell}
${pkgs.dockerTools.shadowSetup}
# so we add 2 potential runners, CI and Codespace just for convenience
mkdir --parents /usr/bin /home/actions-runner /tmp/composable-devnet /home/vscode
chown 777 /tmp
chown 777 /tmp/composable-devnet
chown 777 /home/actions-runner
chown 777 /home/vscode
groupadd --system actions-runner
useradd --system --gid actions-runner --groups root actions-runner
'';
};
there is fix (so it is overshoots by making more changes because we run more than just zombie)
@evilrobot-01 I ended adjusting a bit the Dockerfile,
ARG POLKADOT_VERSION=latest
ARG PARACHAIN_VERSION=latest
FROM parity/polkadot:$POLKADOT_VERSION as relaybuilder
FROM parity/polkadot-parachain:$PARACHAIN_VERSION as parabuilder
FROM node:18
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=relaybuilder /usr/bin/polkadot /usr/local/bin
COPY --from=parabuilder /usr/local/bin/polkadot-parachain /usr/local/bin
RUN apt update \
&& apt install -y multitail \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g @zombienet/cli
COPY ./zombietail /usr/local/bin
RUN useradd -m zombienet
USER zombienet
WORKDIR /home/zombienet
RUN mkdir /home/zombienet/data
COPY ./config.toml .
VOLUME /home/zombienet/data
CMD ["zombienet", "spawn", "/home/zombienet/config.toml", "-p", "native", "-d","/home/zombienet/data", "-f"]
I will be using this as base for our DINFRA project zombienet
may be closed?
Issue Description
Attempting to bring up a network within a container using zombienet native provider, so that I can easily launch a PoC (including UI) via
docker-compose
with a single command.Encountered an issue where
polkadot
unexpectedly fails on startup of the alice validator, but seems to work fine if I attempt manually within the container, remove database after failure and relaunch validator using zombienet generated command.Note that I am on a mac M1, using
--platform linux/amd64
and have 'Use Rosetta for x86/amd64 emulation on Apple Silicon' enabled within Docker Desktop.Steps to reproduce the issue
Steps to reproduce the issue
Build image using
docker build --platform linux/amd64 -t zombienet .
and the followingDockerfile
and below simpleconfig.toml
:Dockerfile:
config.toml
Run using
docker run --platform linux/amd64 --rm zombienet
Describe the results you received
The following error is output:
The last successful log entry is
2023-07-24 10:23:54 ⛓ Native runtime: rococo-9420 (parity-rococo-v2.0-0.tx21.au0)
Further troubleshooting:
docker run --platform linux/amd64 --rm -it zombienet bash
zombienet spawn /usr/share/config.toml -p native
, which results in the above error but rarely also the following error which may be the root cause:rm /tmp/zombie-ccb0ce532a5e7271dc810608209bb9c8_-13-wdLrnoR0BZBZ/alice/data -rf
polkadot --chain /tmp/zombie...
command and the validator starts fine from within the container:Describe the results you expected
The validator nodes to be launched as normal, with output logs as shown when run manually.
Zombienet version
v1.3.63
Provider
Native
Provider version
Upstream Latest Release
Yes
Additional environment details
Mac M1: 13.4.1 Docker Desktop: 4.21.1
Additional information
I expect that this may be an unsupported case, but it would be useful to have this working so that one can easily bring up a full environment, with UI with something simple like docker-compose.
Screenshots
No response