-
Notifications
You must be signed in to change notification settings - Fork 86
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
Docker: solve polkadot relay folder renaming and other small fixes #1628
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bb3c837
Add entrypoint and other small fixes
gpmayorga 0daa07b
fix typo on entrypoint script
gpmayorga 0718c9c
Merge branch 'main' into docker-enhancements
gpmayorga 3681780
try removing the "Free space" step
gpmayorga 09065ae
add missing directive on dockerignore
gpmayorga 5bbb958
small docker tag fixes
gpmayorga 156659c
test different docker repo copy
gpmayorga 80b8c84
fix entrypoint script permissions
gpmayorga ce7d886
move entrypoint before centrifuge user
gpmayorga b58bac7
more sophisticated Docker entrypoint
gpmayorga 55c215b
update CI files dockerignore and dependabot
gpmayorga 3e2cd57
Dockerfile cleanup
gpmayorga c4e247a
Update docker/scripts/entrypoint.sh
gpmayorga 6e1e81c
make the latest tag implicit
gpmayorga 4c1f4b0
removed edge in favor of sha values for PRs
gpmayorga 421f131
fix latest tagging for docker
gpmayorga 67d80bb
Merge branch 'main' into docker-enhancements
gpmayorga 5c3cff2
revert pushing on PRs for testing
gpmayorga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
**/target/ | ||
.github/ | ||
!scripts/install_toolchain.sh | ||
docker-compos | ||
.gitignore | ||
docker | ||
README.md | ||
!docker/scripts | ||
README.md | ||
flake* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ updates: | |
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
interval: "monthly" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
if [ "$1" == "--help" ]; then | ||
echo "No arguments detected, printing help and exiting..." | ||
centrifuge-chain "$@" | ||
exit 0 | ||
fi | ||
|
||
# Fix to account for Polkadot's renaming of their DB folder from | ||
# relay-chain to polkadot. Probably not needed after all nodes are upgraded | ||
# beyond Polkadot 0.9.42+ | ||
BASE_PATH="" | ||
for ARG in "$@" | ||
do | ||
if [[ $ARG == --base-path=* ]]; then | ||
BASE_PATH="${ARG#*=}" | ||
break | ||
fi | ||
done | ||
if [ -z "$BASE_PATH" ] | ||
then | ||
BASE_PATH="/data" | ||
fi | ||
|
||
if [ -d "${BASE_PATH}/relay-chain" ] | ||
then | ||
relay_chain_size=$(du -s "${BASE_PATH}/relay-chain" | cut -f1) | ||
|
||
echo "Detected relay-chain folder. Renaming to polkadot..." | ||
if [ -d "${BASE_PATH}/polkadot" ] | ||
then | ||
if [ -d "${BASE_PATH}/polkadot" ] | ||
then | ||
polkadot_size=$(du -s "${BASE_PATH}/polkadot" | cut -f1) | ||
if [ "$polkadot_size" -ge "$relay_chain_size" ] | ||
then | ||
echo -e "\e[1;31m${BASE_PATH}/polkadot\e[0m folder is larger than or equal to \e[1;31m${BASE_PATH}/relay-chain\e[0m" | ||
echo "This is unexpected. Manual check required." | ||
echo "HINT: Delete one of the two folders to preserve that DB" | ||
exit 1 | ||
else | ||
echo "${BASE_PATH}/polkadot is smaller than ${BASE_PATH}/relay-chain" | ||
echo "Creating backup of ${BASE_PATH}/polkadot before replacing it..." | ||
mv "${BASE_PATH}/polkadot" "${BASE_PATH}/polkadot.bak" | ||
rm -rf "${BASE_PATH}/polkadot" | ||
fi | ||
fi | ||
fi | ||
mv -f "${BASE_PATH}/relay-chain" "${BASE_PATH}/polkadot" | ||
fi | ||
|
||
# Start the chain | ||
centrifuge-chain "$@" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀