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

Plugin install: use micromamba to make sure git is available #1733

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

emlys
Copy link
Member

@emlys emlys commented Jan 10, 2025

Description

Fixes #1713
Creates an invest_base environment that contains git, and runs the subsequent git commands in that env, so we don't have to assume that git is available on the system.

Also specifies a prefix (path) for the base and plugin environments, rather than using the --name. This resolves a warning I was seeing about no root prefix specified - and keeps the invest-specific environments contained in the workbench resources directory, rather than mixing with other envs the user might have in the default location. Also removes the need to look up the env location in mamba info.

Also throwing in a fix for #1652, since it's so small - just read in the conda dependencies from a pyproject.toml configuration, rather than hard-coding.

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
  • Updated the user's guide (if needed)
  • Tested the Workbench UI (if relevant)

@emlys emlys requested a review from dcdenu4 January 10, 2025 22:48
@emlys emlys marked this pull request as ready for review January 10, 2025 22:48
@emlys emlys changed the title plugin install: create base env with git and run git commands there Plugin install: use micromamba to make sure git is available Jan 10, 2025
Copy link
Member

@dcdenu4 dcdenu4 left a comment

Choose a reason for hiding this comment

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

Thanks @emlys , I just had a few questions and suggestions.

workbench/src/main/setupAddRemovePlugin.js Show resolved Hide resolved
workbench/src/main/setupAddRemovePlugin.js Show resolved Hide resolved
['clone', '--depth', '1', '--no-checkout', pluginURL, tmpPluginDir]
micromamba,
['run', '--prefix', `"${baseEnvPrefix}"`,
'git', 'clone', '--depth', '1', '--no-checkout', pluginURL, tmpPluginDir]
Copy link
Member

Choose a reason for hiding this comment

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

I haven't really tested this out myself on a bare bones VM, but do you think we'll need to set any basic git configuration, like username, to avoid any git prompts when calling git clone?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would that be the same as #1712? I tried to reproduce the issue by temporarily renaming my .gitconfig and confirming that my user.name was no longer set in the output of git config --list. I didn't get any prompts during plugin installation. Maybe it only affects windows?

Copy link
Member

Choose a reason for hiding this comment

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

Okay, thanks for trying to test that out. For this PR I think it's okay to see if we come across it in the wild and can take it up from there.

@emlys emlys requested a review from dcdenu4 January 24, 2025 21:34
Copy link
Member

@dcdenu4 dcdenu4 left a comment

Choose a reason for hiding this comment

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

Thanks @emlys , looks good!

@dcdenu4 dcdenu4 merged commit 2b38221 into natcap:feature/plugins Jan 27, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants