Skip to content

CLI v2 - #208

Merged
aluzzardi merged 23 commits into
mainfrom
cli-ux
Mar 31, 2021
Merged

CLI v2#208
aluzzardi merged 23 commits into
mainfrom
cli-ux

Conversation

@shykes

@shykes shykes commented Mar 23, 2021

Copy link
Copy Markdown
Contributor

Working branch for ongoing implementation of a mockup for CLI v2 (v1 is the current version with dagger compute only).

@shykes

shykes commented Mar 23, 2021

Copy link
Copy Markdown
Contributor Author

FYI @samalba we can push everything here to stay in sync:

  • Adjustments to spec
  • Frontend cobra implementation
  • Backend state management implementation

@verdverm

Copy link
Copy Markdown
Contributor

small note: https://github.com/dagger/dagger/blob/cli-ux/cmd/spec.cue#L135 will conflict with the short flag for --log-level when implemented in cobra

@verdverm

Copy link
Copy Markdown
Contributor

Another thought, dagger query eventually adopting upstream query syntax (cuelang/cue#165)

No opinion if we should think about future proofing or compatibility today however

@shykes

shykes commented Mar 23, 2021

Copy link
Copy Markdown
Contributor Author

Trying on a new terminology for size. Don’t panic, nothing is set in stone :)

  • “stack” becomes “route” (as in shipping route - a metaphor for the DAG that delivers all the right pieces of my app to the right places, in the right order)
  • “base configuration” becomes “layout” (good fit with route metaphor for DAG; more distinctive than “base”; doesn’t require the qualifier “configuration” so shorter)
  • updated README inspired by the above
  • mockup implementation for a backup API: dagger.io/go/dagger/Route and associated methods

@shykes

shykes commented Mar 23, 2021

Copy link
Copy Markdown
Contributor Author

small note: https://github.com/dagger/dagger/blob/cli-ux/cmd/spec.cue#L135 will conflict with the short flag for --log-level when implemented in cobra

Good catch, thanks. I have a fix in mind, will push it tomorrow.

@shykes

shykes commented Mar 23, 2021

Copy link
Copy Markdown
Contributor Author

@verdverm I pushed a fix to the query -l conflict, thanks.

@shykes
shykes force-pushed the cli-ux branch 3 times, most recently from d0f78d9 to 5588631 Compare March 24, 2021 17:41
@shykes

shykes commented Mar 24, 2021

Copy link
Copy Markdown
Contributor Author

@samalba I pushed a skeleton API to manage inputs & layout.

@aluzzardi
aluzzardi force-pushed the cli-ux branch 3 times, most recently from ee385cd to 6e8cc7f Compare March 25, 2021 21:19
Signed-off-by: Andrea Luzzardi <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
@verdverm

Copy link
Copy Markdown
Contributor

How can I consume ENV VARs as inputs?

For example, my CI system exposes some credentials as ENV VARS.

Is there a way to avoid having to list them all via flags? Is there a way to reference them within the Dagger config?


role playing here, I can see this question coming up. This is not valid within pure CUE (allowed within cue/flow), but maybe Dagger can act as a forwarder somehow?

@verdverm

Copy link
Copy Markdown
Contributor

https://github.com/dagger/dagger/pull/208/files#diff-21de6ef71086d885bb3e6128f34c35b2625d614b1e69cd45c436494f549df0fcR38

This line means I am unable to use valid CUE organization. In the context of Dagger, not sure how the compute will be proxied from the other commands. As a user of Dagger, I can see wanting to capture common patterns or components into something that is shared across my routes. I'm thinking about dev/stg/prd setups, with possibly substituting more than values, for example using Sqlite in CI or staging vs Postgres in production. It seems like there would be different dagger components for the database while my application would likely use the same component.


The current args to dagger compute look like a directory, and then only CUE files + the cue.mod are selected from there. If we could supply the entrypoints to cue.Load as the arguments, opting for args[:] then this would match how entrypoints are supplied to the CUE CLI. This is also where we are doing this to avoid sending a large context over the wire, and where the .daggerignore idea arose, so that we could support the same CUE entrypoints as args and limit the upload context at the same time.

This also seems to force a cue.mod per "route" (the current name in the code) where as I may want a layout like:

repo/
  cue.mod/...
  
  routes/
    dev/
    stg/
    prd/
    
    (maybe these are appA, appB? still unclear how route relates to my env/app matrix, especially with a GitOps repo that references N microservices)

@shykes

shykes commented Mar 26, 2021

Copy link
Copy Markdown
Contributor Author

How can I consume ENV VARs as inputs?

For example, my CI system exposes some credentials as ENV VARS.

Is there a way to avoid having to list them all via flags? Is there a way to reference them within the Dagger config?

role playing here, I can see this question coming up. This is not valid within pure CUE (allowed within cue/flow), but maybe Dagger can act as a forwarder somehow?

See my response to the same question by @dubo-dubon-duponey : #50 (comment)

@verdverm

verdverm commented Mar 26, 2021 •

Copy link
Copy Markdown
Contributor

@verdverm

Copy link
Copy Markdown
Contributor

Is it possible to have two projects which use the same route name?

@shykes

shykes commented Mar 26, 2021

Copy link
Copy Markdown
Contributor Author

Is it possible to have two projects which use the same route name?

No, at least not in the local namespace of a given dagger installation.

@verdverm

verdverm commented Mar 26, 2021 •

Copy link
Copy Markdown
Contributor

so would the following cause problems?

projA/
  routes/
    dev/
    stg/
    prd/

projB/
  routes/
    dev/
    stg/
    prd/

when I want to dagger up from both projA and projB


Suppose I want to dagger up from CI, does that require first registering a route? Should up / down take a path as an arg for an "unnamed" route to operate on?

@shykes

shykes commented Mar 26, 2021 via email

Copy link
Copy Markdown
Contributor Author

@verdverm

Copy link
Copy Markdown
Contributor

In this case, I believe I am storing the dagger CUE files in each of the different route subdirs, not the route state.

What I'm trying to get at, is that there is not preserved route state in $HOME when I use this in CI, correct?

aluzzardi and others added 4 commits March 26, 2021 14:11
Signed-off-by: Sam Alba <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
@verdverm

Copy link
Copy Markdown
Contributor

Will the --input-* flags for dagger compute be added to the other commands which may need values at the time they are run? (up, down, delete, etc)

@shykes

shykes commented Mar 29, 2021

Copy link
Copy Markdown
Contributor Author

Will the --input-* flags for dagger compute be added to the other commands which may need values at the time they are run? (up, down, delete, etc)

No, input values are part of the state, and need to be changed with dagger input. In other words, the equivalent of a stateless dagger compute + input flags happens automatically.

@aluzzardi aluzzardi changed the title CLI v2 mockup CLI v2 Mar 31, 2021
@aluzzardi
aluzzardi merged commit e503e12 into main Mar 31, 2021
@aluzzardi
aluzzardi deleted the cli-ux branch March 31, 2021 02:07
aluzzardi pushed a commit that referenced this pull request Sep 16, 2022
…99designs/gqlgen-0.17.17

build(deps): bump github.com/99designs/gqlgen from 0.17.16 to 0.17.17
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.

4 participants