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

Simplify container builds #2089

Merged
merged 1 commit into from
Aug 15, 2024
Merged
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
5 changes: 5 additions & 0 deletions protocol/testing/current_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CURRENT_VERSION="v6.0.0"

# Define the mapping from version to URL
declare -A version_to_url
version_to_url["v5.2.0"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv5.2.0/dydxprotocold-v5.2.0-linux-amd64.tar.gz"
1 change: 1 addition & 0 deletions protocol/testing/mainnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM dydxprotocol-base
RUN apk add --no-cache bash jq aws-cli
RUN go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]

COPY ./testing/current_version.sh /dydxprotocol/
COPY ./testing/mainnet/. /dydxprotocol/

ENV HOME /dydxprotocol
Expand Down
Binary file not shown.
10 changes: 1 addition & 9 deletions protocol/testing/mainnet/mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ source "./vars.sh"

CHAIN_ID="dydx-mainnet-1"

# Define the mapping from version to URL
declare -A version_to_url
version_to_url["v5.2.0"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv5.2.0/dydxprotocold-v5.2.0-linux-amd64.tar.gz"

# Define dependencies for this script.
# `jq` and `dasel` are used to manipulate json and yaml files respectively.
install_prerequisites() {
apk add dasel jq
}

set_cosmovisor_binary_permissions() {
# The genesis binary should always exist.
for f in $HOME/cosmovisor/genesis/bin/* ; do
chmod 755 $f
done
# Set up upgrade binaries.
for version in "${!version_to_url[@]}"; do
echo "Setting up version ${version}..."
Expand All @@ -39,7 +31,7 @@ set_cosmovisor_binary_permissions() {
chmod 755 "$version_dir/bin/dydxprotocold"
echo "Successfully set up $version_dir/bin/dydxprotocold"
done
current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION_DIR/bin"
current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION/bin"
mkdir -p $current_version_path
cp /bin/dydxprotocold $current_version_path
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/testing/mainnet/vars.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -eo pipefail

CURRENT_VERSION_DIR="v6.0.0"
source "./current_version.sh"

# Full node home directories will be set up for indices 0 to LAST_FULL_NODE_INDEX
LAST_FULL_NODE_INDEX=5
1 change: 1 addition & 0 deletions protocol/testing/testnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM dydxprotocol-base
RUN apk add --no-cache bash jq aws-cli
RUN go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]

COPY ./testing/current_version.sh /dydxprotocol/
COPY ./testing/testnet/. /dydxprotocol/

ENV HOME /dydxprotocol
Expand Down
Binary file not shown.
10 changes: 1 addition & 9 deletions protocol/testing/testnet/testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,13 @@ source "./vars.sh"

CHAIN_ID="dydx-testnet-1"

# Define the mapping from version to URL
declare -A version_to_url
version_to_url["v5.2.0"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv5.2.0/dydxprotocold-v5.2.0-linux-amd64.tar.gz"

# Define dependencies for this script.
# `jq` and `dasel` are used to manipulate json and yaml files respectively.
install_prerequisites() {
apk add dasel jq
}

set_cosmovisor_binary_permissions() {
# The genesis binary should always exist.
for f in $HOME/cosmovisor/genesis/bin/* ; do
chmod 755 $f
done
# Set up upgrade binaries.
for version in "${!version_to_url[@]}"; do
echo "Setting up version ${version}..."
Expand All @@ -40,7 +32,7 @@ set_cosmovisor_binary_permissions() {
chmod 755 "$version_dir/bin/dydxprotocold"
echo "Successfully set up $version_dir/bin/dydxprotocold"
done
current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION_DIR/bin"
current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION/bin"
mkdir -p $current_version_path
cp /bin/dydxprotocold $current_version_path
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/testing/testnet/vars.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -eo pipefail

CURRENT_VERSION_DIR="v6.0.0"
source "./current_version.sh"

# Full node home directories will be set up for indices 0 to LAST_FULL_NODE_INDEX
LAST_FULL_NODE_INDEX=2
Expand Down
Loading