Skip to content

Client API#1668

Merged
aluzzardi merged 1 commit intodagger:mainfrom
helderco:client-api
Mar 7, 2022
Merged

Client API#1668
aluzzardi merged 1 commit intodagger:mainfrom
helderco:client-api

Conversation

@helderco
Copy link
Copy Markdown
Contributor

@helderco helderco commented Feb 28, 2022

Implementation for the new Client API proposal.

Fixes #1597
Fixes #1595
Fixes #1581

Signed-off-by: Helder Correia

@helderco helderco requested a review from aluzzardi February 28, 2022 16:43
@helderco

This comment was marked as resolved.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 1, 2022

@helderco helderco mentioned this pull request Mar 3, 2022
@grouville
Copy link
Copy Markdown
Member

grouville commented Mar 4, 2022

For context/history purposes: tested locally with @helderco

The npipe implementation works, but there are still two parsing issues when retrieving the absolute path (in Windows only). Also, Cue makes it impossible, in the current form, to specify powershell paths: \\.\pipe\docker_engine

@helderco
Copy link
Copy Markdown
Contributor Author

helderco commented Mar 4, 2022

Thanks @grouville, can you please test again, just to confirm?

dagger.exe -p ./tests/plan/client/filesystem/read/service/windows.cue do test

@helderco
Copy link
Copy Markdown
Contributor Author

helderco commented Mar 4, 2022

Also, Cue makes it impossible, in the current form, to specify powershell paths: \\.\pipe\docker_engine

Yeah, you'd need to escape all of those back slashes, but it's possible:

filesystem: "\\\\.\\pipe\\docker_engine": read

@helderco helderco changed the title [WIP] Client api Client api Mar 4, 2022
@helderco
Copy link
Copy Markdown
Contributor Author

helderco commented Mar 4, 2022

@aluzzardi Should I maybe do the cleanup in another PR instead of this one?

@grouville
Copy link
Copy Markdown
Member

grouville commented Mar 5, 2022

Thanks @grouville, can you please test again, just to confirm?

dagger.exe -p ./tests/plan/client/filesystem/read/service/windows.cue do test

Tested locally. Everything works fine, even with "\\\\.\\pipe\\docker_engine". LGTM on this part 🔥

@helderco helderco changed the title Client api Client API Mar 7, 2022
@gerhard gerhard mentioned this pull request Mar 7, 2022
13 tasks
Signed-off-by: Helder Correia <[email protected]>
Copy link
Copy Markdown
Contributor

@aluzzardi aluzzardi left a comment

Choose a reason for hiding this comment

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

LGTM

There's the question of moving env to a regular task. I think we can merge this as is and continue the discussion.

Left a few minor comments but those can be addressed in a follow up as well

@aluzzardi aluzzardi merged commit 6b4674a into dagger:main Mar 7, 2022
@aluzzardi aluzzardi deleted the client-api branch March 7, 2022 23:55
@gerhard
Copy link
Copy Markdown
Contributor

gerhard commented Mar 8, 2022

Before this change, we would use inputs.params.app.name

This property used to help distinguish between cache mounts, e.g. https://github.com/dagger/dagger/pull/1693/files#diff-d941b232905b7945682101f64df497593dcb84a5c987bd59e46fb54bd5cd3117R33-R38

How does this change affect that approach?

@helderco
Copy link
Copy Markdown
Contributor Author

helderco commented Mar 8, 2022

The answer to that depends mostly on #1648.

You can just move params into actions:

dagger.#Plan & {
    actions: {
        params: app: *"todoapp" | string

        build: {}
        test: {}
    }
}

It doesn't have to be params. --with overlays with any field, no matter the name/structure.

@helderco
Copy link
Copy Markdown
Contributor Author

helderco commented Mar 8, 2022

More context:

Where would you keep inputs: params and outputs: values?

Good question. They are out of scope from client, but there are hints of possible solutions:

  • human-readable outputs: Action API #1598 defines a $dagger: after: string field to control what is printed to the user

  • machine-readable inputs & outputs: 0.2 CLI #1558 defines a new UI where the focus is on a single action. Since actions have fields already.. maybe those can act as params/values and there is no need to duplicate? More design & discussion needed.

Originally posted by @shykes in #1597 (comment)

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.

Client API Read the client's platform (os and arch) from actions Race condition writing same file dest on client

5 participants