From d8e5342abe675652caab241861432cc23f449fef Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Tue, 6 Feb 2024 14:29:13 +0000 Subject: [PATCH 01/18] patch: addrman buckets ipv4 based on /32 --- src/templates/addrman.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/templates/addrman.patch diff --git a/src/templates/addrman.patch b/src/templates/addrman.patch new file mode 100644 index 000000000..bf625d912 --- /dev/null +++ b/src/templates/addrman.patch @@ -0,0 +1,17 @@ +diff --git a/src/netgroup.cpp b/src/netgroup.cpp +index 0ae229b3f3..a861a38852 100644 +--- a/src/netgroup.cpp ++++ b/src/netgroup.cpp +@@ -43,11 +43,7 @@ std::vector NetGroupManager::GetGroup(const CNetAddr& address) co + } else if (!address.IsRoutable()) { + // all other unroutable addresses belong to the same group + } else if (address.HasLinkedIPv4()) { +- // IPv4 addresses (and mapped IPv4 addresses) use /16 groups +- uint32_t ipv4 = address.GetLinkedIPv4(); +- vchRet.push_back((ipv4 >> 24) & 0xFF); +- vchRet.push_back((ipv4 >> 16) & 0xFF); +- return vchRet; ++ nBits = 32; + } else if (address.IsTor() || address.IsI2P()) { + nBits = 4; + } else if (address.IsCJDNS()) { From 2df946449f6b27cab169b4fb0cbdbd929bf3a1a0 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:15:51 +0000 Subject: [PATCH 02/18] images: unified alpine-based dockerfile --- src/templates/Dockerfile_unified_alpine | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 src/templates/Dockerfile_unified_alpine diff --git a/src/templates/Dockerfile_unified_alpine b/src/templates/Dockerfile_unified_alpine new file mode 100644 index 000000000..414a6cdd4 --- /dev/null +++ b/src/templates/Dockerfile_unified_alpine @@ -0,0 +1,86 @@ +# Setup deps stage +FROM alpine as deps +ARG REPO +ARG BRANCH +ARG BUILD_ARGS + +RUN --mount=type=cache,target=/var/cache/apk \ + sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories \ + && apk --no-cache add \ + autoconf \ + automake \ + boost-dev \ + build-base \ + chrpath \ + file \ + gnupg \ + git \ + libevent-dev \ + libressl \ + libtool \ + linux-headers \ + sqlite-dev \ + zeromq-dev + +COPY src/templates/isroutable.patch /tmp/ +COPY src/templates/addrman.patch /tmp/ + + +# Clone and patch and build stage +FROM deps as build +ENV BITCOIN_PREFIX=/opt/bitcoin +WORKDIR /build + +RUN set -ex \ + && cd /build \ + && git clone --depth 1 --branch "${BRANCH}" "https://github.com/${REPO}" \ + && cd bitcoin \ + && git apply /tmp/isroutable.patch \ + && git apply /tmp/addrman.patch \ + && sed -i s:sys/fcntl.h:fcntl.h: src/compat/compat.h \ + && ./autogen.sh \ + && ./configure \ + LDFLAGS=-L`ls -d /opt/db*`/lib/ \ + CPPFLAGS=-I`ls -d /opt/db*`/include/ \ + --prefix=${BITCOIN_PREFIX} \ + ${BUILD_ARGS} \ + && make -j$(nproc) \ + && make install \ + && strip ${BITCOIN_PREFIX}/bin/bitcoin-cli \ + && strip ${BITCOIN_PREFIX}/bin/bitcoind \ + && strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a \ + && strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0 \ + && rm ${BITCOIN_PREFIX}/bin/bitcoin-tx \ + && rm ${BITCOIN_PREFIX}/bin/bitcoin-wallet \ + && rm ${BITCOIN_PREFIX}/bin/bitcoin-util + +# Final clean stage +FROM alpine +ARG UID=100 +ARG GID=101 +ENV BITCOIN_DATA=/home/bitcoin/.bitcoin +ENV BITCOIN_PREFIX=/opt/bitcoin +ENV PATH=${BITCOIN_PREFIX}/bin:$PATH +LABEL maintainer.0="bitcoindevproject" + +RUN addgroup bitcoin --gid ${GID} --system \ + && adduser --uid ${UID} --system bitcoin --ingroup bitcoin +RUN --mount=type=cache,target=/var/cache/apk sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories \ + && apk --no-cache add \ + bash \ + libevent \ + libzmq \ + shadow \ + sqlite-dev \ + su-exec + +COPY --from=build /opt/bitcoin /usr/local +COPY src/templates/entrypoint.sh /entrypoint.sh +COPY src/templates/tor/torrc /etc/tor/warnet-torr + +VOLUME ["/home/bitcoin/.bitcoin"] +EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332 + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["bitcoind"] + From b00774bf6b8395a2bc4a1cd1ae5c7d7183f5cd91 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:17:11 +0000 Subject: [PATCH 03/18] remove k8s dockerfile --- src/templates/Dockerfile_k8 | 87 ------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 src/templates/Dockerfile_k8 diff --git a/src/templates/Dockerfile_k8 b/src/templates/Dockerfile_k8 deleted file mode 100644 index b1d63f515..000000000 --- a/src/templates/Dockerfile_k8 +++ /dev/null @@ -1,87 +0,0 @@ -FROM debian:bookworm-slim as builder -ENV DEBIAN_FRONTEND=noninteractive - -ARG REPO -ARG BRANCH -ARG BUILD_ARGS - -# Install dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - wget \ - git \ - automake \ - autotools-dev \ - build-essential \ - libtool \ - libboost-dev \ - libevent-dev \ - libdb5.3++-dev \ - libminiupnpc-dev \ - libnatpmp-dev \ - libzmq3-dev \ - libsqlite3-dev \ - pkg-config \ - && rm -rf /var/lib/apt/lists/* # Clean up to reduce image size - -# Copy the patch into the container -COPY isroutable.patch /tmp/ - -# Clone, patch, and build -RUN set -ex \ - && mkdir build \ - && cd build \ - && git clone --depth 1 --branch "${BRANCH}" "https://github.com/${REPO}" \ - && cd bitcoin \ - && git apply /tmp/isroutable.patch \ - && ./autogen.sh \ - && ./configure ${BUILD_ARGS} \ - && make -j$(nproc) \ - && make install - -# Shrink image size with a second stage -FROM debian:bookworm-slim - -ARG UID=3338 -ARG GID=3338 -ARG TOR=0 -ARG WARNET=0 -ARG BITCOIN_ARGS -# env var overrides -ENV UID=$UID -ENV GID=$GID -ENV BITCOIN_DATA=/home/bitcoin/.bitcoin -ENV BITCOIN_ARGS=$BITCOIN_ARGS -ENV TOR=$TOR -ENV WARNET=$WARNET - -RUN set -ex \ - && groupadd --gid ${GID} bitcoin \ - && useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - dnsutils \ - gosu \ - iproute2 \ - tor \ - libboost-dev \ - libevent-dev \ - libdb5.3++-dev \ - libminiupnpc-dev \ - libnatpmp-dev \ - libzmq3-dev \ - libsqlite3-dev \ - && apt-get clean \ - && rm -rf /var/cache/apt/* /var/lib/apt/lists/* - -COPY --from=builder /usr/local/bin/bitcoind /usr/local/bin/bitcoin-cli /usr/local/bin/ -COPY entrypoint.sh /entrypoint.sh -# Warnet torrc using test network -COPY tor/torrc /etc/tor/warnet-torr - -VOLUME ["/home/bitcoin/.bitcoin"] -EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332 - -ENTRYPOINT ["/entrypoint.sh"] -CMD echo bitcoind -version -CMD ["bitcoind"] From 837c7fb495700d496628a6f13a2f36af76fcb9a4 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:17:43 +0000 Subject: [PATCH 04/18] remove image-building scripts --- scripts/build-bitcoin-images-k8s.sh | 56 ----------------------- scripts/build-bitcoin-images.sh | 69 ----------------------------- 2 files changed, 125 deletions(-) delete mode 100755 scripts/build-bitcoin-images-k8s.sh delete mode 100755 scripts/build-bitcoin-images.sh diff --git a/scripts/build-bitcoin-images-k8s.sh b/scripts/build-bitcoin-images-k8s.sh deleted file mode 100755 index ff5f294b5..000000000 --- a/scripts/build-bitcoin-images-k8s.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -# Create a new builder to enable building multi-platform images -docker buildx create --use - -# Image and Registry info -DOCKER_REGISTRY="bitcoindevproject/k8s-bitcoin-core" -REPO="bitcoin/bitcoin" -BUILD_ARGS="--disable-tests --with-incompatible-bdb --without-gui --disable-bench --disable-fuzz-binary --enable-suppress-external-warnings --without-miniupnpc --without-natpmp" -echo "DOCKER_REGISTRY=${DOCKER_REGISTRY}" -echo "REPO=${REPO}" - -# Tags and their supported architectures -declare -A VERSION_ARCH_MAP=( - ["23.2"]="amd64 arm64 armhf" - ["24.2"]="amd64 arm64 armhf" - ["25.1"]="amd64 arm64 armhf" - ["26.0"]="amd64 arm64 armhf" -) - -if [[ -d "src/templates" ]]; then - cd src/templates || exit 1 -else - echo "Directory src/templates does not exist. Please run this script from the project root." - exit 1 -fi - -# Loop through each tag and its architectures to build and push -for VERSION in "${!VERSION_ARCH_MAP[@]}"; do - IFS=' ' read -ra ARCHS <<< "${VERSION_ARCH_MAP[${VERSION}]}" - IMAGES_LIST=() # Array to store images for manifest - for DOCKER_ARCH in "${ARCHS[@]}"; do - echo "BRANCH=v${VERSION}" - echo "DOCKER_ARCH=${DOCKER_ARCH}" - - IMAGE_TAG="${VERSION}-${DOCKER_ARCH}" - IMAGE_FULL_NAME="${DOCKER_REGISTRY}:${IMAGE_TAG}" - echo "IMAGE_FULL_NAME=${IMAGE_FULL_NAME}" - - # Use Buildx to build the image for the specified architecture - docker buildx build --platform linux/"${DOCKER_ARCH}" \ - --provenance=false \ - --build-arg REPO="${REPO}" \ - --build-arg BRANCH="v${VERSION}" \ - --build-arg BUILD_ARGS="${BUILD_ARGS}" \ - --tag "${IMAGE_FULL_NAME}" \ - --file Dockerfile_k8 \ - . --push - - IMAGES_LIST+=("${IMAGE_FULL_NAME}") - done - - # Create the manifest list for each version under the same repository - MANIFEST_TAG="${DOCKER_REGISTRY}:${VERSION}" - docker buildx imagetools create --tag "${MANIFEST_TAG}" "${IMAGES_LIST[@]}" -done diff --git a/scripts/build-bitcoin-images.sh b/scripts/build-bitcoin-images.sh deleted file mode 100755 index 2ad00fa05..000000000 --- a/scripts/build-bitcoin-images.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash - -# Create a new builder to enable building multi-platform images -docker buildx create --use - -# Image and Registry info -DOCKER_REGISTRY="bitcoindevproject/bitcoin-core" -BITCOIN_URL="https://bitcoincore.org/bin" -echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" -echo "BITCOIN_URL=$BITCOIN_URL" - -# Map internal architectures to the format used in the URLs -declare -A ARCH_MAP=( - ["amd64"]="x86_64-linux-gnu" - ["arm64"]="aarch64-linux-gnu" - ["armhf"]="arm-linux-gnueabihf" - # ["amd64-darwin"]="x86_64-apple-darwin" - # ["arm64-darwin"]="arm64-apple-darwin" -) - -# Tags and their supported architectures -declare -A VERSION_ARCH_MAP=( - ["0.21.2"]="amd64 arm64 armhf" - ["22.1"]="amd64 arm64 armhf" - ["23.2"]="amd64 arm64 armhf" - ["24.2"]="amd64 arm64 armhf" - ["25.1"]="amd64 arm64 armhf" - ["26.0"]="amd64 arm64 armhf" -) - -if [ -d "src/templates" ]; then - cd src/templates || exit 1 -else - echo "Directory src/templates does not exist. Please run this script from the project root." - exit 1 -fi - -# Loop through each tag and its architectures to build and push -for VERSION in "${!VERSION_ARCH_MAP[@]}"; do - IFS=' ' read -ra ARCHS <<< "${VERSION_ARCH_MAP[$VERSION]}" - IMAGES_LIST=() # Array to store images for manifest - for DOCKER_ARCH in "${ARCHS[@]}"; do - echo "VERSION=$VERSION" - echo "DOCKER_ARCH=$DOCKER_ARCH" - - # Map the architecture to the URL format - URL_ARCH=${ARCH_MAP[$DOCKER_ARCH]} - echo "URL_ARCH=$URL_ARCH" - - IMAGE_TAG="$VERSION-$DOCKER_ARCH" - IMAGE_FULL_NAME="$DOCKER_REGISTRY:$IMAGE_TAG" - echo "IMAGE_FULL_NAME=$IMAGE_FULL_NAME" - - # Use Buildx to build the image for the specified architecture - docker buildx build --platform linux/"$DOCKER_ARCH" \ - --provenance=false \ - --build-arg ARCH="$URL_ARCH" \ - --build-arg BITCOIN_VERSION="$VERSION" \ - --build-arg BITCOIN_URL="$BITCOIN_URL" \ - --tag "$IMAGE_FULL_NAME" \ - . --push - - IMAGES_LIST+=("$IMAGE_FULL_NAME") - done - - # Create the manifest list for each version under the same repository - MANIFEST_TAG="$DOCKER_REGISTRY:$VERSION" - docker buildx imagetools create --tag "$MANIFEST_TAG" "${IMAGES_LIST[@]}" -done From edfc0c283712901dd42a26701d98782e26cb7b56 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:19:45 +0000 Subject: [PATCH 05/18] remove default Dockerfile --- src/templates/Dockerfile | 96 ---------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/templates/Dockerfile diff --git a/src/templates/Dockerfile b/src/templates/Dockerfile deleted file mode 100644 index 6acc27b77..000000000 --- a/src/templates/Dockerfile +++ /dev/null @@ -1,96 +0,0 @@ -FROM debian:bookworm-slim as builder -ENV DEBIAN_FRONTEND=noninteractive - -ARG ARCH -ARG BITCOIN_VERSION -ARG REPO -ARG BRANCH -ARG BUILD_ARGS -ARG BITCOIN_URL - -# install or build -RUN set -ex \ - && apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - wget \ - && if [ -n "${BITCOIN_URL}" ]; then \ - wget "${BITCOIN_URL}/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${ARCH}.tar.gz"; \ - tar -xzf "bitcoin-${BITCOIN_VERSION}-${ARCH}.tar.gz" -C /usr/local --strip-components=1; \ - fi \ - && if [ -n "${REPO}" ]; then \ - apt-get install -y \ - automake \ - autotools-dev \ - build-essential \ - git \ - libtool \ - libboost-dev \ - libevent-dev \ - libdb5.3++-dev \ - libminiupnpc-dev \ - libnatpmp-dev \ - libzmq3-dev \ - libqrencode-dev \ - libsqlite3-dev \ - pkg-config; \ - mkdir build; \ - cd /build; \ - git clone --depth 1 --branch "${BRANCH}" "https://github.com/${REPO}"; \ - cd /build/bitcoin; \ - ./autogen.sh; \ - ./configure ${BUILD_ARGS}; \ - make -j$(nproc); \ - make install; \ - fi - -# shrink image size with a second stage -FROM debian:bookworm-slim - -ARG UID=3338 -ARG GID=3338 -ARG REPO -ARG TOR=0 -ARG WARNET=0 -ARG BITCOIN_ARGS -# env var overrides -ENV UID=$UID -ENV GID=$GID -ENV BITCOIN_DATA=/home/bitcoin/.bitcoin -ENV BITCOIN_ARGS=$BITCOIN_ARGS -ENV TOR=$TOR -ENV WARNET=$WARNET - -RUN set -ex \ - && groupadd --gid ${GID} bitcoin \ - && useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - dnsutils \ - gosu \ - iproute2 \ - tor \ - && if [ -n "${REPO}" ]; then \ - apt-get install -y --no-install-recommends \ - libboost-dev \ - libevent-dev \ - libdb5.3++-dev \ - libminiupnpc-dev \ - libnatpmp-dev \ - libzmq3-dev \ - libqrencode-dev \ - libsqlite3-dev; \ - fi \ - && apt-get clean \ - && rm -rf /var/cache/apt/* /var/lib/apt/lists/* - -COPY --from=builder /usr/local/bin/bitcoind /usr/local/bin/bitcoin-cli /usr/local/bin/ -COPY entrypoint.sh /entrypoint.sh -# Warnet torrc using test network -COPY tor/torrc /etc/tor/warnet-torr - -VOLUME ["/home/bitcoin/.bitcoin"] -EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332 - -ENTRYPOINT ["/entrypoint.sh"] -RUN bitcoind -version | grep -E "Bitcoin Core( Daemon)? version v${BITCOIN_VERSION}" -CMD ["bitcoind"] From 05a6eb329d8da6308f8eb6e6bd07865227e58835 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:20:49 +0000 Subject: [PATCH 06/18] rename alpine dockerfile --- src/templates/{Dockerfile_unified_alpine => Dockerfile} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/templates/{Dockerfile_unified_alpine => Dockerfile} (100%) diff --git a/src/templates/Dockerfile_unified_alpine b/src/templates/Dockerfile similarity index 100% rename from src/templates/Dockerfile_unified_alpine rename to src/templates/Dockerfile From ec9c4ac06a076009e7c9ccc25e11d9af4a6deee6 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:22:05 +0000 Subject: [PATCH 07/18] switch to root user exec for alpine --- src/backends/backend_interface.py | 2 +- src/backends/compose/compose_backend.py | 6 ++--- src/backends/kubernetes/kubernetes_backend.py | 13 +++++------ src/templates/Dockerfile | 2 +- src/templates/entrypoint.sh | 22 +++---------------- src/warnet/tank.py | 6 ++--- src/warnet/warnet.py | 2 +- 7 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/backends/backend_interface.py b/src/backends/backend_interface.py index 93f24198c..6699d4ed7 100644 --- a/src/backends/backend_interface.py +++ b/src/backends/backend_interface.py @@ -45,7 +45,7 @@ def get_status(self, tank_index: int, service: ServiceType): raise NotImplementedError("This method should be overridden by child class") @abstractmethod - def exec_run(self, tank_index: int, service: ServiceType, cmd: str, user: str): + def exec_run(self, tank_index: int, service: ServiceType, cmd: str): """ Exectute a command on tank [tank_index] in service [service] """ diff --git a/src/backends/compose/compose_backend.py b/src/backends/compose/compose_backend.py index 4bdc468b6..fe56d0187 100644 --- a/src/backends/compose/compose_backend.py +++ b/src/backends/compose/compose_backend.py @@ -135,9 +135,9 @@ def get_status(self, tank_index: int, service: ServiceType) -> RunningStatus: case _: return RunningStatus.PENDING - def exec_run(self, tank_index: int, service: ServiceType, cmd: str, user: str = "root") -> str: + def exec_run( self, tank_index: int, service: ServiceType, cmd: str) -> str: c = self.get_container(tank_index, service) - result = c.exec_run(cmd=cmd, user=user) + result = c.exec_run(cmd=cmd) if result.exit_code != 0: raise Exception( f"Command failed with exit code {result.exit_code}: {result.output.decode('utf-8')} {cmd}" @@ -168,7 +168,7 @@ def get_bitcoin_cli(self, tank: Tank, method: str, params=None): cmd = f"bitcoin-cli -regtest -rpcuser={tank.rpc_user} -rpcport={tank.rpc_port} -rpcpassword={tank.rpc_password} {method} {' '.join(map(str, params))}" else: cmd = f"bitcoin-cli -regtest -rpcuser={tank.rpc_user} -rpcport={tank.rpc_port} -rpcpassword={tank.rpc_password} {method}" - return self.exec_run(tank.index, ServiceType.BITCOIN, cmd, user="bitcoin") + return self.exec_run(tank.index, ServiceType.BITCOIN, cmd) def get_file(self, tank_index: int, service: ServiceType, file_path: str): container = self.get_container(tank_index, service) diff --git a/src/backends/kubernetes/kubernetes_backend.py b/src/backends/kubernetes/kubernetes_backend.py index f9e98f26e..e48afc3ee 100644 --- a/src/backends/kubernetes/kubernetes_backend.py +++ b/src/backends/kubernetes/kubernetes_backend.py @@ -157,13 +157,12 @@ def get_status(self, tank_index: int, service: ServiceType) -> RunningStatus: break return RunningStatus.RUNNING if ready else RunningStatus.PENDING - def exec_run(self, tank_index: int, service: ServiceType, cmd: str, user: str = "root"): - # k8s doesn't let us run exec commands as a user, but we can use su - # because its installed in the bitcoin containers. we will need to rework - # this command if we decided to remove gosu from the containers - # TODO: change this if we remove gosu + def exec_run(self, tank_index: int, service: ServiceType, cmd: str): pod_name = self.get_pod_name(tank_index, service) - exec_cmd = ["/bin/sh", "-c", f"su - {user} -c '{cmd}'"] + if service == ServiceType.BITCOIN: + exec_cmd = ["/bin/bash", "-c", f"{cmd}"] + elif service == ServiceType.LIGHTNING: + exec_cmd = ["/bin/sh", "-c", f"{cmd}"] result = stream( self.client.connect_get_namespaced_pod_exec, pod_name, @@ -211,7 +210,7 @@ def get_bitcoin_cli(self, tank: Tank, method: str, params=None): cmd = f"bitcoin-cli -regtest -rpcuser={tank.rpc_user} -rpcport={tank.rpc_port} -rpcpassword={tank.rpc_password} {method} {' '.join(map(str, params))}" else: cmd = f"bitcoin-cli -regtest -rpcuser={tank.rpc_user} -rpcport={tank.rpc_port} -rpcpassword={tank.rpc_password} {method}" - return self.exec_run(tank.index, ServiceType.BITCOIN, cmd, user="bitcoin") + return self.exec_run(tank.index, ServiceType.BITCOIN, cmd) def get_messages( self, diff --git a/src/templates/Dockerfile b/src/templates/Dockerfile index 414a6cdd4..a7c9d8cf7 100644 --- a/src/templates/Dockerfile +++ b/src/templates/Dockerfile @@ -58,7 +58,7 @@ RUN set -ex \ FROM alpine ARG UID=100 ARG GID=101 -ENV BITCOIN_DATA=/home/bitcoin/.bitcoin +ENV BITCOIN_DATA=/root/.bitcoin ENV BITCOIN_PREFIX=/opt/bitcoin ENV PATH=${BITCOIN_PREFIX}/bin:$PATH LABEL maintainer.0="bitcoindevproject" diff --git a/src/templates/entrypoint.sh b/src/templates/entrypoint.sh index 29a474c41..de5f5f6e3 100755 --- a/src/templates/entrypoint.sh +++ b/src/templates/entrypoint.sh @@ -16,20 +16,10 @@ if [ "${TOR:-0}" -eq 1 ]; then mkdir -p /home/debian-tor/.tor/keys chown -R debian-tor:debian-tor /home/debian-tor # Start tor in the background - gosu debian-tor tor & + su-exec debian-tor:debian-tor tor & # =============================== fi -if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then - usermod -u "$UID" bitcoin -fi - -if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then - groupmod -g "$GID" bitcoin -fi - -echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)" - if [ "$(echo "$1" | cut -c1)" = "-" ]; then echo "$0: assuming arguments for bitcoind" @@ -39,13 +29,7 @@ fi if [ "$(echo "$1" | cut -c1)" = "-" ] || [ "$1" = "bitcoind" ]; then mkdir -p "$BITCOIN_DATA" chmod 700 "$BITCOIN_DATA" - # Fix permissions for home dir. - chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)" - # Fix permissions for bitcoin data dir. - chown -R bitcoin:bitcoin "$BITCOIN_DATA" - echo "$0: setting data directory to $BITCOIN_DATA" - set -- "$@" -datadir="$BITCOIN_DATA" fi @@ -55,9 +39,9 @@ if [ -n "$BITCOIN_ARGS" ]; then set -- "$@" "${ARG_ARRAY[@]}" fi -if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then +if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ]; then echo - exec gosu bitcoin "$@" + "$@" fi echo diff --git a/src/warnet/tank.py b/src/warnet/tank.py index d7ecc6115..019829774 100644 --- a/src/warnet/tank.py +++ b/src/warnet/tank.py @@ -130,10 +130,8 @@ def status(self) -> RunningStatus: return self.warnet.container_interface.get_status(self.index, ServiceType.BITCOIN) @exponential_backoff() - def exec(self, cmd: str, user: str = "root"): - return self.warnet.container_interface.exec_run( - self.index, ServiceType.BITCOIN, cmd=cmd, user=user - ) + def exec(self, cmd: str): + return self.warnet.container_interface.exec_run(self.index, ServiceType.BITCOIN, cmd=cmd) def apply_network_conditions(self): if self.netem is None: diff --git a/src/warnet/warnet.py b/src/warnet/warnet.py index 1cef4909a..92cc15049 100644 --- a/src/warnet/warnet.py +++ b/src/warnet/warnet.py @@ -180,7 +180,7 @@ def connect_edges(self): else: cmd = f'bitcoin-cli -regtest -rpcuser={src_tank.rpc_user} -rpcpassword={src_tank.rpc_password} addnode "{dst_ip}:18444" onetry' logger.info(f"Using `{cmd}` to connect tanks {src} to {dst}") - src_tank.exec(cmd=cmd, user="bitcoin") + src_tank.exec(cmd=cmd) def warnet_build(self): self.container_interface.build() From 7f826cbc1b6e70e776316328a8397076aad711c4 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:22:46 +0000 Subject: [PATCH 08/18] update image-builder for alpine --- src/utils/image_build.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/utils/image_build.py b/src/utils/image_build.py index 81eaf3c2d..d51cf47db 100644 --- a/src/utils/image_build.py +++ b/src/utils/image_build.py @@ -21,11 +21,7 @@ def build_and_upload_images( arches: str, ): if not build_args: - build_args = ( - '"--disable-tests --with-incompatible-bdb --without-gui --disable-bench ' - "--disable-fuzz-binary --enable-suppress-external-warnings " - '--without-miniupnpc --without-natpmp"' - ) + build_args = '"--disable-tests --without-gui --disable-bench --disable-fuzz-binary --enable-suppress-external-warnings "' else: build_args = f'"{build_args}"' @@ -37,7 +33,7 @@ def build_and_upload_images( for arch in build_arches: if arch not in ARCHES: - print(f"Error: {arch} is not a valid architecture") + print(f"Error: {arch} is not a supported architecture") return False print(f"{repo=:}") @@ -51,10 +47,9 @@ def build_and_upload_images( print("Directory src/templates does not exist.") print("Please run this script from the project root.") return False - os.chdir("src/templates") # Setup buildkit - builder_name = "warnet-builder" + builder_name = "bitcoind-builder" create_builder_cmd = f"docker buildx create --name {builder_name} --use" use_builder_cmd = f"docker buildx use --builder {builder_name}" cleanup_builder_cmd = f"docker buildx rm {builder_name}" @@ -66,25 +61,27 @@ def build_and_upload_images( return False image_full_name = f"{docker_registry}:{tag}" - print(f"Image full name: {image_full_name}") + print(f"{image_full_name=:}") platforms = ",".join([f"linux/{arch}" for arch in build_arches]) build_command = ( f"docker buildx build" f" --platform {platforms}" - f" --provenance=false" f" --build-arg REPO={repo}" f" --build-arg BRANCH={branch}" f" --build-arg BUILD_ARGS={build_args}" f" --tag {image_full_name}" - f" --file Dockerfile_k8 ." + f" --file src/templates/Dockerfile ." f" --push" ) - print(f"{build_command=:}") + print(f"Using {build_command=:}") + res = False try: res = run_command(build_command) + except Exception as e: + print(f"Error:\n{e}") finally: # Tidy up the buildx builder if not run_command(cleanup_builder_cmd): From 861bdb2ec3d25ee83327b8f2518c80deb44fb560 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:23:09 +0000 Subject: [PATCH 09/18] justfile: add build command using new Dockerfile --- justfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/justfile b/justfile index 02ab5d5c7..7a4508792 100644 --- a/justfile +++ b/justfile @@ -74,3 +74,13 @@ stopd: # port forward p: kubectl port-forward svc/rpc 9276:9276 + +registry := 'bitcoindevproject/bitcoin-core' +repo := 'bitcoin/bitcoin' +arches := 'amd64' +build-args := "--disable-tests --without-gui --disable-bench --disable-fuzz-binary --enable-suppress-external-warnings" +load := "load" + +# Build docker image and optionally push to registry +build branch tag registry=registry repo=repo build-args=build-args action=load: + warcli image build --registry={{registry}} --repo={{repo}} --branch={{branch}} --arches={{arches}} --tag={{tag}} --build-args="{{build-args}}" --action={{action}} From 0694fa08b322056962e93e4e93bf150410948d0a Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:26:35 +0000 Subject: [PATCH 10/18] image: rehome image_build under cli --- scripts/apidocs.py | 2 +- src/backends/compose/compose_backend.py | 1 + src/backends/kubernetes/kubernetes_backend.py | 1 + src/cli/image.py | 3 ++- src/{utils => cli}/image_build.py | 5 +++-- 5 files changed, 8 insertions(+), 4 deletions(-) rename src/{utils => cli}/image_build.py (97%) diff --git a/scripts/apidocs.py b/scripts/apidocs.py index 337b98801..48cb9e0ca 100644 --- a/scripts/apidocs.py +++ b/scripts/apidocs.py @@ -2,9 +2,9 @@ import re from pathlib import Path +from cli.main import cli from click import Context from tabulate import tabulate -from warnet.cli.main import cli doc = "" diff --git a/src/backends/compose/compose_backend.py b/src/backends/compose/compose_backend.py index fe56d0187..be2aa6eae 100644 --- a/src/backends/compose/compose_backend.py +++ b/src/backends/compose/compose_backend.py @@ -9,6 +9,7 @@ import docker import yaml from backends import BackendInterface, ServiceType +from cli.image import build_image from docker.models.containers import Container from templates import TEMPLATES from warnet.lnnode import LNNode diff --git a/src/backends/kubernetes/kubernetes_backend.py b/src/backends/kubernetes/kubernetes_backend.py index e48afc3ee..bb46ed02e 100644 --- a/src/backends/kubernetes/kubernetes_backend.py +++ b/src/backends/kubernetes/kubernetes_backend.py @@ -6,6 +6,7 @@ import yaml from backends import BackendInterface, ServiceType +from cli.image import build_image from kubernetes import client, config from kubernetes.client.models.v1_pod import V1Pod from kubernetes.client.rest import ApiException diff --git a/src/cli/image.py b/src/cli/image.py index 6e79284af..7c055ef09 100644 --- a/src/cli/image.py +++ b/src/cli/image.py @@ -1,7 +1,8 @@ import sys import click -from utils.image_build import build_and_upload_images + +from .image_build import build_image @click.group(name="image") diff --git a/src/utils/image_build.py b/src/cli/image_build.py similarity index 97% rename from src/utils/image_build.py rename to src/cli/image_build.py index d51cf47db..601604b1d 100644 --- a/src/utils/image_build.py +++ b/src/cli/image_build.py @@ -12,13 +12,14 @@ def run_command(command): return False -def build_and_upload_images( +def build_image( repo: str, branch: str, docker_registry: str, tag: str, build_args: str, arches: str, + action: str = "load", ): if not build_args: build_args = '"--disable-tests --without-gui --disable-bench --disable-fuzz-binary --enable-suppress-external-warnings "' @@ -73,7 +74,7 @@ def build_and_upload_images( f" --build-arg BUILD_ARGS={build_args}" f" --tag {image_full_name}" f" --file src/templates/Dockerfile ." - f" --push" + f" --{action}" ) print(f"Using {build_command=:}") From 2dba861809e8cca18325a761cc1fd79a8f02f5c5 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:27:16 +0000 Subject: [PATCH 11/18] image: fixup image cli command --- src/cli/image.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cli/image.py b/src/cli/image.py index 7c055ef09..ea576a9ee 100644 --- a/src/cli/image.py +++ b/src/cli/image.py @@ -17,11 +17,12 @@ def image(): @click.option("--tag", required=True, type=str) @click.option("--build-args", required=False, type=str) @click.option("--arches", required=False, type=str) -def build(repo, branch, registry, tag, build_args, arches): +@click.option("--action", required=False, type=str) +def build(repo, branch, registry, tag, build_args, arches, action="load"): """ - Build bitcoind and bitcoin-cli from / and deploy to as - This requires docker and buildkit to be enabled. + Build bitcoind and bitcoin-cli from / as :. + Optionally deploy to remote registry using --action=push, otherwise image is loaded to local registry. """ - res = build_and_upload_images(repo, branch, registry, tag, build_args, arches) + res = build_image(repo, branch, registry, tag, build_args, arches, action) if not res: sys.exit(1) From 81c1b4688e08317a76a1308eea25a6e8ce2007f7 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:32:54 +0000 Subject: [PATCH 12/18] compose: add inline branch-build --- src/backends/compose/compose_backend.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/backends/compose/compose_backend.py b/src/backends/compose/compose_backend.py index be2aa6eae..bbb891359 100644 --- a/src/backends/compose/compose_backend.py +++ b/src/backends/compose/compose_backend.py @@ -35,6 +35,7 @@ TORRC_NAME = "torrc" ENTRYPOINT_NAME = "entrypoint.sh" DOCKER_REGISTRY = "bitcoindevproject/bitcoin-core" +LOCAL_REGISTRY = "warnet/bitcoin-core" GRAFANA_PROVISIONING = "grafana-provisioning" CONTAINER_PREFIX_BITCOIND = "tank-bitcoin" CONTAINER_PREFIX_LN = "tank-ln" @@ -359,18 +360,10 @@ def add_services(self, tank: Tank, services): if "/" and "#" in tank.version: # it's a git branch, building step is necessary repo, branch = tank.version.split("#") - build = { - "context": str(tank.config_dir), - "dockerfile": str(tank.config_dir / DOCKERFILE_NAME), - "args": { - "REPO": repo, - "BRANCH": branch, - "BUILD_ARGS": f"{tank.DEFAULT_BUILD_ARGS + tank.extra_build_args}", - }, - } - services[container_name]["build"] = build + services[container_name]["image"] = f"{LOCAL_REGISTRY}:{branch}" + build_image(repo, branch, LOCAL_REGISTRY, branch, tank.DEFAULT_BUILD_ARGS + tank.extra_build_args, arches="amd64") self.copy_configs(tank) - elif tank.is_custom_build and tank.image: + elif tank.image: # Pre-built custom image image = tank.image services[container_name]["image"] = image From 4f9e4fba46e137cd1b10592177cb80c5d477eb7d Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 19:57:34 +0000 Subject: [PATCH 13/18] ci: disable k8s builder This is not working currently, but can be re-enabled in the near future (TM) --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a42fd36d..b83443ed6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - backend: [compose, k8s] + backend: [compose] steps: - uses: actions/checkout@v3 - - if: matrix.backend == 'compose' - uses: ./.github/actions + - uses: ./.github/actions - if: matrix.backend == 'k8s' uses: extractions/setup-just@v1 - if: matrix.backend == 'k8s' From d3cbc6141157a13a986b761c47cba2b6b97188aa Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:34:17 +0000 Subject: [PATCH 14/18] k8s: add inline branch-build But disable it for now in CI --- src/backends/kubernetes/kubernetes_backend.py | 38 ++++++++++++++----- src/warnet/tank.py | 2 - 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/backends/kubernetes/kubernetes_backend.py b/src/backends/kubernetes/kubernetes_backend.py index bb46ed02e..298f7200e 100644 --- a/src/backends/kubernetes/kubernetes_backend.py +++ b/src/backends/kubernetes/kubernetes_backend.py @@ -18,6 +18,7 @@ DOCKER_REGISTRY_CORE = "bitcoindevproject/k8s-bitcoin-core" DOCKER_REGISTRY_LND = "lightninglabs/lnd:v0.17.0-beta" +LOCAL_REGISTRY = "warnet/bitcoin-core" POD_PREFIX = "tank" BITCOIN_CONTAINER_NAME = "bitcoin" LN_CONTAINER_NAME = "ln" @@ -319,7 +320,6 @@ def tank_from_deployment(self, pod, pods_by_name, warnet): c_branch = env.value if c_repo and c_branch: t.version = f"{c_repo}#{c_branch}" - t.is_custom_build = True # check if we can find a corresponding lnd pod lnd_pod = pods_by_name.get(self.get_pod_name(index, ServiceType.LIGHTNING)) @@ -340,17 +340,37 @@ def default_bitcoind_config_args(self, tank): def create_bitcoind_container(self, tank) -> client.V1Container: container_name = BITCOIN_CONTAINER_NAME - container_image = ( - tank.image if tank.is_custom_build else f"{DOCKER_REGISTRY_CORE}:{tank.version}" - ) + container_image = None + + # Prebuilt image + if tank.image: + container_image = tank.image + # On-demand built image + elif "/" and "#" in tank.version: + # We don't have docker installed on the RPC server, where this code will be run from, + # and it's currently unclear to me if having the RPC pod build images is a good idea. + # Don't support this for now in CI by disabling in the workflow. + + # This can be re-enabled by enabling in the workflow file and installing docker and + # docker-buildx on the rpc server image. + + # it's a git branch, building step is necessary + repo, branch = tank.version.split("#") + build_image( + repo, + branch, + LOCAL_REGISTRY, + branch, + tank.DEFAULT_BUILD_ARGS + tank.extra_build_args, + arches="amd64", + ) + # Prebuilt major version + else: + container_image = f"{DOCKER_REGISTRY_CORE}:{tank.version}" + container_env = [ client.V1EnvVar(name="BITCOIN_ARGS", value=self.default_bitcoind_config_args(tank)) ] - # TODO: support custom builds - if tank.is_custom_build: - # TODO: check if the build already exists in the registry - # Annoyingly the api differs between providers, so this is annoying - pass return client.V1Container( name=container_name, diff --git a/src/warnet/tank.py b/src/warnet/tank.py index 019829774..e8e2c7122 100644 --- a/src/warnet/tank.py +++ b/src/warnet/tank.py @@ -33,7 +33,6 @@ def __init__(self, index: int, config_dir: Path, warnet): self.bitcoin_network = warnet.bitcoin_network self.version = "25.1" self.image: str = "" - self.is_custom_build = False self.conf = "" self.conf_file = None self.netem = None @@ -73,7 +72,6 @@ def parse_version(self, node): ) if image: self.image = image - self.is_custom_build = True else: if (version in SUPPORTED_TAGS) or ("/" in version and "#" in version): self.version = version From 41ce95d4c0d3deafe0166608fa8fc37caa566b19 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:44:21 +0000 Subject: [PATCH 15/18] server: lock during build stage to permit inline builds --- src/warnet/server.py | 57 ++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/src/warnet/server.py b/src/warnet/server.py index 570350aef..8a9dad805 100644 --- a/src/warnet/server.py +++ b/src/warnet/server.py @@ -1,5 +1,4 @@ import argparse -import inspect import logging import os import pkgutil @@ -67,6 +66,12 @@ def __init__(self, backend): # /-/healthy and /-/ready are often used (e.g. by the prometheus server) self.app.add_url_rule("/-/healthy", view_func=self.healthy) + # This is set while we bring a warnet up, which may include building a new image + # After warnet is up this will be released. + # This is used to delay api calls which rely on and image being built dynamically + # before the config dir is populated with the deployment info + self.image_build_lock = threading.Lock() + def healthy(self): return "warnet is healthy" @@ -100,7 +105,28 @@ def log_request(): else: self.logger.debug(request.json) + def build_check(): + timeout = 600 + check_interval = 10 + time_elapsed = 0 + + while time_elapsed < timeout: + # Attempt to acquire the lock without blocking + lock_acquired = self.image_build_lock.acquire(blocking=False) + # If we get the lock, release it and continue + if lock_acquired: + self.image_build_lock.release() + return + # Otherwise wait before trying again + else: + time.sleep(check_interval) + time_elapsed += check_interval + + # If we've reached here, the lock wasn't acquired in time + raise Exception(f"Failed to acquire the build lock within {timeout} seconds, aborting RPC.") + self.app.before_request(log_request) + self.app.before_request(build_check) def setup_rpc(self): # Tanks @@ -351,18 +377,18 @@ def network_from_file( Run a warnet with topology loaded from a """ - def thread_start(wn): - try: - wn.generate_deployment() - # wn.write_fork_observer_config() - wn.warnet_build() - wn.warnet_up() - wn.apply_network_conditions() - wn.connect_edges() - self.logger.info(f"Created warnet named '{network}'") - except Exception as e: - msg = f"Exception in {inspect.stack()[0][3]}: {e}" - self.logger.exception(msg) + def thread_start(wn, lock: threading.Lock): + with lock: + try: + wn.generate_deployment() + # wn.write_fork_observer_config() + wn.warnet_build() + wn.warnet_up() + wn.apply_network_conditions() + wn.connect_edges() + except Exception as e: + msg = f"Error starting warnet: {e}" + self.logger.error(msg) config_dir = gen_config_dir(network) if config_dir.exists(): @@ -372,14 +398,15 @@ def thread_start(wn): message = f"Config dir {config_dir} already exists, not overwriting existing warnet without --force" self.logger.error(message) raise ServerError(message=message, code=CONFIG_DIR_ALREADY_EXISTS) + try: wn = Warnet.from_graph_file(graph_file, config_dir, network, self.backend) - t = threading.Thread(target=lambda: thread_start(wn)) + t = threading.Thread(target=lambda: thread_start(wn, self.image_build_lock)) t.daemon = True t.start() return wn._warnet_dict_representation() except Exception as e: - msg = f"Error tring to resume warnet: {e}" + msg = f"Error bring up warnet: {e}" self.logger.error(msg) raise ServerError(message=msg) from e From ca0d06b2fe44ba5fba86303b70d1a5225dd71960 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 20:44:56 +0000 Subject: [PATCH 16/18] cli: fix network start command return type --- src/cli/network.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/cli/network.py b/src/cli/network.py index 72d3a53ae..a2bad716a 100644 --- a/src/cli/network.py +++ b/src/cli/network.py @@ -1,5 +1,4 @@ import base64 # noqa: I001 -import sys from pathlib import Path import click @@ -64,12 +63,7 @@ def start(graph_file: Path, force: bool, network: str): "network_from_file", {"graph_file": encoded_graph_file, "force": force, "network": network}, ) - assert isinstance(result, dict), "Result is not a dict" # Make mypy happy - if not isinstance(result, dict): - print( - f"Error. Expected dict, got {type(result)}. May indicate mismatch between RPC and CLI" - ) - sys.exit(1) + assert isinstance(result, dict) print_repr(result) From ce3800a2732037e5f47319b6516e2a9390795333 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 7 Feb 2024 16:05:44 +0000 Subject: [PATCH 17/18] ci: point minikube local registry to outer docker registry in CI --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b83443ed6..e5ce536d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: uses: medyagh/setup-minikube@master - if: matrix.backend == 'k8s' run: | + eval $(minikube docker-env) pip install --upgrade pip pip install -e . just start From 66444fff44256e45dc69feff8d28cf1cab9604e7 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Thu, 8 Feb 2024 12:09:58 +0000 Subject: [PATCH 18/18] images: use new registry with unified image This image is based on alpine linux, and will work on k8s and compose backends, as well as forming the base of custom builds. One image to rule them all, and in the darkness bind them. Or something. --- docs/graph.md | 2 +- justfile | 2 +- src/backends/compose/compose_backend.py | 2 +- src/backends/kubernetes/kubernetes_backend.py | 2 +- src/graphs/default.graphml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/graph.md b/docs/graph.md index 16a4d08cf..75ab654d8 100644 --- a/docs/graph.md +++ b/docs/graph.md @@ -70,7 +70,7 @@ These should be built using the `warcli image build` command to ensure they have 5.5 2.5 -bitcoindevproject/bitcoin-core:26.0 +bitcoindevproject/bitcoin:26.0 uacomment=warnet0_v24,debugexclude=libevent diff --git a/justfile b/justfile index 7a4508792..d18329ec2 100644 --- a/justfile +++ b/justfile @@ -75,7 +75,7 @@ stopd: p: kubectl port-forward svc/rpc 9276:9276 -registry := 'bitcoindevproject/bitcoin-core' +registry := 'bitcoindevproject/bitcoin' repo := 'bitcoin/bitcoin' arches := 'amd64' build-args := "--disable-tests --without-gui --disable-bench --disable-fuzz-binary --enable-suppress-external-warnings" diff --git a/src/backends/compose/compose_backend.py b/src/backends/compose/compose_backend.py index bbb891359..d1646e9aa 100644 --- a/src/backends/compose/compose_backend.py +++ b/src/backends/compose/compose_backend.py @@ -34,7 +34,7 @@ DOCKERFILE_NAME = "Dockerfile" TORRC_NAME = "torrc" ENTRYPOINT_NAME = "entrypoint.sh" -DOCKER_REGISTRY = "bitcoindevproject/bitcoin-core" +DOCKER_REGISTRY = "bitcoindevproject/bitcoin" LOCAL_REGISTRY = "warnet/bitcoin-core" GRAFANA_PROVISIONING = "grafana-provisioning" CONTAINER_PREFIX_BITCOIND = "tank-bitcoin" diff --git a/src/backends/kubernetes/kubernetes_backend.py b/src/backends/kubernetes/kubernetes_backend.py index 298f7200e..b463272f3 100644 --- a/src/backends/kubernetes/kubernetes_backend.py +++ b/src/backends/kubernetes/kubernetes_backend.py @@ -16,7 +16,7 @@ from warnet.tank import Tank from warnet.utils import default_bitcoin_conf_args, parse_raw_messages -DOCKER_REGISTRY_CORE = "bitcoindevproject/k8s-bitcoin-core" +DOCKER_REGISTRY_CORE = "bitcoindevproject/bitcoin" DOCKER_REGISTRY_LND = "lightninglabs/lnd:v0.17.0-beta" LOCAL_REGISTRY = "warnet/bitcoin-core" POD_PREFIX = "tank" diff --git a/src/graphs/default.graphml b/src/graphs/default.graphml index 0e409d196..8a8d764ea 100644 --- a/src/graphs/default.graphml +++ b/src/graphs/default.graphml @@ -20,7 +20,7 @@ true - bitcoindevproject/bitcoin-core:26.0 + bitcoindevproject/bitcoin:26.0 -uacomment=w2 true true