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

fix: kurtosis install script #2175

Closed
wants to merge 1 commit into from
Closed
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
33 changes: 5 additions & 28 deletions kurtosis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,11 @@
### Kurtosis ###
###############################################################################

# Installs Kurtosis if not already installed
install-kurtosis:
@echo "Checking for Kurtosis installation..."
@if ! command -v kurtosis &> /dev/null; then \
echo "Kurtosis could not be found, installing..."; \
OS=$$(uname -s | tr A-Z a-z); \
if [ "$$OS" = "darwin" ]; then \
brew install kurtosis-tech/tap/kurtosis-cli; \
elif [ "$$OS" = "linux" ]; then \
ARCH=$$(uname -m); \
if [ "$$ARCH" = "x86_64" ]; then ARCH="amd64"; \
elif [ "$$ARCH" = "arm64" ]; then ARCH="arm64"; \
else echo "Unsupported architecture $$ARCH for Kurtosis installation" && exit 1; fi; \
TAG=`curl -s "https://api.github.com/repos/kurtosis-tech/kurtosis-cli-release-artifacts/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`; \
curl -Lo kurtosis.tar.gz "https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases/download/$TAG/kurtosis-cli_${TAG}_${OS}_${ARCH}.tar.gz"; \
tar -xzf kurtosis.tar.gz; \
rm kurtosis.tar.gz; \
chmod +x kurtosis; \
sudo mv kurtosis /usr/local/bin/; \
else \
echo "Unsupported OS $$OS for Kurtosis installation" && exit 1; \
fi; \
else \
echo "Kurtosis is already installed"; \
fi
Comment on lines -8 to -31
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mentioned during planning today about being fine with fixing the Ubuntu compatibility issue and keeping this install code. I changed my mind as this blob of code is complex and difficult to test and guarantee it works on different platforms. I think we should defer the installation to the user as a prerequisite, its already mentioned in the kurtosis/README.

Copy link
Contributor

Choose a reason for hiding this comment

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

if we collectively decide we wanna get rid of the install code and let the user ensure kurtosis is installed before spinning up the local network, I am okay @abi87 @calbera wanted to know your thoughts

verify-kurtosis-installed:
@command -v "kurtosis" > /dev/null || (echo "Please install Kurtosis, see kurtosis/README.md for instructions" && exit 1)

# Starts a Kurtosis enclave containing a local devnet.
start-devnet: install-kurtosis
start-devnet: verify-kurtosis-installed
$(MAKE) build-docker VERSION=kurtosis-local start-devnet-no-build

# Starts a Kurtosis enclave containing a local devnet without building the image
Expand All @@ -40,7 +17,7 @@ start-devnet-no-build:
--enclave my-local-devnet --parallelism 200

# Starts a Kurtosis enclave containing a local devnet on GCP.
# --production flag is used to indicate that the enclave is
# --production flag is used to indicate that the enclave is
# running in production mode to allow pod restarts when doing chaos testing.
start-gcp-devnet-no-build:
kurtosis run ./kurtosis --args-file ./kurtosis/beaconkit-base-gcp.yaml \
Expand All @@ -66,7 +43,7 @@ stop-devnet:
# Stops and removes the specified Kurtosis enclave
reset-devnet:
$(MAKE) stop-devnet
kurtosis enclave rm my-local-devnet
kurtosis enclave rm my-local-devnet

# Removes the specified Kurtosis enclave
rm-devnet:
Expand Down
Loading