From 7b7c0180d4bd68db21b867516303438ea1cdbcdb Mon Sep 17 00:00:00 2001 From: Yorick Date: Tue, 14 May 2024 08:20:16 +0000 Subject: [PATCH] Remove volume migration logic --- ethd | 11 ----------- lighthouse.yml | 2 -- lighthouse/Dockerfile.binary | 2 -- lighthouse/Dockerfile.source | 2 -- lighthouse/docker-entrypoint.sh | 11 ----------- prysm.yml | 2 -- prysm/Dockerfile.binary | 2 -- prysm/Dockerfile.source | 2 -- prysm/docker-entrypoint.sh | 11 ----------- 9 files changed, 45 deletions(-) diff --git a/ethd b/ethd index 0ec290e8..f4549fc5 100755 --- a/ethd +++ b/ethd @@ -1440,17 +1440,6 @@ resync-consensus() { else __cl_volume="$(basename "$(realpath .)")_${__cl_volume}" dodocker volume rm "$(dodocker volume ls -q -f "name=${__cl_volume}")" - __volume_id="" - if [[ "${__cl_volume}" =~ lhconsensus-data ]]; then - __legacy_volume="$(basename "$(realpath .)")_lhbeacon-data" - __volume_id="$(dodocker volume ls -q -f "name=${__legacy_volume}")" - elif [[ "${__cl_volume}" =~ prysmconsensus-data ]]; then - __legacy_volume="$(basename "$(realpath .)")_prysmbeacon-data" - __volume_id="$(dodocker volume ls -q -f "name=${__legacy_volume}")" - fi - if [ -n "${__volume_id}" ]; then - dodocker volume rm "${__volume_id}" - fi fi echo echo "${__cl_client} stopped and database deleted." diff --git a/lighthouse.yml b/lighthouse.yml index 1eacac90..cc8b7662 100644 --- a/lighthouse.yml +++ b/lighthouse.yml @@ -26,7 +26,6 @@ services: user: lhconsensus stop_grace_period: 1m volumes: - - lhbeacon-data:/var/lib/lighthouse-og - lhconsensus-data:/var/lib/lighthouse - /etc/localtime:/etc/localtime:ro - jwtsecret:/var/lib/lighthouse/beacon/ee-secret @@ -229,7 +228,6 @@ services: command: /bin/sh volumes: - lhbeacon-data: lhconsensus-data: lhvalidator-data: jwtsecret: diff --git a/lighthouse/Dockerfile.binary b/lighthouse/Dockerfile.binary index 5c7d6112..97cebb05 100644 --- a/lighthouse/Dockerfile.binary +++ b/lighthouse/Dockerfile.binary @@ -20,8 +20,6 @@ RUN adduser \ --uid "${UID}" \ "${USER}" -# Create mount point for old volume -RUN mkdir -p /var/lib/lighthouse-og && chown -R ${USER}:${USER} /var/lib/lighthouse-og # Create data mount point with permissions RUN mkdir -p /var/lib/lighthouse/beacon/ee-secret && chown -R ${USER}:${USER} /var/lib/lighthouse/beacon && chmod -R 700 /var/lib/lighthouse/beacon && chmod 777 /var/lib/lighthouse/beacon/ee-secret # Cannot assume buildkit, hence no chmod diff --git a/lighthouse/Dockerfile.source b/lighthouse/Dockerfile.source index 4beaca8d..69e1b0ac 100644 --- a/lighthouse/Dockerfile.source +++ b/lighthouse/Dockerfile.source @@ -49,8 +49,6 @@ RUN adduser \ --uid "${UID}" \ "${USER}" -# Create mount point for old volume -RUN mkdir -p /var/lib/lighthouse-og && chown -R ${USER}:${USER} /var/lib/lighthouse-og # Create data mount point with permissions RUN mkdir -p /var/lib/lighthouse/beacon/ee-secret && chown -R ${USER}:${USER} /var/lib/lighthouse/beacon && chmod -R 700 /var/lib/lighthouse/beacon && chmod 777 /var/lib/lighthouse/beacon/ee-secret # Cannot assume buildkit, hence no chmod diff --git a/lighthouse/docker-entrypoint.sh b/lighthouse/docker-entrypoint.sh index 324f21ef..f186f2a7 100755 --- a/lighthouse/docker-entrypoint.sh +++ b/lighthouse/docker-entrypoint.sh @@ -6,17 +6,6 @@ if [ "$(id -u)" = '0' ]; then exec gosu lhconsensus docker-entrypoint.sh "$@" fi -# Migrate from old to new volume -if [[ -d /var/lib/lighthouse-og/beacon && ! -f /var/lib/lighthouse-og/beacon/migrationdone \ - && $(ls -A /var/lib/lighthouse-og/beacon/) ]]; then - echo "Migrating from old Lighthouse volume to new one" - echo "This may take 10 minutes on a fast drive, or hours if the Lighthouse DB is very large. Please be patient" - echo "If your Lighthouse DB is well over 200 GiB in size, please consider \"./ethd resync-consensus\"" - rsync -a --remove-source-files --exclude='ee-secret' --info=progress2 /var/lib/lighthouse-og/beacon/ /var/lib/lighthouse/beacon/ - touch /var/lib/lighthouse-og/beacon/migrationdone - echo "Migration completed, data is now in volume \"lhconsensus-data\"" -fi - if [ -n "${JWT_SECRET}" ]; then echo -n "${JWT_SECRET}" > /var/lib/lighthouse/beacon/ee-secret/jwtsecret echo "JWT secret was supplied in .env" diff --git a/prysm.yml b/prysm.yml index 314a55b5..01a8b3af 100644 --- a/prysm.yml +++ b/prysm.yml @@ -28,7 +28,6 @@ services: user: prysmconsensus stop_grace_period: 1m volumes: - - prysmbeacon-data:/var/lib/prysm-og - prysmconsensus-data:/var/lib/prysm - /etc/localtime:/etc/localtime:ro - jwtsecret:/var/lib/prysm/ee-secret @@ -256,7 +255,6 @@ services: - vc volumes: - prysmbeacon-data: prysmconsensus-data: prysmvalidator-data: jwtsecret: diff --git a/prysm/Dockerfile.binary b/prysm/Dockerfile.binary index 3f996e77..371330c7 100644 --- a/prysm/Dockerfile.binary +++ b/prysm/Dockerfile.binary @@ -38,8 +38,6 @@ RUN adduser \ --uid "${UID}" \ "${USER}" -# Create mount point for old volume -RUN mkdir -p /var/lib/prysm-og && chown -R ${USER}:${USER} /var/lib/prysm-og # Create data mount point with permissions RUN mkdir -p /var/lib/prysm/ee-secret && chown -R ${USER}:${USER} /var/lib/prysm && chmod -R 700 /var/lib/prysm && chmod 777 /var/lib/prysm/ee-secret diff --git a/prysm/Dockerfile.source b/prysm/Dockerfile.source index 41c05663..b693481d 100644 --- a/prysm/Dockerfile.source +++ b/prysm/Dockerfile.source @@ -48,8 +48,6 @@ RUN adduser \ --uid "${UID}" \ "${USER}" -# Create mount point for old volume -RUN mkdir -p /var/lib/prysm-og && chown -R ${USER}:${USER} /var/lib/prysm-og # Create data mount point with permissions RUN mkdir -p /var/lib/prysm/ee-secret && chown -R ${USER}:${USER} /var/lib/prysm && chmod -R 700 /var/lib/prysm && chmod 777 /var/lib/prysm/ee-secret diff --git a/prysm/docker-entrypoint.sh b/prysm/docker-entrypoint.sh index 69f859a6..204993a5 100755 --- a/prysm/docker-entrypoint.sh +++ b/prysm/docker-entrypoint.sh @@ -6,17 +6,6 @@ if [ "$(id -u)" = '0' ]; then exec gosu prysmconsensus docker-entrypoint.sh "$@" fi -# Migrate from old to new volume -if [[ -d /var/lib/prysm-og && ! -f /var/lib/prysm-og/migrationdone \ - && $(ls -A /var/lib/prysm-og/) ]]; then - echo "Migrating from old Prysm volume to new one" - echo "This may take 10 minutes on a fast drive, or hours if the Prysm DB is very large. Please be patient" - echo "If your Prysm DB is well over 200 GiB in size, please consider \"./ethd resync-consensus\"" - rsync -a --remove-source-files --exclude='ee-secret' --info=progress2 /var/lib/prysm-og/ /var/lib/prysm/ - touch /var/lib/prysm-og/migrationdone - echo "Migration completed, data is now in volume \"prysmconsensus-data\"" -fi - if [ -n "${JWT_SECRET}" ]; then echo -n "${JWT_SECRET}" > /var/lib/prysm/ee-secret/jwtsecret echo "JWT secret was supplied in .env"