Git Product home page Git Product logo

docs's Introduction

Pulumi Documentation Site

Deployment Status Examples Tests

About this repository

This repository hosts all of the hand-crafted documentation, guides, tutorials, blogs, and landing pages that you see on https://pulumi.com, as well as all of the assets and templates we use to render the Pulumi website. It also houses the documentation that we generate for the Pulumi CLI and language SDKs, and it's responsible for building and deploying the website (with Pulumi, of course!).

What's not in this repository

Contributing

We welcome all contributions to this repository. Be sure to read our contributing guide and code of conduct first, then submit a pull request here on GitHub. If you see something that needs fixing but don't have time to contribute, you can also file an issue.

See also:

Toolchain

We build the Pulumi website with Hugo, manage our dependencies with Node.js and Yarn, and write our documentation in Markdown. Below is a list of the tools you'll need if you'd like to work on the website (e.g., to contribute docs content, a blog post, etc.):

  • Hugo (>= 0.126.0)
    • Hugo 0.126.0 is highly recommended. This is the version we use in our deployment pipelines.
  • Node.js (>= 18)
  • Yarn (1.x)

Additionally, to build the SDK and CLI documentation, you'll also need:

Repository layout

  • Documentation and page content: We generally follow Hugo's directory-structure conventions, with Markdown files in ./content, layout files (including partials and shortcodes) in ./layout, and data files in ./data. There are also several Hugo templates available in ./archetypes for bootstrapping common content types like blog posts and Learn modules.

  • CSS and JavaScript: We build our CSS and JavaScript bundles separately from Hugo and check in the built artifacts at ./assets. We use Tailwind for CSS, Stencil for web components, and jQuery for wiring things together in general. Source files for these are in ./theme.

  • Examples: Many of the examples we include in our documentation are maintained as full Pulumi programs and tested daily. You'll find them all at ./static/programs.

  • Infrastructure: We deploy the website as a statically built artifact to a unique Amazon S3 bucket on every commit to the base branch of this repo. The Pulumi program that handles this is located in ./infrastructure. This is also where you'll find the CloudFront configuration that handles proxying Pulumi AI and the Pulumi Registry.

Using the Makefile

The Makefile exposes a number of useful helpers for authoring:

  • make ensure resolves and installs all dependencies
  • make lint checks all Markdown files for correctness
  • make format formats all applicable files to ensure they conform to style guidelines
  • make serve runs the Hugo server locally at http://localhost:1313 and watches for changes
  • make serve-all does the same as make serve, but also watches for changes to CSS and JS source files
  • make build generates the website and writes it to ./public
  • make build-assets builds only the CSS and JavaScript asset bundles
  • make serve-static runs a local HTTP server that serves the contents of ./public
  • make test tests all of the programs in ./static/programs (see ./scripts/programs/test.sh for options)
  • make generate builds the TypeScript, Python, and Pulumi CLI documentation
  • make new-blog-post scaffolds a new, bare-bones blog post with placeholder content
  • make new-example-program generates a new multi-language set of examples at ./static/programs
  • make new-dev-stack creates a new dev stack (in the pulumi organization, which you must belong to)
  • make deploy-dev-stack runs a build, deploys to S3, runs the tests, and deploys to the selected dev stack

As a content contributor, the commands you'll use most often are these:

make ensure    # Install or update dependencies.
make serve     # Run the development server locally on http://localhost:1313.
make lint      # Identify any Markdown or code-formatting issues so you can fix them.

Generating SDK and CLI documentation

We generate two kinds of reference documentation with this repository: language-specific SDK docs (for a subset of Pulumi packages) and CLI docs (for command-line tools like pulumi and esc). Instructions for generating both types of docs are listed below.

SDK docs

We build and host language-specific SDK documentation for the following Pulumi packages:

The Node.js, Python, and .NET versions of these docs are built using language-specific tooling and checked into the repository as stand-alone docsets. (Go versions are sourced directly from GitHub and hosted at pkg.go.dev.)

To build the docs for these packages yourself, you'll first need to clone each package into a sibling directory. The easiest way to do this is to use the make update-repos helper:

# Clone and update all of the repositories above into sibling directories of this repo.
make update-repos

Once you've done this, you can generate the docs for each package.

Generating the Node.js and Python SDK docs

The Node and Python SDK docs are built with TypeDoc and Pydocgen. The easiest way to generate these docs is to use the make generate helper:

make ensure          # Install dependencies.
make update-repos    # Clone and update all package repositories.
make generate        # Generate the Node.js and Python docs for all packages.

Generated docs are rendered into the ./static-prebuilt/nodejs and ./static-prebuilt/python folders. At deploy-time, we copy the contents of these folders into ./docs/reference/pkg to make them available on pulumi.com -- for example, here and here.

See below to learn how to view these rendered docs locally.

Generating the .NET SDK docs

The .NET SDK docs are built with Docfx. To generate these, you'll need both dotnet and docfx installed and on your PATH. For example, assuming you've already installed the dotnet executable for your platform, you can:

make ensure                     # Install dependencies.
make update-repos               # Clone and update all package repositories.
dotnet tool install -g docfx    # Install docfx globally, following the instructions to ensure it's on your PATH.
docfx build docfx/docfx.json    # Generate the .NET docs.

CLI docs

The make generate helper also generates the Pulumi CLI documentation. If you'd prefer not to use that helper (e.g., to avoid having to clone all the repos and generate SDK docs), you can build them directly using the pulumi and esc CLIs:

pulumi gen-markdown ./content/docs/cli/commands    # Generate Pulumi CLI documentation.
esc gen-docs ./content/docs/esc-cli/commands       # Generate Pulumi ESC CLI documentation.

Generated docs reflect the functionality of the currently installed CLI, so make sure you've installed the latest public version of each one (pulumi, esc) before running these commands and submitting your PR.

Viewing rendered SDK and CLI docs locally

After building the SDK and/or CLI docs, you can view them locally with make build and make serve-static.

For example, from a fresh clone of this repository, you can install all dependencies and generate and browse the Node.js, Python, and Pulumi CLI docs using the following sequence:

make ensure          # Install dependencies.
make update-repos    # Clone and update all package repositories.
make generate        # Generate the Node.js, Python, and Pulumi CLI docs.
make build           # Build the website, copying all generated docs into place.
make serve-static    # Serve the built website statically to make sure everything looks right.

With make serve-static running, you can browse to the docs by navigating to http://localhost:8080/docs. Then, from the left-hand menu:

  • Choose Languages & SDKs followed by your language of choice, then scroll to the bottom of the page to find the package you're interested in
  • Choose Pulumi CLI or Pulumi ESC CLI, then Commands

Checking in generated docs

All generated docs, including all Node.js, Python, and .NET SDK docs and all Pulumi and Pulumi ESC CLI docs, get checked into this repository.

Migrating from pulumi-hugo

The pulumi-hugo repository was archived on May 16, 2024. This repository previously housed most of our website content. This content has now moved to this repository. There is a slight directory structure change in this repo compared to pulumi-hugo. For the most part, everything that was located under the themes/default directory in pulumi-hugo now lives under the root directory of this repository, i.e. themes/default/content/blog is now under /content/blog. Everything still functions the same way it did previously when it comes to local devleopment, e.g. make ensure, make serve, make build-assets, etc.

How to migrate PRs from the pulumi-hugo repo

If you have open pull requests in the pulumi-hugo repo, here are the steps to follow in order to move them over to the docs repository. You will need to copy over your files to the docs repo and place them in the new directory location.

Steps:

  1. Clone the docs repo if you haven't done so already.
  2. Create a new branch in the docs repository.
  3. Copy the files you changed/added to the docs repo. The directory structure is similar to how this repo was configured, except everything under themes/default has been moved to the root. For example, if you have a blog under themes/default/content/blog/my-cool-blog, you will need to relocate it under content/blog/my-cool-blog in the docs repo.
  4. Run make ensure in the docs repo and then a make serve to verify the files have been moved correctly.
  5. Push changes to the docs repo.
  6. Open a PR in the docs repo to add the changes there.

docs's People

Contributors

aaronkao avatar arunkumar611 avatar bermudezmt avatar chrsmith avatar cleverguy25 avatar cnunciato avatar cyrusnajmabadi avatar desteves avatar ellismg avatar evanboyle avatar gthuang avatar joeduffy avatar justinvp avatar lblackstone avatar lindydonna avatar lukehoban avatar meagancojocar avatar metral avatar mikhailshilkov avatar mnlumi avatar praneetloke avatar pulumi-bot avatar saradph avatar sean1588 avatar shughes26 avatar spara avatar stack72 avatar susanev avatar toriancrane avatar usrbinkat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Improve quickstart for Programming the Cloud

  • Add back serverless example
  • Change current Programming the Cloud tutorial to Programming containers
  • Address Luke's high-level feedback below
  1. The Programming the Cloud section no longer really feels like programming the cloud - there are no high level managed services being programmed here (like Table or HttpEndpoint or Topic or even Function). I suggest we'll want to have three top level sections: (1) Programming AWS (2) Programming containers (3) Programming the Cloud.
  2. The container example is nice and relatable - but perhaps too relatable again in a different direction it's not clear why this is any better than a similar docker-compose example. In fact, as written, I'd say it's tenuous that it actually is better. There's a subtle (but important) point that it is better because of the build support even when targeting a production environment - I think we will need to explain the core to what's different here - and why that difference is central to what makes Pulumi unique (not just another one off thing we did "differently") - which I believe is true - the core model that cloud applications are made up of both application and infrastructure code which can and should in many cases version together - the same thing that motivates lambdas as lambdas and our overall @pulumi/cloud model. There's also the claimed benefit that we allocate the ECS cluster for you - but that's really an antipattern - you shouldn't be deploying a whole cluster just to host a single app! The real "magic" of the container support is that it can be combined with the rest of our offerings, in both direction - fixed AWS infrastructue as well as high level functions, APIs, tables etc.
  3. Related to these points - this makes me even more eager to get to the one example which really highlights Pulumi all up at once - something that feels more like what we've used for LM or for our PPC or even in the containers unit test. Something that is really more fundamentally uniquely "Pulumi".

Anchor tags are not scrolled properly

The space taken by the header makes it so that when you try to go to a section anchor, the section name is cut off. I verified that removing the header makes the anchor behave as expected.

Current:

image

Expected:

image

Fix misbehaving <hr> in `master` branch

The <hr> defined in footer.html is misbehaving and moves around the page depending on your zoom level. This is only an issue with the new navigation in the master branch (production is fine).

image

Quickstart: is yarn required?

I'm having an issue in the quickstart, which could just be operator error.

  • Page: quickstart/overview.html
  • Section: Packages

I read the instructions below as saying I can use "npm link" or "yarn link" equivalently. Note that I'm using npm.

The following three packages are included in the Pulumi Cloud SDK by default. Before using any of them, please remember to run npm link or yarn link in the consuming Cloud Application’s root directory.

The 3rd step below fails for me:

$ cd myapp
$ yarn link pulumi
$ yarn link @pulumi/pulumi-cloud   <<<<
$ pulumi preview

with this message, indicating the message isn't available in npm. Does this mean I have to use yarn? Will it be published to npm?

Kims-MacBook-Pro:pulumi kim$ npm link @pulumi/pulumi-cloud
npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/kim/.nvm/versions/node/v6.10.2/bin/node" "/Users/kim/.nvm/versions/node/v6.10.2/bin/npm" "link" "@pulumi/pulumi-cloud"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code E404

npm ERR! 404 Not found : @pulumi/pulumi-cloud
npm ERR! 404
npm ERR! 404  '@pulumi/pulumi-cloud' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Don't check in Typescript generated artifacts

Today we check in the results of make generate into the /packages folder. But this generally isn't want we do for generated sources.

Let's back out those files, and then just add the script or two needed to build/sync the various dependent repos so that make generate does all it needs to.

Quickstart for LM release

Remaining TODO:

  • [P1] Initial creation of content
  • [P1] Document pulumi.zip installation and setup correctly
  • [P2] Colorized syntax highlighting in code blocks
  • [P2] Cross-link scrolling offset (not visible after clicking link)

Change quickstart AWS example to be simpler

Have the first step not use the userData definition, then have customers add it as a later step. The downside is that you have to re-provision the VM, as the update can't be applied to a running VM.

Do another pass over the Quickstart

A bit of feedback from customers on the M8.1 Quickstart docs:

There is a typo on the first page: it says to yarn link @pulumi/pulumi-cloud, but that should be @pulumi/cloud.

It seems like we ought to have a new section: "So you've got a Pulumi program, and want to build/deploy it, how do I do that?" Everything is geared towards starting from scratch, so there are steps missing. For instance, it should tell you to yarn install, how to find out what to yarn link, how to know what configuration variables to set, etc.

There are other missing steps. For example, it never tells you how to compile your TypeScript which, though orthogonal to our tool, we should do if we're going to use it in our samples.

The layout of the Quickstart pages are a little confusing, because clicking on the link to Quickstart then puts you on a page with many links, including Overview. Why not just start there automatically.

Let's do one more pass over the Quickstart "as a customer would", after the above changes, and ideally from a clean machine, just to make sure we've ironed out all the kinks.

Stop checking artifacts into git-lfs

Right now we check in our releases to git via Git-LFS.

We should stop doing that as we are running out of space. Long term we should be serving them out of S3 (proxies by the docs website to do an auth check).

If we need to do something sooner we can just download the binaries from S3 into the releases folder on the docs web server.

Improve our TypeScript documentation story

Today we are just checking the results of typedoc into the repo. This provides a pretty disjoint experience with regard to UX, and also prevents cross-module linking. (e.g. pulumi-cloud referencing types in the pulumi package.)

And, to make matters worse, because typedoc emits files prefixed with an "" we need to contort Jekyll to include those files, since the default is to assume files prefixed with "." or "" are not to be included with the website.

Options:

  • Create our own plug-in and template and continue to use typedoc. Hopefully find a workaround or fix for their file naming convention.
  • Use typedoc's ability to output structured JSON, and build our own template/system that is better integrated with Jekyll. (Using the "collections" or "data" features.)
  • Something even better.

Start a "Known Issues" page/site/etc

@ericrudder commented on Mon Nov 06 2017

credit to donna:

we should create a known issues page, and make sure it's linked to in our documentation, and every issue has a link to a GitHub issue


@joeduffy commented on Mon Nov 13 2017

I am okay letting this slide to M9. /cc @lindydonna


@lindydonna commented on Mon Nov 13 2017

Sorry to drop this. Do we need more than a GitHub wiki page? Are we assuming that everyone who needs to see it will have access to GitHub?


@lindydonna commented on Mon Nov 27 2017

Ping @joeduffy and @ericrudder. If we're assuming that everyone will have access to GitHub, this is a very easy item. If not, then we'll need to link to issues in some other way.

Add an example that shows deployment vs runtime

A simple example that shows deployment time vs. runtime (f.k.a. "inside" vs "outside") show the difference between getting the current date/time inside the body of a Lambda vs. a declaration outside.

Improve 403 Forbidden error case

If you are not authorized to access the website (GitHub account authorized, but not on a whitelist) we should provide that information to the user. e.g. "You were not on any whitelisted GitHub organizations or email domains. Please contact [email protected] if you believe this is an error."

Create a staging docs site

For next version of docs site, would be useful to have a staging version to see changes live. This can just be a VM to host the docs as we do today.

Tracking item for known product changes that impact docs

This issue is mainly for me to track product changes that will impact docs.

Names

  • Names of products (managed service)
  • CLI name (pulumi invocation)
  • package names (how you reference them from npm, how you reference in your code)

Terminology

  • "Pulumi program" vs something else

CLI functionality

  • --local requirement for pulumi stack init
  • pulumi init
  • Verbs for config

Stack identity

  • How is a local stack identified?

Config

  • How to use config in your code
  • How to define config in config file(s)
  • How to create a secret value

Author new Getting Started material

There are very long documents that are not well-structured. This issue tracks putting them in the new doc layout and making them more focused.

Fix Typescript formatting

We might need to add a Jekyll module. Triple-backtick "typescript" seems to still render as JavaScript.

image

Reference docs for the Pulumi Console

Document how to get started using the Pulumi Cloud Management Console.

  • Logging in
    • Explaining our use of GitHub for access and auth
  • Standing up and attaching PPCs
  • Configuring the pulumi CLI (set PULUMI_API env var)
  • Navigating a Stack
    • Resource list
    • Accessing logs
    • Accessing update history

/cc @ericrudder Anything look missing to you?

Update docs with how-to guides in addition to quickstart

  • Document top-level flows like using TypeScript, etc
  • Document current config precedence

Joe's feedback in #20:

It seems like we ought to have a new section: "So you've got a Pulumi program, and want to build/deploy it, how do I do that?" Everything is geared towards starting from scratch, so there are steps missing. For instance, it should tell you to yarn install, how to find out what to yarn link, how to know what configuration variables to set, etc.

There are other missing steps. For example, it never tells you how to compile your TypeScript which, though orthogonal to our tool, we should do if we're going to use it in our samples.

The layout of the Quickstart pages are a little confusing, because clicking on the link to Quickstart then puts you on a page with many links, including Overview. Why not just start there automatically.

Let's do one more pass over the Quickstart "as a customer would", after the above changes, and ideally from a clean machine, just to make sure we've ironed out all the kinks.

Add a left-hand TOC for articles in a section

To start, just replace the way we're using index.md, so you go right into Overview (or such) and other articles in the section are listed on the left.

For instance, if you're in any article in the Quickstart section, you'd see:

  • Concepts
  • Overview
  • Programming AWS
  • Programming the Cloud

have a way to "fold" long code/output in our docs

ideally, we'd use some JS voodoo on the "huge" gray boxes in the doc, to "improve the flow when reading." ... e.g. for things over 25 lines, we'd preview 10 or something and show an "..." or more or something like that.

not urgent, however, a nice to have if our output is really verbose.

maybe we get for free if we pick up vscode editor and can just apply policy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.