great-night-26645
11/07/2023, 12:05 PMmake build_sdks
succeeds (except for C# which I don't care about at the moment). Now I tried to reference the generated Python SDK from another repository based on its path in my filesystem. With Poetry:
[tool.poetry.dependencies]
...
pulumi-butane = {path = "/home/dev/DEVOPS/pulumi-butane/sdk/python"}
...
With this configuration PyLance in VS code is able to resolve the Python code. When I run pulumi up
it fails with something like:
error: Could not automatically download and install resource plugin 'pulumi-resource-butane' at version v0.0.0, install the plugin using `pulumi plugin install resource butane v0.0.0 ...
I followed the instructions and installed the plugin:
❯ poetry run pulumi plugin install resource butane v0.0.0 --file /home/dev/DEVOPS/pulumi-butane/sdk/python
[resource plugin butane-0.0.0] installing
❯
But it still doesn't work:
error: failed to load plugin /home/dev/.pulumi/plugins/resource-butane-v0.0.0/pulumi-resource-butane: loading PulumiPlugin.yaml: open /home/dev/.pulumi/plugins/resource-butane-v0.0.0/PulumiPlugin.yaml: no such file or directory
What am I doing wrong?limited-rainbow-51650
11/07/2023, 3:04 PMpulumi-resource-butane
somewhere in your PATH
.big-architect-71258
11/07/2023, 3:08 PM0.0.1-alpha.1694635523+8f2e8c13.dirty
and not a clean v0.0.0
or something.
However, it is of course sufficient to adjust the PATH variable.bin/setup.py
which is used to setup the Python SDK.pulumi install
, the correct version that gets displayed during make build_python
or make provider
must be used to install the provider.limited-rainbow-51650
11/07/2023, 3:18 PMinstall
copies the built provider binary. If you are iterating fast on the pulumi provider, using PATH
is what I rely on myself.big-architect-71258
11/07/2023, 3:19 PMgreat-night-26645
11/07/2023, 4:25 PMexport PATH=$PATH:/home/dev/DEVOPS/pulumi-butane/provider/cmd/pulumi-resource-butane
It still looks for the v0.0.0 version though I have no clue where that is coming from. The failure is as follows:
Diagnostics:
pulumi:providers:butane (default_github_/api.github.com/.../pulumi-butane):
error: Could not automatically download and install resource plugin 'pulumi-resource-butane' at version v0.0.0, install the plugin using `pulumi plugin install resource butane v0.0.0 --server <github://api.github.com/.../pulumi-butane>`: error downloading provider butane to file: failed to download plugin: butane-0.0.0: 404 HTTP error fetching plugin from <https://api.github.com/repos/.../pulumi-butane/releases/tags/v0.0.0>. If this is a private GitHub repository, try providing a token via the GITHUB_TOKEN environment variable. See: <https://github.com/settings/tokens>
big-architect-71258
11/08/2023, 3:20 PMgreat-night-26645
11/09/2023, 8:33 AMlimited-rainbow-51650
11/09/2023, 8:44 AMPATH
export above, I think this isn't correct. If you started from the terraform-bridge boilerplate, the Makefile
should build your provider locally in the bin
folder. If you then use this:
export PATH=$PATH:/home/dev/DEVOPS/pulumi-butane/bin
Pulumi should then pick up pulumi-resource-butane
from your bin
folder.great-night-26645
11/09/2023, 8:48 AMwarning: using pulumi-resource-butane from $PATH at /home/dev/DEVOPS/pulumi-butane/bin/pulumi-resource-butane
warning: using pulumi-resource-butane from $PATH at /home/dev/DEVOPS/pulumi-butane/bin/pulumi-resource-butane
/home/dev/DEVOPS/pulumi-butane/bin/pulumi-resource-butane: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /home/dev/DEVOPS/pulumi-butane/bin/pulumi-resource-butane)
/home/dev/DEVOPS/pulumi-butane/bin/pulumi-resource-butane: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /home/dev/DEVOPS/pulumi-butane/bin/pulumi-resource-butane)
limited-rainbow-51650
11/09/2023, 8:49 AMgreat-night-26645
11/09/2023, 8:50 AMlimited-rainbow-51650
11/09/2023, 8:50 AMgreat-night-26645
11/09/2023, 8:51 AMbig-architect-71258
11/09/2023, 8:51 AMlimited-rainbow-51650
11/09/2023, 8:52 AMgreat-night-26645
11/09/2023, 8:52 AMlimited-rainbow-51650
11/09/2023, 8:54 AMBut I don't see a way to do it in Pulumi without bridging over the butane providerFor building/verifying proper Butane config, you don't necessarily need a Pulumi provider. Don't forget you use a normal programming language. E.g. if you use Python, you can mix in this library: https://pypi.org/project/bupy/
great-night-26645
11/09/2023, 8:55 AMbupy
because it does not support Butane merging (snippets), which is key for writing modular resourceslimited-rainbow-51650
11/09/2023, 8:57 AMgreat-night-26645
11/09/2023, 8:58 AM