-
Notifications
You must be signed in to change notification settings - Fork 95
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
Blockade integration #83
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
33dca65
add docker files
andresilva 5fed371
update shell.nix with dependencies to build blockade
andresilva b71dc54
add new types for blockade configuration
andresilva ea4378b
generate blockade config
andresilva d3ab069
integrate blockade into launch process
andresilva 989fcc3
add blockade integration docs to readme
andresilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM debian:buster-slim | ||
|
||
# install tools and dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
clang cmake curl git pkg-config && \ | ||
# 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/adder-collator | ||
|
||
# install rust toolchain | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ | ||
export PATH="$PATH:$HOME/.cargo/bin" && \ | ||
rustup toolchain install nightly && \ | ||
rustup target add wasm32-unknown-unknown --toolchain nightly && \ | ||
rustup default stable | ||
|
||
# clone polkadot. the trick of using the github API will make the docker cache | ||
# invalidate when there's a new commit. | ||
ADD https://api.github.com/repos/paritytech/polkadot/git/refs/heads/rococo-v1 version.json | ||
RUN git clone -b rococo-v1 https://github.com/paritytech/polkadot.git /tmp/polkadot | ||
|
||
# build polkadot | ||
RUN cd /tmp/polkadot && \ | ||
export PATH="$PATH:$HOME/.cargo/bin" && \ | ||
cargo build --release -p test-parachain-adder-collator && \ | ||
cp /tmp/polkadot/target/release/adder-collator /usr/local/bin | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
USER adder-collator | ||
|
||
# check if executable works in this container | ||
RUN /usr/local/bin/adder-collator --version | ||
|
||
EXPOSE 30333 9933 9944 | ||
VOLUME ["/adder-collator"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/adder-collator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env sh | ||
|
||
echo 'Building polkadot docker image' | ||
docker build -f polkadot.Dockerfile . --tag=polkadot | ||
|
||
echo 'Building cumulus docker image' | ||
docker build -f cumulus.Dockerfile . --tag=cumulus | ||
|
||
echo 'Building adder collator docker image' | ||
docker build -f adder-collator.Dockerfile . --tag=adder-collator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM debian:buster-slim | ||
|
||
# install tools and dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
clang cmake curl git pkg-config && \ | ||
# 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/cumulus to /data | ||
useradd -m -u 1000 -U -s /bin/sh -d /cumulus cumulus && \ | ||
mkdir -p /data /cumulus/.local/share && \ | ||
chown -R cumulus:cumulus /data && \ | ||
ln -s /data /cumulus/.local/share/cumulus | ||
|
||
# install rust toolchain | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ | ||
export PATH="$PATH:$HOME/.cargo/bin" && \ | ||
rustup toolchain install nightly && \ | ||
rustup target add wasm32-unknown-unknown --toolchain nightly && \ | ||
rustup default stable | ||
|
||
# clone cumulus. the trick of using the github API will make the docker cache | ||
# invalidate when there's a new commit. | ||
ADD https://api.github.com/repos/paritytech/cumulus/git/refs/heads/rococo-v1 version.json | ||
RUN git clone -b rococo-v1 https://github.com/paritytech/cumulus.git /tmp/cumulus | ||
|
||
# build cumulus | ||
RUN cd /tmp/cumulus && \ | ||
export PATH="$PATH:$HOME/.cargo/bin" && \ | ||
cargo build --release -p rococo-collator && \ | ||
cp /tmp/cumulus/target/release/rococo-collator /usr/local/bin | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
USER cumulus | ||
|
||
# check if executable works in this container | ||
RUN /usr/local/bin/rococo-collator --version | ||
|
||
EXPOSE 30333 9933 9944 | ||
VOLUME ["/cumulus"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/rococo-collator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM debian:buster-slim | ||
|
||
# install tools and dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
clang cmake curl git pkg-config && \ | ||
# 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/polkadot to /data | ||
useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ | ||
mkdir -p /data /polkadot/.local/share && \ | ||
chown -R polkadot:polkadot /data && \ | ||
ln -s /data /polkadot/.local/share/polkadot | ||
|
||
# install rust toolchain | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ | ||
export PATH="$PATH:$HOME/.cargo/bin" && \ | ||
rustup toolchain install nightly && \ | ||
rustup target add wasm32-unknown-unknown --toolchain nightly && \ | ||
rustup default stable | ||
|
||
# clone polkadot. the trick of using the github API will make the docker cache | ||
# invalidate when there's a new commit. | ||
ADD https://api.github.com/repos/paritytech/polkadot/git/refs/heads/rococo-v1 version.json | ||
RUN git clone -b rococo-v1 https://github.com/paritytech/polkadot.git /tmp/polkadot | ||
|
||
# build polkadot | ||
RUN cd /tmp/polkadot && \ | ||
export PATH="$PATH:$HOME/.cargo/bin" && \ | ||
cargo build --release && \ | ||
cp /tmp/polkadot/target/release/polkadot /usr/local/bin | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
USER polkadot | ||
|
||
# check if executable works in this container | ||
RUN /usr/local/bin/polkadot --version | ||
|
||
EXPOSE 30333 9933 9944 | ||
VOLUME ["/polkadot"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/polkadot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
let | ||
polkadot-launch = pkgs.callPackage ./default.nix { }; | ||
in | ||
pkgs.mkShell { | ||
|
||
with pkgs; mkShell { | ||
buildInputs = [ | ||
polkadot-launch | ||
nodejs | ||
python27 | ||
python27Packages.pip | ||
python27Packages.setuptools | ||
stdenv | ||
yarn | ||
yarn2nix | ||
]; | ||
|
||
shellHook = '' | ||
# Tells pip to put packages into $PIP_PREFIX instead of the usual locations. | ||
# See https://pip.pypa.io/en/stable/user_guide/#environment-variables. | ||
export PIP_PREFIX=${toString ./.}/_build/pip_packages | ||
export PYTHONPATH="$PIP_PREFIX/${python27.sitePackages}:$PYTHONPATH" | ||
export PATH="$PIP_PREFIX/bin:$PATH" | ||
unset SOURCE_DATE_EPOCH | ||
# NOTE: the line below is commented as this is not compatible with lorri | ||
# pip install blockade | ||
''; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
following the docs, shouldn't this be
./docker/polkadot.Dockerfile
?