From 24f793e5de6637895380f0e24dfc13630d8d3a90 Mon Sep 17 00:00:00 2001 From: Carl Norburn Date: Fri, 19 Jul 2024 15:27:35 +0100 Subject: [PATCH 1/6] testing condor docker build --- .gitignore | 1 + Dockerfile | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 281be19..8be79ba 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /tmp result venv +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8ecb2f9..1200f16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,15 @@ FROM debian:buster AS build # Allow users to specify forked node, or specific commit # If not fallback to release branch (or alternatively just specify branch) ARG NODE_REPO=https://github.com/casper-network/casper-node.git -ARG NODE_COMMIT= ARG CLIENT_REPO=https://github.com/casper-ecosystem/casper-client-rs.git -ARG CLIENT_COMMIT= -ARG NODE_GITBRANCH=release-1.5.6 +ARG SIDECAR_REPO=https://github.com/casper-network/casper-sidecar.git + +ARG NODE_COMMIT= +ARG NODE_GITBRANCH=feat-2.0 ARG CLIENT_GITBRANCH=release-2.0.0 +ARG CLIENT_COMMIT= +ARG SIDECAR_GITBRANCH=feat-2.0 +ARG SIDECAR_COMMIT= RUN apt-get update \ && DEBIAN_FRONTEND="noninteractive" \ @@ -38,7 +42,12 @@ RUN if [ -n "$NODE_COMMIT" ]; then \ git clone -b $CLIENT_COMMIT $CLIENT_REPO; \ else \ git clone -b $CLIENT_GITBRANCH $CLIENT_REPO; \ - fi + fi \ + && if [ -n "$SIDECAR_COMMIT" ]; then \ + git clone $SIDECAR_REPO && cd casper-sidecar && git checkout $SIDECAR_COMMIT && cd ..; \ + else \ + git clone -b $SIDECAR_GITBRANCH $SIDECAR_REPO; \ + fi \ # Local CCTL source code. COPY ./cmds ./cctl/cmds @@ -76,6 +85,7 @@ WORKDIR /home/cctl COPY --from=build --chown=cctl:cctl /casper-node-launcher ./casper-node-launcher COPY --from=build --chown=cctl:cctl /casper-client-rs ./casper-client-rs COPY --from=build --chown=cctl:cctl /casper-node ./casper-node +COPY --from=build --chown=cctl:cctl /casper-sidecar ./casper-sidecar COPY --from=build --chown=cctl:cctl /cctl ./cctl ENV CCTL="/home/cctl/cctl" @@ -85,7 +95,7 @@ RUN echo "source $CCTL/activate" >> .bashrc COPY --chown=cctl:cctl ./docker/start.sh . RUN chmod +x start.sh -EXPOSE 11101-11105 14101-14105 18101-18105 +EXPOSE 11101-11105 14101-14105 18101-18105 25101-25101 HEALTHCHECK --interval=10s --timeout=5s --retries=4 --start-period=20s \ CMD curl --silent --location 'http://127.0.0.1:11101/rpc' --header 'Content-Type: application/json' --data '{"id": "1", "jsonrpc": "2.0", "method": "info_get_status", "params": []}' | jq -e -n 'input.result.reactor_state' | grep "Validate" From 5be08e8eade757d00f6325cf812e5461878ab753 Mon Sep 17 00:00:00 2001 From: Carl Norburn Date: Fri, 19 Jul 2024 15:34:50 +0100 Subject: [PATCH 2/6] docker script changes --- docker/clean.sh | 5 +++-- docker/start.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/clean.sh b/docker/clean.sh index f3a2e99..76aa0ea 100644 --- a/docker/clean.sh +++ b/docker/clean.sh @@ -13,8 +13,9 @@ rm -r casper-node-launcher/target/release/.fingerprint rm -r casper-client-rs/target/release/build rm -r casper-client-rs/target/release/deps rm -r casper-client-rs/target/release/.fingerprint +rm -r casper-sidecar/target/release/build +rm -r casper-sidecar/target/release/deps +rm -r casper-sidecar/target/release/.fingerprint rm -r casper-node/.git rm -r casper-client-rs/.git rm -r casper-node-launcher/.git -rm -r casper-node/utils/nctl -rm -r casper-node/utils/nctl-metrics diff --git a/docker/start.sh b/docker/start.sh index 8fe8d20..d87c450 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -1,7 +1,7 @@ #!/bin/bash source $CCTL/activate -source $CCTL/cmds/infra/net/setup.sh -source $CCTL/cmds/infra/net/start.sh +source $CCTL/cmds/infra/net/ctl_setup.sh +source $CCTL/cmds/infra/net/ctl_start.sh tail -f $CCTL/assets/nodes/node-1/logs/node-stderr.log From a1f699ecdb2a0d903c4f223c716f5f939808adeb Mon Sep 17 00:00:00 2001 From: Carl Norburn Date: Fri, 19 Jul 2024 15:37:45 +0100 Subject: [PATCH 3/6] Remove line continuation --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1200f16..a99aad6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ RUN if [ -n "$NODE_COMMIT" ]; then \ git clone $SIDECAR_REPO && cd casper-sidecar && git checkout $SIDECAR_COMMIT && cd ..; \ else \ git clone -b $SIDECAR_GITBRANCH $SIDECAR_REPO; \ - fi \ + fi # Local CCTL source code. COPY ./cmds ./cctl/cmds From 822fd6f15a51d92d245d988d745d7885edf2955f Mon Sep 17 00:00:00 2001 From: Carl Norburn Date: Mon, 22 Jul 2024 09:17:39 +0100 Subject: [PATCH 4/6] update README --- docker/README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docker/README.md b/docker/README.md index a1634ad..33e138d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -97,21 +97,17 @@ docker exec -t -i cspr-cctl /bin/bash cctl-chain-view-genesis-chainspec ``` -[TODO: Add a deploy example] - To view how cctl can be used within a project view the following Terminus SDK test projects: -[TODO: Add the links once the Terminus project have migrated to CCTL] - -- Java +- [Java](https://github.com/casper-sdks/terminus-java-tests) -- Python +- [Python](https://github.com/casper-sdks/terminus-python-tests) -- Go +- [Go](https://github.com/casper-sdks/terminus-go-tests) -- JS +- [JS](https://github.com/casper-sdks/terminus-js-tests) -- C# +- [C#](https://github.com/casper-sdks/terminus-dotnet-tests) ### Pre-built images From 686f53fce12a6fd2e7b7590430eaf8902c22f01e Mon Sep 17 00:00:00 2001 From: Carl Norburn Date: Mon, 22 Jul 2024 12:07:13 +0100 Subject: [PATCH 5/6] PR changes --- Dockerfile | 14 +++++++------- docker/clean.sh | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a99aad6..52ecd8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,10 @@ ARG CLIENT_REPO=https://github.com/casper-ecosystem/casper-client-rs.git ARG SIDECAR_REPO=https://github.com/casper-network/casper-sidecar.git ARG NODE_COMMIT= -ARG NODE_GITBRANCH=feat-2.0 -ARG CLIENT_GITBRANCH=release-2.0.0 +ARG NODE_GITBRANCH=release-2.0.0-rc3 +ARG CLIENT_GITBRANCH=feat-track-node-2.0 ARG CLIENT_COMMIT= -ARG SIDECAR_GITBRANCH=feat-2.0 +ARG SIDECAR_GITBRANCH=release-1.0.0rc2_node-2.0.0rc3 ARG SIDECAR_COMMIT= RUN apt-get update \ @@ -34,12 +34,12 @@ ENV PATH="$PATH:/root/.cargo/bin" RUN git clone https://github.com/casper-network/casper-node-launcher.git RUN if [ -n "$NODE_COMMIT" ]; then \ - git clone -b $NODE_COMMIT $NODE_REPO; \ + git clone $NODE_REPO && cd casper-node && git checkout $NODE_COMMIT && cd ..; \ else \ git clone -b $NODE_GITBRANCH $NODE_REPO; \ fi \ && if [ -n "$CLIENT_COMMIT" ]; then \ - git clone -b $CLIENT_COMMIT $CLIENT_REPO; \ + git clone $CLIENT_REPO && cd casper-client-rs && git checkout $CLIENT_COMMIT && cd ..; \ else \ git clone -b $CLIENT_GITBRANCH $CLIENT_REPO; \ fi \ @@ -95,9 +95,9 @@ RUN echo "source $CCTL/activate" >> .bashrc COPY --chown=cctl:cctl ./docker/start.sh . RUN chmod +x start.sh -EXPOSE 11101-11105 14101-14105 18101-18105 25101-25101 +EXPOSE 11101-11105 12101-12105 13101-13105 14101-14105 21101-21105 22101-22105 HEALTHCHECK --interval=10s --timeout=5s --retries=4 --start-period=20s \ - CMD curl --silent --location 'http://127.0.0.1:11101/rpc' --header 'Content-Type: application/json' --data '{"id": "1", "jsonrpc": "2.0", "method": "info_get_status", "params": []}' | jq -e -n 'input.result.reactor_state' | grep "Validate" + CMD curl --silent --location 'http://127.0.0.1:21101/rpc' --header 'Content-Type: application/json' --data '{"id": "1", "jsonrpc": "2.0", "method": "info_get_status", "params": []}' | jq -e -n 'input.result.reactor_state' | grep "Validate" CMD ["/bin/bash", "-c", "source start.sh"] \ No newline at end of file diff --git a/docker/clean.sh b/docker/clean.sh index 76aa0ea..05e7104 100644 --- a/docker/clean.sh +++ b/docker/clean.sh @@ -19,3 +19,4 @@ rm -r casper-sidecar/target/release/.fingerprint rm -r casper-node/.git rm -r casper-client-rs/.git rm -r casper-node-launcher/.git +rm -r casper-sidecar/.git From 392d98c67f5617c1e6eada29416865984c12610d Mon Sep 17 00:00:00 2001 From: Carl Norburn Date: Mon, 22 Jul 2024 13:02:44 +0100 Subject: [PATCH 6/6] Use a commit hash for the client --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 52ecd8f..aa54378 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ ARG SIDECAR_REPO=https://github.com/casper-network/casper-sidecar.git ARG NODE_COMMIT= ARG NODE_GITBRANCH=release-2.0.0-rc3 ARG CLIENT_GITBRANCH=feat-track-node-2.0 -ARG CLIENT_COMMIT= +ARG CLIENT_COMMIT=317051ddfb372d9404850c6a1787f225d6d32b4e ARG SIDECAR_GITBRANCH=release-1.0.0rc2_node-2.0.0rc3 ARG SIDECAR_COMMIT=