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

Improve docs and enable reliable multi-stage caching #601

Merged
merged 7 commits into from
Apr 25, 2023

Conversation

AaronFriel
Copy link
Contributor

@AaronFriel AaronFriel commented Apr 22, 2023

In this PR, we adopt a workaround for Buildkit caching described in these upstream issues:

The workaround is simple: pull images referenced in --cache-from before building.

Accordingly, this PR adds an example to the docs for enabling multi-stage build caching, and addresses related documentation issues:

Documentation fixes rely on and uses an upstream merged commit for tfgen, following the merge of:

@AaronFriel
Copy link
Contributor Author

@iwahbe It looks like the build fails because the new example references the AWS provider, which isn't installed. I seem to recall there's a PCL binder option to allow it to ignore failures like this, but I don't remember if that works with YAML.

Should I modify generate.go to install the AWS plugin and pin the ECR to a specific version, or what do you think?

@iwahbe
Copy link
Member

iwahbe commented Apr 24, 2023

@iwahbe It looks like the build fails because the new example references the AWS provider, which isn't installed. I seem to recall there's a PCL binder option to allow it to ignore failures like this, but I don't remember if that works with YAML.

Should I modify generate.go to install the AWS plugin and pin the ECR to a specific version, or what do you think?

SkipResourceTypechecking might solve the problem here, but the aws references could be wrong (due to missing global analysis). I would make sure we call pulumi plugin install resource aws vX.Y.Z before we generate any examples. It will both fix the error and ensure we generate the best code we can.

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

A few minor changes, but otherwise this is great!

provider/nativeDocs.go Outdated Show resolved Hide resolved
provider/image.go Outdated Show resolved Hide resolved
if err != nil {
continue
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need this block as past! us were smart and we should be already logged in if cacheImages is set - we can use regAuth for the call to pullDockerImage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I think as it's written it'll help us implement #497 when we get to it, no harm in keeping the code as it is?

provider/pkg/docs-gen/examples/image.md Show resolved Hide resolved
provider/pkg/docs-gen/image-description.md Outdated Show resolved Hide resolved
provider/pkg/docs-gen/image-description.md Outdated Show resolved Hide resolved
AaronFriel and others added 3 commits April 24, 2023 13:33
* Remove contractions for accessibility
* Move Hugo shortcode wrapping into generate.go

Co-authored-by: Guinevere Saenger <[email protected]>
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

LGTM - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants