-
Notifications
You must be signed in to change notification settings - Fork 2
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
Embed sdk versions #68
Changes from 3 commits
2559a8d
fe3ae67
f119d3c
36bd97d
e7f8876
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.116.1 | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "docker-build", | ||
"displayName": "docker-build", | ||
"version": "0.0.2-alpha.1714063884+13fb5b61", | ||
"version": "1.0.0-alpha.0+dev", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be customised in the makefile by setting the default PROVIDER_VERSION. If you're currently working towards 1.0 then this would seem to make sense, but I can modify the makefile to be something like 0.1.0.1-alpha+dev if you think it's clearer. |
||
"description": "A Pulumi provider for building modern Docker images with buildx and BuildKit.", | ||
"keywords": [ | ||
"docker", | ||
|
@@ -20,13 +20,15 @@ | |
"csharp": { | ||
"packageReferences": { | ||
"Pulumi": "3.*" | ||
} | ||
}, | ||
"respectSchemaVersion": true | ||
}, | ||
"go": { | ||
"importBasePath": "github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild", | ||
"packageImportAliases": { | ||
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild": "dockerbuild" | ||
}, | ||
"respectSchemaVersion": true, | ||
"generics": "side-by-side" | ||
}, | ||
"java": { | ||
|
@@ -43,12 +45,14 @@ | |
"nodejs": { | ||
"dependencies": { | ||
"@pulumi/pulumi": "^3.0.0" | ||
} | ||
}, | ||
"respectSchemaVersion": true | ||
}, | ||
"python": { | ||
"requires": { | ||
"pulumi": "\u003e=3.0.0,\u003c4.0.0" | ||
}, | ||
"respectSchemaVersion": true, | ||
"pyproject": { | ||
"enabled": true | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielrbradley I don't think this is necessary if you bump the pu/pu version in
go.mod
. I'm using this provider as a bit of a testing ground to tighten up our dependency management, and getting rid of magic files like this is part of that goal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was pulling the wrong dependency for me locally - was running a very old version of the language plugins. This is how we do it elsewhere, so standardisation seems like a good win to be able to understand different providers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're specifically wanting to pin codegen and pkg to the same version, you're probably better copying Ian's more complete approach which uses the proper installer:
The downside of this is that it's a little harder to debug if it breaks compared to:
Additionally, we've actually needed in the past to use different versions of codegen vs pkg reference .. which was one of the driving forces for introducing
pulumi package gen-sdk
. If we're unable to upgrade pkg for any reason, we might still need to take fixes to codegen.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downside I see with these solutions is that it's not straightforward to test against pre-release versions. Everything needs to already be published to
get.pulumi.com
, so working with local or remote branches means awkward environment variable overrides. I 100% agree that standardization should be the goal, but I also think in this case we've converged on some unnecessary complexity.I remember now that when I was initially putting this together I ran into an issue with the python language plugin requiring an
exec
script. I punted on fixing that, hence why this was using your ambient plugins.We can hack around that issue by vendoring the script for now. Here's what that looks like.
I might not fully understand what you mean here, but pkg and sdk (as well as the language plugins) are still versioned separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working with testing local versions of codegen is a fairly unusual case on the providers team generally, though we should have this as part of the playbook. I'd suggest an alternative approach for locally testing specific codegen changes would be to run the dev build directly and not via make at all:
From your link I see you're installing each plugin manually? e.g.
This seems like it should work for the time being if you'd prefer that option, though I think it would be worth discussing deviating from using the official installer with the rest of the team as this setup looks quite unusual for any maintainers coming from other providers which we generally try to avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must be unlucky then :)
I strongly agree with you re: deviation, but what's more unusual to me is that we're creating work for ourselves by inventing a new way to manage Go dependencies when the native toolchain should suffice.
replace
directive.go get
.go run
.go.mod
(but not.pulumi.version
files).A playbook would help but still has a discoverability problem. If I'm brand new to the team, why should I expect there to be two ways to manage dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of downloading the CLI for codegen was to reduce our dependency on internal parts of the pulumi/pulumi codebase as these have caused issues in the past relating to breaking changes. Instead, the providers team consume the Pulumi CLI in the same way as any external users which makes compatibility easier to reason about.
Installing the Pulumi CLI & language plugins via the go toolchain is not a supported installation method and is likely to break. E.g. languages being moved to their own repos.
There's certainly nicities to treating it that way as you highlight, but it also requires the provider to be coupled to the internal implementation details of the CLI's build process rather than the public interface (the installer) which we advertise to our users.
Additionally, almost all providers don't have a root go.mod file - this would have to be integrated into the provider module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it sounds like there's a decision to be made across providers about the best way to manage the pulumi version, but let's not let that block us on getting the go version support rolled out.
IIUC, there's no strict dependency on avoiding ambient plugins, to start setting for
RespectSchemaVersion
? If so, I think we should just do that to move this forward.I do agree with Daniel though that if possible, I'd rather have consistency in how we pin and download pulumi CLI across providers than an ideal approach applied to just 1 or 2 providers. That ultimately makes it easier to improve all providers later.
I think you two are on similar timezones this week, maybe you can get 30min to sync tomorrow and hash out a pragmatic approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, keen to get this in so have adopted the change from your branch @blampe if you're happy with that.
Ran a test locally and those changes fixed it for with with the extra change for
make build
which failed.I also timed the pulumi CLI installation process:
make bin/pulumi 25.44s user 13.49s system 88% cpu 44.224 total
make .pulumi/bin/pulumi 2.78s user 1.43s system 36% cpu 11.469 total
Let's revisit standardisation later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally makes sense. Invoking the CLI this way doesn't make us any more dependent on code internals but does make us sensitive to knowing where the code lives, as you pointed out. The difference between this binary and the published one essentially boils down to the ldflag for Version, which can be somewhat alleviated with
ReadBuildInfo
.golangci-lint
is an example of a similar hermeticity problem. The linter and the code need to be updated together in cases when new breaking rules are added, but the linter's version is currently driven by ci-mgmt -- so workflow updates become blocked until someone takes the time to fix lint errors. It would be nice to instead let the repo decide the lint version it's compatible with, so its linter can be updated independently. One way to do that would be with a similar.golangci-lint.version
file, but by leveraginggo.mod
instead we would have an approach that works for all tooling like this.They should have a root
go.mod
, but that's a conversation for later :)Yeah, this is expected since it's compiled from source. The
tools.go
trick used here will be officially supported in go ~1.24 asgo get -tool
and should have nicer caching semantics.Anyway thanks for indulging me again, as I mentioned I'd like to spend some more time flushing out a prototype to hopefully make the benefits more obvious.