-
Notifications
You must be signed in to change notification settings - Fork 304
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-only install experience #2875
Comments
Sounds good! |
Do users need to do Also can make some of the pains referenced in #2870 go away |
we'd provide a wrapper-script that manages the container for the user. The script would provide the same interface as the cli. |
The dockerfile would specify entrypoint as
The only tricky thing here, is where to install the wrapper script. Even in unix there's no standard user bin folder, and requiring root or sudo to install it into /usr/bin or /usr/local/bin is a no go. So our sandbox install script will need to do something like (a few gpt prompts later): #!/bin/bash
# Define the binary's source path
BINARY_SRC_PATH="/path/to/your/binary"
# Define the target directory
TARGET_DIR="$HOME/.local/bin"
# Check if the target directory exists, if not create it
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p "$TARGET_DIR"
fi
# Copy the binary to the target directory
cp "$BINARY_SRC_PATH" "$TARGET_DIR"
# Check if the target directory is in the user's PATH
if [[ ":$PATH:" != *":$TARGET_DIR:"* ]]; then
# Determine the user's shell
SHELL_PROFILE=""
case $SHELL in
*/bash)
SHELL_PROFILE="$HOME/.bashrc"
;;
*/zsh)
SHELL_PROFILE="$HOME/.zshrc"
;;
# Add other shells as needed
*)
echo "Unsupported shell: $SHELL"
exit 1
;;
esac
# Inform the user about the change and ask for confirmation
echo "The directory $TARGET_DIR is not in your PATH."
echo "We'd like to add it to your $SHELL_PROFILE to make the binary accessible."
read -p "Do you want to proceed? (y/n) " -n 1 -r
echo # Move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
# Add the target directory to the user's PATH in their profile
echo "export PATH=\$PATH:$TARGET_DIR" >> "$SHELL_PROFILE"
echo "Updated PATH in $SHELL_PROFILE"
else
echo "Skipped updating PATH. You might need to add $TARGET_DIR to your PATH manually to use the binary."
fi
else
echo "Installation complete!"
fi |
This PR dockerizes aztec-cli. It requires #2737 to be merged in first. Fix #2875 # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [x] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [x] Every change is related to the PR description. - [x] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist).
Docker image and script merged in but this still needs the install script. See https://github.com/AztecProtocol/sandbox-website/pull/24 |
In #3031 I forgot to push the CLI docker image to dockerhub. This fixes that and also updates the name of the expected docker image in the bash wrapper script to match. Related #2875 # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [x] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [x] Every change is related to the PR description. - [x] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist).
In order to provide a seamless install experience to aztec-sandbox users we should consider offering a dockerized version of aztec-cli so that users can get up and running without having to install node/npm/yarn.
We'd have to deploy the aztec-cli to docker hub and create a wrapper script around it that starts a container and delegates commands to it. The wrapper will have to manage mount points in order to ensure compiling contracts works (and the compiled artifacts are available on the host computer). We'll also need to consider how to handle updates to the underlying cli image.
Needs #2644
The text was updated successfully, but these errors were encountered: