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

deploy v1.6.0 to demo network #4776

Merged
merged 1 commit into from
Dec 16, 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
2 changes: 1 addition & 1 deletion ops/terraform/prod.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bacalhau_version = "v1.5.1"
bacalhau_version = "v1.6.0"
bacalhau_port = "1235"
bacalhau_environment = "production"
ipfs_version = "v0.18.1"
Expand Down
6 changes: 3 additions & 3 deletions ops/terraform/remote_files/scripts/install-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ function install-healthcheck() {

function install-ipfs() {
echo "Installing IPFS"
wget "https://dist.ipfs.tech/go-ipfs/${IPFS_VERSION}/go-ipfs_${IPFS_VERSION}_linux-amd64.tar.gz"
tar -xvzf "go-ipfs_${IPFS_VERSION}_linux-amd64.tar.gz"
wget "https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/kubo_${IPFS_VERSION}_linux-amd64.tar.gz"
tar -xvzf "kubo_${IPFS_VERSION}_linux-amd64.tar.gz"
Comment on lines +90 to +91
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for wget and tar operations

While switching to GitHub releases is the right approach, we should add error handling for the download and extraction operations.

-  wget "https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/kubo_${IPFS_VERSION}_linux-amd64.tar.gz"
-  tar -xvzf "kubo_${IPFS_VERSION}_linux-amd64.tar.gz"
+  if ! wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 5 \
+    "https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/kubo_${IPFS_VERSION}_linux-amd64.tar.gz"; then
+    echo "Failed to download Kubo package"
+    exit 1
+  fi
+  
+  if ! tar -xvzf "kubo_${IPFS_VERSION}_linux-amd64.tar.gz"; then
+    echo "Failed to extract Kubo package"
+    exit 1
+  fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
wget "https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/kubo_${IPFS_VERSION}_linux-amd64.tar.gz"
tar -xvzf "kubo_${IPFS_VERSION}_linux-amd64.tar.gz"
if ! wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 5 \
"https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/kubo_${IPFS_VERSION}_linux-amd64.tar.gz"; then
echo "Failed to download Kubo package"
exit 1
fi
if ! tar -xvzf "kubo_${IPFS_VERSION}_linux-amd64.tar.gz"; then
echo "Failed to extract Kubo package"
exit 1
fi

# TODO should reset PWD to home dir after each function call
pushd go-ipfs
pushd kubo
sudo bash install.sh
ipfs --version
popd
Expand Down
2 changes: 1 addition & 1 deletion ops/terraform/stage.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bacalhau_version = "v1.5.1"
bacalhau_version = "v1.6.0"
bacalhau_branch = "" # deploy from a branch instead of the version above
bacalhau_port = "1235"
bacalhau_environment = "staging"
Expand Down
Loading