From 558cdd18bbbeeb7c4834dc9d2c73424ff4cad583 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 23 Jan 2024 23:49:45 +0530 Subject: [PATCH 1/6] dockerfile: update commit hash - clboss main - c-lightning vls-hsmd - plugins main - vls vls-hsmd Signed-off-by: Lakshya Singh --- lightningd/Dockerfile | 8 ++++---- vlsd/Dockerfile | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index 464ef33..e9d41be 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -27,7 +27,7 @@ RUN apk update && \ zlib-dev \ zlib-static -ARG CORE_LIGHTNING_GIT_HASH=bd9494c65be09e6f8ecb3bc49b50a859467a65fe \ +ARG CORE_LIGHTNING_GIT_HASH=94884de737043d906c791f2f348f9416307fa2b2 \ CORE_LIGHTNING_REPO=https://github.com/lightning-signer/c-lightning.git RUN git clone --recursive $CORE_LIGHTNING_REPO core-lightning RUN cd core-lightning && \ @@ -37,7 +37,7 @@ RUN cd core-lightning && \ make -j $(nproc) install && \ make clean -ARG PLUGINS_GIT_HASH=ce078bb74e10b5dea779fcd9fbe77e1d3e72db7a \ +ARG PLUGINS_GIT_HASH=cf96eb63c1687644042ea85acfd3785527fd98d4 \ PLUGINS_REPO=https://github.com/lightningd/plugins.git RUN git clone $PLUGINS_REPO RUN cd plugins && \ @@ -60,7 +60,7 @@ RUN apk update && \ pkgconf \ sqlite-dev -ARG CLBOSS_GIT_HASH=9c050d61f01ffff4b7b5d295f708569dd71b55d3 \ +ARG CLBOSS_GIT_HASH=0673c50e7374ea8f5cb7e302f72b7978c6bd1794 \ CLBOSS_REPO=https://github.com/ZmnSCPxj/clboss.git RUN git clone --recurse-submodules $CLBOSS_REPO clboss RUN cd clboss && \ @@ -85,7 +85,7 @@ RUN apk update && \ protobuf-dev \ rust -ARG VLS_GIT_HASH=59544fd5b15658643acebdaf18886022db3d1071 \ +ARG VLS_GIT_HASH=f8dea081b8d3ba292285266c9b304eb1d32ceaad \ VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git RUN git clone $VLS_REPO vls RUN cd vls && \ diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index edd7e4a..88124e0 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -12,7 +12,7 @@ RUN apk update && \ protobuf-dev \ rust -ARG GIT_HASH=59544fd5b15658643acebdaf18886022db3d1071 +ARG GIT_HASH=f8dea081b8d3ba292285266c9b304eb1d32ceaad RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls RUN cd vls && \ git checkout $GIT_HASH && \ From af57edb8287f46f138e0eae7e676dce8c5639527 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 23 Jan 2024 23:51:16 +0530 Subject: [PATCH 2/6] vls: add healthcheck - use rpc server info command Signed-off-by: Lakshya Singh --- vlsd/Dockerfile | 8 ++++++++ vlsd/healthcheck.sh | 5 +++++ 2 files changed, 13 insertions(+) create mode 100755 vlsd/healthcheck.sh diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index 88124e0..36b9e03 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -17,6 +17,7 @@ RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.gi RUN cd vls && \ git checkout $GIT_HASH && \ cargo install --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \ + cargo install --path ./vls-cli --profile release --root /usr/local/ && \ cargo clean FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner @@ -38,10 +39,14 @@ RUN apk update && \ bind-tools COPY --from=builder /usr/local/bin/vlsd2 /usr/local/bin/vlsd2 +COPY --from=builder /usr/local/bin/vls-cli /usr/local/bin/vls-cli COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh +COPY healthcheck.sh /healthcheck.sh +RUN chmod +x /healthcheck.sh + COPY vlsd2.toml /vlsd2.toml ENV VLS_DATA=/home/vls/.lightning-signer @@ -55,6 +60,9 @@ VOLUME ["${VLS_DATA}"] USER vls +HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \ + CMD ["/bin/sh", "-c", "/healthcheck.sh"] + ENTRYPOINT ["/entrypoint.sh"] RUN vlsd2 --git-desc diff --git a/vlsd/healthcheck.sh b/vlsd/healthcheck.sh new file mode 100755 index 0000000..7bf72ec --- /dev/null +++ b/vlsd/healthcheck.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -ex + +vls-cli info \ No newline at end of file From 4f05b35881fd860e06ea4f83665c241880042c00 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 23 Jan 2024 23:56:56 +0530 Subject: [PATCH 3/6] docs: update future works Signed-off-by: Lakshya Singh --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae01c3e..0da5147 100644 --- a/README.md +++ b/README.md @@ -191,8 +191,8 @@ docker container exec lightningd-test lightning-cli --testnet summary - [x] standalone docker image for `bitcoind` - [ ] supporting signet - [x] Profile configuration to run `vls` -- [ ] Healthcheck for `txoo` -- [ ] Healthcheck for `vls` +- [x] Healthcheck for `txoo` +- [x] Healthcheck for `vls` - [ ] Lightning Storage Server Dockerfile and Compose Service - [ ] Postgres Service for Lightning Storage Server From 19d7776bfdb079246f91144d97bc996ccf69da6a Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Thu, 25 Jan 2024 09:52:37 +0530 Subject: [PATCH 4/6] scripts: cleanup regtest script - destroy containers - delete all regtest volumes Signed-off-by: Lakshya Singh --- scripts/cleanup_regtest.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 scripts/cleanup_regtest.sh diff --git a/scripts/cleanup_regtest.sh b/scripts/cleanup_regtest.sh new file mode 100755 index 0000000..960565c --- /dev/null +++ b/scripts/cleanup_regtest.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -ex + +docker compose --profile vls down +docker volume rm vls-container_bitcoin_regtest +docker volume rm vls-container_lightning_regtest +docker volume rm vls-container_vls_regtest +docker volume rm vls-container_txoo_regtest From 94d4178b9ecf4ebe9cd25b1b0dee7f890b111e00 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Thu, 25 Jan 2024 22:25:56 +0530 Subject: [PATCH 5/6] lightningd: change commit and repo - change repo to ElementsProject/lightning - v23.11.2 Signed-off-by: Lakshya Singh --- lightningd/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index e9d41be..77e2348 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -27,8 +27,8 @@ RUN apk update && \ zlib-dev \ zlib-static -ARG CORE_LIGHTNING_GIT_HASH=94884de737043d906c791f2f348f9416307fa2b2 \ - CORE_LIGHTNING_REPO=https://github.com/lightning-signer/c-lightning.git +ARG CORE_LIGHTNING_GIT_HASH=76cd32387a400a2aee607edaf1e0a06e92e1402f \ + CORE_LIGHTNING_REPO=https://github.com/ElementsProject/lightning.git RUN git clone --recursive $CORE_LIGHTNING_REPO core-lightning RUN cd core-lightning && \ git checkout $CORE_LIGHTNING_GIT_HASH && \ From 8aa940abf1dcb4676b5d6acf5884adab5b3fe261 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Fri, 26 Jan 2024 21:00:54 +0530 Subject: [PATCH 6/6] Dockerfile: healthcheck dont use sh - interpreter already set in the scripts not need to use /bin/sh -c Signed-off-by: Lakshya Singh --- bitcoind/Dockerfile | 2 +- lightningd/Dockerfile | 2 +- txood/Dockerfile | 2 +- txood/healthcheck.sh | 0 vlsd/Dockerfile | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 txood/healthcheck.sh diff --git a/bitcoind/Dockerfile b/bitcoind/Dockerfile index 1663d4b..69cd2af 100644 --- a/bitcoind/Dockerfile +++ b/bitcoind/Dockerfile @@ -136,6 +136,6 @@ ENTRYPOINT ["/entrypoint.sh"] RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}" HEALTHCHECK --interval=10s --timeout=20s --start-period=30s \ - CMD ["/bin/sh", "-c", "/healthcheck.sh"] + CMD ["/healthcheck.sh"] CMD ["bitcoind"] diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index 77e2348..b0de907 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -159,7 +159,7 @@ RUN pip3 install \ packaging HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ - CMD ["/bin/sh", "-c", "/healthcheck.sh"] + CMD ["/healthcheck.sh"] ENTRYPOINT ["/entrypoint.sh"] CMD ["lightningd"] diff --git a/txood/Dockerfile b/txood/Dockerfile index 13f003d..0a51055 100644 --- a/txood/Dockerfile +++ b/txood/Dockerfile @@ -45,7 +45,7 @@ RUN chmod +x /healthcheck.sh VOLUME ["${TXOO_DATA}"] HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ - CMD ["/bin/sh", "-c", "/healthcheck.sh"] + CMD ["/healthcheck.sh"] ENTRYPOINT ["/entrypoint.sh"] CMD ["txood"] diff --git a/txood/healthcheck.sh b/txood/healthcheck.sh old mode 100644 new mode 100755 diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index 36b9e03..e2c83ad 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -61,7 +61,7 @@ VOLUME ["${VLS_DATA}"] USER vls HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \ - CMD ["/bin/sh", "-c", "/healthcheck.sh"] + CMD ["/healthcheck.sh"] ENTRYPOINT ["/entrypoint.sh"]