Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume migration done #1832

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -230,7 +229,6 @@ services:
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 @@ -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
Expand Down
11 changes: 0 additions & 11 deletions lighthouse/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions prysm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -258,7 +257,6 @@ services:
- vc

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 @@ -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

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

Expand Down
11 changes: 0 additions & 11 deletions prysm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down