Skip to content

Commit

Permalink
Revert "Migrate to new volume names" (#1830)
Browse files Browse the repository at this point in the history
This reverts commit 6fdd847.
  • Loading branch information
yorickdowne authored May 14, 2024
1 parent d2178f2 commit 365fe40
Show file tree
Hide file tree
Showing 21 changed files with 14 additions and 87 deletions.
6 changes: 2 additions & 4 deletions besu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ services:
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- NETWORK=${NETWORK}
volumes:
- besu-eth1-data:/var/lib/besu-og
- besu-el-data:/var/lib/besu
- besu-eth1-data:/var/lib/besu
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/besu/ee-secret
ports:
Expand Down Expand Up @@ -87,13 +86,12 @@ services:
user: "10001:10001"
restart: "no"
volumes:
- besu-el-data:/var/lib/besu
- besu-eth1-data:/var/lib/besu
entrypoint: ["/bin/sh","-c"]
command: /bin/sh

volumes:
besu-eth1-data:
besu-el-data:
jwtsecret:

networks:
Expand Down
2 changes: 0 additions & 2 deletions besu/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ RUN set -eux; \
# verify that the binary works
gosu nobody true

# Create mount point for old volume
RUN mkdir -p /var/lib/besu-og && chown -R ${USER}:${USER} /var/lib/besu-og
# Create data mount point with permissions
RUN mkdir -p /var/lib/besu/ee-secret && chown -R ${USER}:${USER} /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 777 /var/lib/besu/ee-secret

Expand Down
2 changes: 0 additions & 2 deletions besu/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

# Create mount point for old volume
RUN mkdir -p /var/lib/besu-og && chown -R ${USER}:${USER} /var/lib/besu-og
RUN mkdir -p /var/lib/besu/ee-secret && chown -R besu:besu /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 777 /var/lib/besu/ee-secret

# Cannot assume buildkit, hence no chmod
Expand Down
9 changes: 0 additions & 9 deletions besu/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ if [ "$(id -u)" = '0' ]; then
exec gosu besu "${BASH_SOURCE[0]}" "$@"
fi

# Migrate from old to new volume
if [[ -d /var/lib/besu-og && ! -f /var/lib/besu-og/migrationdone \
&& $(ls -A /var/lib/besu-og/) ]]; then
echo "Migrating from old Besu volume to new one"
find /var/lib/besu-og/ -mindepth 1 -maxdepth 1 ! -name 'ee-secret' -exec mv -t /var/lib/besu/ {} +
touch /var/lib/besu-og/migrationdone
echo "Migration completed, data is now in volume \"besu-el-data\""
fi

if [ -n "${JWT_SECRET}" ]; then
echo -n "${JWT_SECRET}" > /var/lib/besu/ee-secret/jwtsecret
echo "JWT secret was supplied in .env"
Expand Down
12 changes: 7 additions & 5 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -1331,10 +1331,10 @@ resync-execution() {

case "${value}" in
*erigon.yml* ) __el_volume='erigon-el-data'; __el_client="erigon";;
*geth.yml* ) __el_volume='geth-el-data'; __el_client="geth";;
*geth.yml* ) __el_volume='geth-eth1-data'; __el_client="geth";;
*reth.yml* ) __el_volume='reth-el-data'; __el_client="reth";;
*besu.yml* ) __el_volume='besu-el-data'; __el_client="besu";;
*nethermind.yml* ) __el_volume='nethermind-el-data'; __el_client="nethermind";;
*besu.yml* ) __el_volume='besu-eth1-data'; __el_client="besu";;
*nethermind.yml* ) __el_volume='nm-eth1-data'; __el_client="nethermind";;
* ) echo "You do not appear to be running an execution layer client. Nothing to do."; return 0;;
esac

Expand Down Expand Up @@ -1368,13 +1368,15 @@ resync-consensus() {
value=$(sed -n -e "s/^${var}=\(.*\)/\1/p" "${ENV_FILE}" || true)

case "${value}" in
*lighthouse.yml* | *lighthouse-cl-only.yml* ) __cl_volume='lhconsensus-data'; __cl_client="lighthouse";;
*lighthouse.yml* ) __cl_volume='lhbeacon-data'; __cl_client="lighthouse";;
*lighthouse-cl-only.yml* ) __cl_volume='lhconsensus-data'; __cl_client="lighthouse";;
*teku-allin1.yml* ) __cl_volume='wipe-db'; __cl_client="teku";;
*teku.yml* | *teku-cl-only.yml* ) __cl_volume='tekuconsensus-data'; __cl_client="teku";;
*nimbus-allin1.yml* ) __cl_volume='wipe-db'; __cl_client="nimbus";;
*nimbus.yml* | *nimbus-cl-only.yml* ) __cl_volume='nimbus-consensus-data'; __cl_client="nimbus";;
*lodestar.yml* | *lodestar-cl-only.yml* ) __cl_volume='lsconsensus-data'; __cl_client="lodestar";;
*prysm.yml* | *prysm-cl-only.yml* ) __cl_volume='prysmconsensus-data'; __cl_client="prysm";;
*prysm.yml* ) __cl_volume='prysmbeacon-data'; __cl_client="prysm";;
*prysm-cl-only.yml* ) __cl_volume='prysmconsensus-data'; __cl_client="prysm";;
*grandine-allin1.yml* ) __cl_volume='wipe-db'; __cl_client="grandine";;
*grandine.yml* | *grandine-cl-only.yml* ) __cl_volume='grandineconsensus-data'; __cl_client="grandine";;
* ) echo "You do not appear to be running a consensus layer client. Nothing to do."; return;;
Expand Down
4 changes: 1 addition & 3 deletions geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ services:
- IPV6=${IPV6:-false}
- ANCIENT_DIR=${ANCIENT_DIR:-}
volumes:
- geth-eth1-data:/var/lib/goethereum-og
- geth-el-data:/var/lib/goethereum
- geth-eth1-data:/var/lib/goethereum
- ${ANCIENT_DIR:-.nada}:/var/lib/ancient
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/goethereum/ee-secret
Expand Down Expand Up @@ -85,7 +84,6 @@ services:

volumes:
geth-eth1-data:
geth-el-data:
jwtsecret:

networks:
Expand Down
2 changes: 0 additions & 2 deletions geth/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

# Create mount point for old volume
RUN mkdir -p /var/lib/goethereum-og && chown -R ${USER}:${USER} /var/lib/goethereum-og
RUN mkdir -p /var/lib/goethereum/ee-secret && chown -R ${USER}:${USER} /var/lib/goethereum && chmod -R 700 /var/lib/goethereum && chmod 777 /var/lib/goethereum/ee-secret

# Cannot assume buildkit, hence no chmod
Expand Down
2 changes: 0 additions & 2 deletions geth/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

# Create mount point for old volume
RUN mkdir -p /var/lib/goethereum-og && chown -R ${USER}:${USER} /var/lib/goethereum-og
RUN mkdir -p /var/lib/goethereum/ee-secret && chown -R ${USER}:${USER} /var/lib/goethereum && chmod -R 700 /var/lib/goethereum && chmod 777 /var/lib/goethereum/ee-secret

# Cannot assume buildkit, hence no chmod
Expand Down
9 changes: 0 additions & 9 deletions geth/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ if [ "$(id -u)" = '0' ]; then
exec su-exec geth docker-entrypoint.sh "$@"
fi

# Migrate from old to new volume
if [[ -d /var/lib/goethereum-og && ! -f /var/lib/goethereum-og/migrationdone \
&& $(ls -A /var/lib/goethereum-og/) ]]; then
echo "Migrating from old Geth volume to new one"
find /var/lib/goethereum-og/ -mindepth 1 -maxdepth 1 ! -name 'ee-secret' -exec mv -t /var/lib/goethereum/ {} +
touch /var/lib/goethereum-og/migrationdone
echo "Migration completed, data is now in volume \"geth-el-data\""
fi

if [ -n "${JWT_SECRET}" ]; then
echo -n "${JWT_SECRET}" > /var/lib/goethereum/ee-secret/jwtsecret
echo "JWT secret was supplied in .env"
Expand Down
6 changes: 2 additions & 4 deletions lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ services:
user: lhconsensus
stop_grace_period: 1m
volumes:
- lhbeacon-data:/var/lib/lighthouse-og
- lhconsensus-data:/var/lib/lighthouse
- lhbeacon-data:/var/lib/lighthouse
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/lighthouse/beacon/ee-secret
environment:
Expand Down Expand Up @@ -222,13 +221,12 @@ services:
user: "10002:10002"
restart: "no"
volumes:
- lhconsensus-data:/var/lib/lighthouse
- lhbeacon-data:/var/lib/lighthouse
entrypoint: ["/bin/sh","-c"]
command: /bin/sh

volumes:
lhbeacon-data:
lhconsensus-data:
lhvalidator-data:
jwtsecret:

Expand Down
2 changes: 0 additions & 2 deletions lighthouse/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions lighthouse/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,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
Expand Down
9 changes: 0 additions & 9 deletions lighthouse/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +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"
find /var/lib/lighthouse-og/beacon/ -mindepth 1 -maxdepth 1 ! -name 'ee-secret' -exec mv -t /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"
Expand Down
4 changes: 1 addition & 3 deletions nethermind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ services:
- AUTOPRUNE_NM=${AUTOPRUNE_NM:-true}
- NETWORK=${NETWORK}
volumes:
- nm-eth1-data:/var/lib/nethermind-og
- nethermind-el-data:/var/lib/nethermind
- nm-eth1-data:/var/lib/nethermind
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nethermind/ee-secret
ports:
Expand Down Expand Up @@ -93,7 +92,6 @@ services:

volumes:
nm-eth1-data:
nethermind-el-data:
jwtsecret:

networks:
Expand Down
2 changes: 0 additions & 2 deletions nethermind/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ RUN set -eux; \

# This only goes so far. keystore, logs and nethermind_db are volumes and need to be chown'd in the entrypoint
RUN chown -R ${USER}:${USER} /nethermind
# Create mount point for old volume
RUN mkdir -p /var/lib/nethermind-og && chown -R ${USER}:${USER} /var/lib/nethermind-og
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind \
&& chmod -R 700 /var/lib/nethermind && chmod 777 /var/lib/nethermind/ee-secret

Expand Down
2 changes: 0 additions & 2 deletions nethermind/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ WORKDIR /nethermind
COPY --from=build --chown=${USER}:${USER} /nethermind/out .

RUN chown -R ${USER}:${USER} /nethermind
# Create mount point for old volume
RUN mkdir -p /var/lib/nethermind-og && chown -R ${USER}:${USER} /var/lib/nethermind-og
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind \
&& chmod -R 700 /var/lib/nethermind && chmod 777 /var/lib/nethermind/ee-secret

Expand Down
9 changes: 0 additions & 9 deletions nethermind/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ if [ "$(id -u)" = '0' ]; then
exec gosu nethermind "${BASH_SOURCE[0]}" "$@"
fi

# Migrate from old to new volume
if [[ -d /var/lib/nethermind-og && ! -f /var/lib/nethermind-og/migrationdone \
&& $(ls -A /var/lib/nethermind-og/) ]]; then
echo "Migrating from old Nethermind volume to new one"
find /var/lib/nethermind-og/ -mindepth 1 -maxdepth 1 ! -name 'ee-secret' -exec mv -t /var/lib/nethermind/ {} +
touch /var/lib/nethermind-og/migrationdone
echo "Migration completed, data is now in volume \"nethermind-el-data\""
fi

# Move legacy xdai dir to gnosis
if [ -d "/var/lib/nethermind/nethermind_db/xdai" ]; then
mv /var/lib/nethermind/nethermind_db/xdai /var/lib/nethermind/nethermind_db/gnosis
Expand Down
4 changes: 1 addition & 3 deletions prysm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ services:
user: prysmconsensus
stop_grace_period: 1m
volumes:
- prysmbeacon-data:/var/lib/prysm-og
- prysmconsensus-data:/var/lib/prysm
- prysmbeacon-data:/var/lib/prysm
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/prysm/ee-secret
environment:
Expand Down Expand Up @@ -249,7 +248,6 @@ services:

volumes:
prysmbeacon-data:
prysmconsensus-data:
prysmvalidator-data:
jwtsecret:

Expand Down
2 changes: 0 additions & 2 deletions prysm/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,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

Expand Down
2 changes: 0 additions & 2 deletions prysm/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,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

Expand Down
9 changes: 0 additions & 9 deletions prysm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +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"
find /var/lib/prysm-og/ -mindepth 1 -maxdepth 1 ! -name 'ee-secret' -exec mv -t /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"
Expand Down

0 comments on commit 365fe40

Please sign in to comment.