Conversation
|
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5741". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
dpmayerUSGS
left a comment
There was a problem hiding this comment.
Some genuine bugs in the argument parser, but otherwise mostly stylistic/convention considerations.
isis/scripts/install_isis.sh
Outdated
| printf "\t-v, --isis_version Different ISIS versions as defined by the anaconda versions " | ||
| printf "for a label at https://anaconda.org/usgs-astrogeology/isis, examples include 8.0.3 " | ||
| printf "(LTS/Feature), 8.2.0_RC1 (RC), and 2025.02.22 (dev)\n " | ||
| printf "\t-n, --env_name The name of the anaconda environment to create.\n" |
There was a problem hiding this comment.
I get unknown option:
(isisdevinstall) igswza281l2305:~ krodriguez$ bash install_isis.sh -l dev -n isisbnash
Unknown option -n|
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5741". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
|
@dpmayerUSGS fixed a few bugs, mind re-reviewing this? |
There was a problem hiding this comment.
I only reviewed isis/scripts/install_isis.sh.
I think the script could be slimmed down. There appear to be some unnecessary code blocks.
One of the user prompts says that mamba is recommended , but the script will exit with an error if the user has conda installed but declines to install mamba. What is the intended behavior?
isis/scripts/install_isis.sh
Outdated
|
|
||
| read -r ans | ||
|
|
||
| # If no input, use default path |
There was a problem hiding this comment.
This if block seems unnecessary because the script defines ans="no" as default a few lines above. I think it's okay to keep it if you want to be "belt and suspenders," but maybe update the comment text; the block doesn't have anything to do with a "default path."
There was a problem hiding this comment.
I don't think this is true, since user input will overwrite that default to whatever was put in. We can remove it and check for empty string later down the line. Otherwise, if they just press enter, ans will be an empty string.
This applies to all the similar comments.
There was a problem hiding this comment.
Okay, I see what you mean now.
The repeated handling of yes/no responses could probably be abstracted away into a function that is called where needed rather than repeating the same if block though. I would tighten the code up a bit.
|
|
||
| read -r ans | ||
|
|
||
| # If no input, use default path |
There was a problem hiding this comment.
This if block seems unnecessary because the script defines ans="no" as default a few lines above. I think it's okay to keep it if you wantto be "belt and suspenders," but maybe update the comment text; the block doesn't have anything to do with a "default path."
isis/scripts/install_isis.sh
Outdated
| $MINIFORGE_DIR/bin/$CLIENT init || exit 1 | ||
| else | ||
| echo "Miniforge is already installed." | ||
| if [[ "$CONDA_PREFIX" == *"envs"* ]]; then |
There was a problem hiding this comment.
Is this trying to look for a directory named /envs/ somewhere in $CONDA_PREFIX? If yes, consider changing the pattern to *"/envs/"* to the pattern more specific.
isis/scripts/install_isis.sh
Outdated
|
|
||
| $MINIFORGE_DIR/bin/$CLIENT env config vars set -n $ENV_NAME ISISDATA=$ISISDATA_PREFIX ISISROOT=$MINIFORGE_DIR/envs/$ENV_NAME || failed_command "Mamba config var set" | ||
|
|
||
| if [[ "$MINIFORGE_DIR" == *"envs/$ENV_NAME"* ]]; then |
There was a problem hiding this comment.
Consider inserting / before envs to make the pattern more specific.
| read -r ans | ||
|
|
||
| # If no input, use default | ||
| if [ "$ans" = "" ]; then |
There was a problem hiding this comment.
This if block seems unnecessary because the script defines ans="no" as default a few lines above.
| fi | ||
|
|
||
| ans=$(echo "${ans}" | tr '[:lower:]' '[:upper:]') | ||
| while [ "$ans" != "YES" ] && [ "$ans" != "NO" ] |
There was a problem hiding this comment.
This while seems unnecessary because the script defines ans=no by default above.
There was a problem hiding this comment.
similar to my previous comment, user input overwrites that value and we need a loop to make sure they didn't input something ambiguous
isis/scripts/install_isis.sh
Outdated
| # Check if conda is installed but mamba is not | ||
| if command -v conda &> /dev/null && ! command -v mamba &> /dev/null; then | ||
| echo "WARNING: conda is installed but mamba is not." | ||
| echo "mamba is a faster alternative to conda and is recommended for ISIS installation." |
There was a problem hiding this comment.
The word "recommended" seams to weak here. If the user passes "no" in response to the prompt, the if block on Line 221 prints a message that only mamba is supported and the script exits.
The prompt should be clear that mamba is actually required or the script should be modified to proceed with an existing install of conda without mamba.
isis/scripts/install_isis.sh
Outdated
| fi | ||
|
|
||
| ans=$(echo "${ans}" | tr '[:lower:]' '[:upper:]') | ||
| while [ "$ans" != "YES" ] && [ "$ans" != "NO" ] |
There was a problem hiding this comment.
This while seems unnecessary because the script defines ans=no by default above.
| fi | ||
|
|
||
| ans=$(echo "${ans}" | tr '[:lower:]' '[:upper:]') | ||
| while [ "$ans" != "YES" ] && [ "$ans" != "NO" ] |
There was a problem hiding this comment.
This while seems unnecessary because the script defines ans=no by default above.
|
Addressed comments, seems this needs to be rebased which I can do after these comments are resolved. |
|
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5741". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
dpmayerUSGS
left a comment
There was a problem hiding this comment.
Only reviewed isis/scripts/install_isis.sh
Changes look good.
|
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5741". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
Description
Initial ISIS install script for users, based off of an initial version from @Kelvinrr
Related Issue
Docs IAA
How Has This Been Validated?
User testing
Types of changes
Checklist:
Licensing
This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words: