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

META - conda-store CLI #248

Closed
pierrotsmnrd opened this issue Mar 1, 2022 · 9 comments
Closed

META - conda-store CLI #248

pierrotsmnrd opened this issue Mar 1, 2022 · 9 comments
Labels
needs: discussion 💬 This item needs team-level discussion before scoping type: enhancement 💅🏼

Comments

@pierrotsmnrd
Copy link
Contributor

The goal of this issue is to scope what a conda-store cli should do, and how to do it.

@costrouc Let's start by listing the features you have in mind here, and we'll refine the expected behaviours, parameters, etc.

@costrouc
Copy link
Member

costrouc commented Mar 2, 2022

Just some of my thoughts

Conda-Store CLI Brainstroming

High level design:

  • conda-store is the <command-name>
  • would like to follow <command-name> <action> <noun> ... with no
    more nesting only options. Accepts nouns in plural and non-plural
    form.
  • there will only be one way to perform each action
  • NO install, delete, update packages action. Instead we point users
    to use edit which will drop them into their prefered editor to edit the
    environment. Similar to how git commit will drop you into an editor.
  • all actions the print output will have a json option when it makes sense

Commands:

  • =auth= :: login, logout, info
    • login :: will login the user possibly sending them to a login page in their browser
    • logout :: remove local login state
    • info :: give information to user about their credentials once logged in
  • =namespace(s)= :: list, create, delete
    • list, create, delete think these are intuitive, ability to perform action will be dependant on permissions
  • =env(s)/environment(s)= :: list, create, delete, get, update, edit
    • list :: rich filtering options
    • create, delete will create or delete a given environment
    • get :: show a particular environment will default to fetching
    • update :: update current environment with given filename
    • edit :: will fetch the current environment.yaml and open an editor and once saved and editor exited the environment will be updated.
  • =pkg(s)/package(s)= :: list, get
    • list :: rich filtering options, heavily caching on the user's machine
    • get :: gets particular package
  • =channel(s)= :: list

Future

  • =conda-store environment solve =
    • this command will solve the given environment remotely via
      conda-store
  • =conda-store environment activate <namespace/name>=
    • this command will interact with conda-store to download the
      given environment and open a shell =/bin/sh= (entrypoint)
  • =conda-store environment run <namespace/name> -- =

@gabalafou
Copy link
Contributor

That was fast! You must have already started this document sometime in the past hehe.

I assume that conda-store help is just a given, and it will display something similar to what you have typed above?

If we're not going to have imperatives for what seem to me like basic operations—such as "add this package", "remove that package"—then it would be nice if conda-store help outputs a how-to section for a few of the most common tasks, like so:

How to:

Add a package

    To add a package to a Conda Store environment, you must add it to the list of dependencies 
    in the environment specification file (environment.yml). To edit that file in your default text 
    editor, run:

    conda-store env edit <namespace>/<environment>

    When you save and exit, Conda Store will start a new build.

Start a new environment from scratch

    First create an empty environment:

    conda env create <namespace>/<environment>

    Then add initial packages. The initial specification will be a skeleton file for you to fill in:

    conda env edit <namespace>/<environment>
    
Etc. (maybe just one more)

How hard would it be for me to make some aliases like csadd, csrm, csup so that I could run them like csadd nodejs=16, which would add Node.js 16 into my current or default environment?

A few more issues and questions:

  • There's probably no helping this, but conda-store feels pretty lengthy to me for a command. My fingers are lazy.
  • I might suggest replacing get with info for consistency. As in, I'm not sure why it should be auth info but env get
  • I'm worried about possible confusion between env update and env edit.
  • Given the list of proposed commands, how would a user clone an existing environment?
  • How stateful is the conda-store command? Besides keeping track of logged in, logged out, and caching package search results, does it have any notion of a current working namespace or current working environment or stuff like that?
  • What does env get do? I mean, what does that command actually return?
  • What does env solve do? The description didn't make it clear for me.
  • What does env run do?

@dharhas
Copy link
Member

dharhas commented Jun 24, 2022

@jaimergp Your input would be helpful here as well.

@costrouc
Copy link
Member

A uri is either <namespace>/<name>, <name>, <namespace>/<name>:<build id>, or <build id> which all reference a build

Currently in the PR #327 I have added what I would call the uncontroversial bits:

  • conda info
  • conda run <uri> --command ....
  • conda download <uri>

I'm looking for the discussion about the environment, build, namespace interaction.

@jaimergp
Copy link
Member

jaimergp commented Jul 5, 2022

Sorry I was on PTO! I have some questions about the conda-store env subcommand:

=env(s)/environment(s)= :: list, create, delete, get, update, edit
list :: rich filtering options
create, delete will create or delete a given environment
get :: show a particular environment will default to fetching
update :: update current environment with given filename
edit :: will fetch the current environment.yaml and open an editor and once saved and editor exited the environment will be updated.
  • conda-store env list will: (A) list all available environments? (B) list the packages in that environment? I always found that bit confusing in conda.
  • edit vs create/delete: what happens if I try to edit a non-existing env? Will it default to creating it? What if I edit and remove all the packages in the environment? Will the environment be deleted as well? These are important questions for {pre,post}-{activation,link} scripts.
  • How is update different from edit? How would a file instruct a set of editions? Simply by overwriting everything, or would you try to merge?. I'd say edit could have a flag to use -f as an input file path? But we'd need to discuss interactivity expectations there.

@kcpevey
Copy link
Contributor

kcpevey commented Jul 6, 2023

What is the status of the CLI? Can we break this down into more specific issues at this point?

@trallard trallard added the needs: discussion 💬 This item needs team-level discussion before scoping label Jul 21, 2023
@trallard trallard moved this from New 🚦 to TODO 📬 in conda-store 🐍 Jul 31, 2023
@trallard trallard added this to the 🚀 JATIC - Q1 milestone Jul 31, 2023
@trallard trallard moved this from New 🚦 to Ready 🛎️ in conda-store 🐍 Aug 9, 2023
@trallard trallard changed the title New feature : conda store CLI META - conda-store CLI Aug 15, 2023
@pierrotsmnrd
Copy link
Contributor Author

CLI now exists. This issue contains informations about desired features, hence marking it as META.

@kcpevey
Copy link
Contributor

kcpevey commented Aug 21, 2023

Given that this issue is so old and we now have a CLI, can we open up new more specific issues about what is needed at this point? Its kind of hard to tell what has been done here and what has not.

@costrouc
Copy link
Member

@kcpevey agreed. This issue is too broad and since we have a cli client we need discussion to revolve around how to improve/change it. I would consider the cli as it extremely experimental as is. I only spent a few days writing it and was not able to deeply think about the commands.

@github-project-automation github-project-automation bot moved this from TODO 📬 to Done 💪🏾 in conda-store 🐍 Aug 24, 2023
@github-project-automation github-project-automation bot moved this from Ready 🛎️ to Done 💪🏾 in conda-store 🐍 Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: discussion 💬 This item needs team-level discussion before scoping type: enhancement 💅🏼
Projects
Archived in project
Development

No branches or pull requests

7 participants