Skip to content

docs: Add API and CLI documentation - #3917

Merged
vikram-dagger merged 2 commits into
dagger:mainfrom
vikram-dagger:3780-dagger-api-cli-docs
Nov 30, 2022
Merged

vikram-dagger merged 2 commits into
dagger:mainfrom
vikram-dagger:3780-dagger-api-cli-docs

Conversation

@vikram-dagger

@vikram-dagger vikram-dagger commented Nov 18, 2022 •

Copy link
Copy Markdown
Contributor

This commit adds documentation for the API and the CLI. This commit includes reference documentation for both, installation
steps for the CLI, tutorials and guides for both, and an introduction to the API Playground. This commit also updates the general FAQ with entries related to the GraphQL API.

This commit also adds a new ExternalButton component that produces a button linking to an external URL and opening that URL in a separate tab/window.

Closes #3741 , #3622, #4024

Signed-off-by: Vikram Vaswani [email protected]

@vikram-dagger
vikram-dagger marked this pull request as draft November 18, 2022 08:56
@vikram-dagger vikram-dagger mentioned this pull request Nov 18, 2022
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch 3 times, most recently from 2a029f0 to 0355ab1 Compare November 21, 2022 17:06
Comment thread docs/current/api/990050-index.md Resolved
@vikram-dagger

Copy link
Copy Markdown
Contributor Author

the linter is failing with

 #19 1.602 docs/current/cli/979595-reference.md:88 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "#### Example"]
#19 1.602 docs/current/cli/979595-reference.md:100 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "#### Usage"]
#19 1.602 docs/current/cli/979595-reference.md:106 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "#### Options"]

I'm not sure we can avoid these duplicates for the reference page. Should we disable this check for this page, or for this PR?

@mircubed

Copy link
Copy Markdown
Contributor

Feedback from 11/22 meeting with @shykes @kpenfound @jpadams @vikram-dagger @marcosnils

Overall feedback:

  • Single GraphQL API section - Make sure it says "GraphQL API" vs just API
  • Single CLI section with guides and refernce (not getting started guide)
  • Overview - 3 types of users 1) program with shell scripts 2) wrote own clients 3) use SDK, but want to go deeper
  • Get started guide that walks through typical things that you'd do in an SDK, but in graphQL. This should cover what you need to know for GraphQL if it is new to you (point to the existing GraphQL docs right now to save time) and then you can skip that section if you already know GraphQL.
  • Maybe point to the "getting started" GraphQL docs for now to save time and then we can write our own later.
  • Maybe use tab for the getting started guide - one for playground and one for CLI (for CLI, explain what it is and who it is for)
  • We need to update the docs.dagger.io overview page with a CTA to the API docs like we have for the SDKs.
  • mention two limitations for playground - playground is on our servers, so you shouldn't load any creds/secrets, we don't have access to your host.filesystem, and can't connect to local computer network

Command guides needed in the CLI section:

  • A single guide as "write Dagger using a shell script" with sub-guides below. The commands below would be their own guides.
  • Dagger query examples needed - this is the one we need for launch for sure.
  • Dagger listen - show how to curl - this is one that we need for launch
  • Dagger exec needs to be documented - this can wait until after launch, so we add this to the backlog

Here are some shell examples to pull from:
https://github.com/jpadams/dagger-jenkins-java/blob/main/Jenkinsfile
https://github.com/jpadams/dagger-jenkins-java/blob/main/dagger1gradle.sh
https://github.com/jpadams/dagger-jenkins-java/blob/main/queries.graphql

Next steps:
@vikram-dagger get started on updates from notes above and work with @marcosnils on examples
Next sync with @shykes will be Monday

@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from 0355ab1 to 8d4c583 Compare November 23, 2022 14:26
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I read through #3555, and I understand this might change. I'm assuming it's correct for now, but let me know if not. Also, is there a way for a user to identify in the API reference which fields trigger execution? If not, can you please provide a short list of common ones here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There isn't a list of fields that trigger execution. But it would be useful to define a simple rule that people can memorize.

The rule I've been using so far is something like:

The Dagger API is data-oriented. You query for data, and dagger returns that data. If executing a command is necessary to return that data, it will do so. When crafting a pipeline, ask yourself: what data do you need that pipeline to return? Is it an artifact? The result or standard output of a command? Most of the time, actually executing a command is just an implementation detail of what you actually want

Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/cli/752479-guides.md Resolved
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from 8d4c583 to a21cbd4 Compare November 23, 2022 14:47

@shykes shykes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking good. I left some comments and edits.

Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There isn't a list of fields that trigger execution. But it would be useful to define a simple rule that people can memorize.

The rule I've been using so far is something like:

The Dagger API is data-oriented. You query for data, and dagger returns that data. If executing a command is necessary to return that data, it will do so. When crafting a pipeline, ask yourself: what data do you need that pipeline to return? Is it an artifact? The result or standard output of a command? Most of the time, actually executing a command is just an implementation detail of what you actually want

Comment thread docs/current/api/990050-index.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A simple stack diagram here would be useful.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread docs/current/cli/698277-index.md Resolved
Comment thread docs/current/cli/752479-guides.md Resolved
Comment thread docs/current/cli/979595-reference.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from a21cbd4 to 844a3aa Compare November 24, 2022 17:53
Comment thread docs/current/cli/465058-install.md Resolved
Comment thread docs/current/162770-faq.md Resolved
Comment thread docs/current/162770-faq.md Resolved
Comment thread docs/current/162770-faq.md Resolved
Comment thread docs/current/162770-faq.md Resolved
Comment thread docs/current/162770-faq.md Resolved
Comment thread docs/current/cli/465058-install.md Resolved
Comment thread docs/current/cli/465058-install.md Resolved
Comment thread docs/current/cli/465058-install.md Resolved
Comment thread docs/current/cli/465058-install.md Resolved
Comment thread docs/current/cli/465058-install.md Resolved
@marcosnils

Copy link
Copy Markdown
Contributor

@vikram-dagger did a first pass and left some comments. LMK if you need to sync.

@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch 4 times, most recently from 8ddd994 to b61a312 Compare November 25, 2022 08:08
Comment thread website/sidebars.js Resolved
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch 4 times, most recently from 7092bc1 to 965b42b Compare November 29, 2022 12:19
@vikram-dagger
vikram-dagger marked this pull request as ready for review November 29, 2022 12:24
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from 965b42b to c372dbb Compare November 29, 2022 15:42
@kpenfound

Copy link
Copy Markdown
Contributor

Should the "Try It!" button instead be the same as "Try it in the API Playground!" button in #3745 ?

@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from c372dbb to 9994713 Compare November 29, 2022 20:01
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from 9994713 to 48667c2 Compare November 29, 2022 20:09
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
Comment thread docs/current/api/975146-concepts.md Resolved
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch 3 times, most recently from c4a0f35 to f3f4afd Compare November 30, 2022 12:58
This commit adds documentation for the API and the CLI.
This includes reference documentation for both, installation
steps for the CLI, tutorials and guides for both, and an
introduction to the API Playground. This commit also updates
the general FAQ with entries related to the GraphQL API.

This commit updates the website navigation to include links
to the above documentation. This commit also adds a new
component that produces a button linking to ia Playground URL and
opening that URL in a separate tab/window.

Signed-off-by: Vikram Vaswani <[email protected]>
@vikram-dagger
vikram-dagger force-pushed the 3780-dagger-api-cli-docs branch from 09c72a5 to ebc748b Compare November 30, 2022 16:01
Signed-off-by: Vikram Vaswani <[email protected]>
@vikram-dagger
vikram-dagger merged commit b665b86 into dagger:main Nov 30, 2022
@gerhard
gerhard deleted the 3780-dagger-api-cli-docs branch January 27, 2023 23:18
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.

Engine, Playground and CLI Documentation Section

7 participants