Hi! I have a problem with pulumi cicd using github...
# golang
e
Hi! I have a problem with pulumi cicd using github workflows and installing the google cloud provider. We use the google cloud and the kubernetes providers. The kubernetes provider automatically installs an appropriate version of the plugin, but the gcp provider is never installed. Can we make the gcp plugin version also install automatically? If not, what would be the recommended way of manually installing it? What we are doing is very close to what is described in this guide. This is the corresponding GitHub workflows yaml:
name: Pulumi
on:
- pull_request
jobs:
preview:
name: Preview
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: preview
uses: <docker://pulumi/actions>
with:
args: preview
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_CI: pr
PULUMI_ROOT: infra/cluster/processing
This is the output from the preview step: 
Run <docker://pulumi/actions>
10 /usr/bin/docker run --name pulumiactions_99916e --label 3b3ac6 --workdir /github/workspace --rm -e GOOGLE_CREDENTIALS -e PULUMI_ACCESS_TOKEN -e PULUMI_CI -e PULUMI_ROOT -e INPUT_ARGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/xxx/xxx":"/github/workspace" pulumi/actions preview
11 Logging in using access token from PULUMI_ACCESS_TOKEN
12 Logged in to <http://pulumi.com|pulumi.com> as xxx (<https://app.pulumi.com/> xxx)
13 Activated service account credentials for: [<mailto:pulumi-github-workflows-cicd@xxx.iam.gserviceaccount.com|pulumi-github-workflows-cicd@xxx.iam.gserviceaccount.com>]
14 Adding credentials for all GCR repositories.
15 WARNING: A long list of credential helpers may cause delays running 'docker build'. We recommend passing the registry name to configure only the registry you are using.
16 Docker configuration file updated.
`17 #### 🍹 `pulumi --non-interactive preview``
18 Previewing update (yyy/xxx):
19 [resource plugin kubernetes-2.3.0] installing
20
21 Downloading plugin: 0 B / 21.46 MiB    0.00%
22 Downloading plugin: 21.46 MiB / 21.46 MiB  100.00%
23 Downloading plugin: 21.46 MiB / 21.46 MiB  100.00%
24 Downloading plugin: 21.46 MiB / 21.46 MiB  100.00%
25 Downloading plugin: 21.46 MiB / 21.46 MiB  100.00% 0s
26 Moving plugin... done.
27
28 Permalink: <https://app.pulumi.com/xxx/previews/0472bcb1-a637-4708-96e9-21f0fe9862ff>
29 error: could not load plugin for gcp provider 'urn:pulumi:xxx::cadence::pulumi:providers:gcp::gcp-provider': no resource plugin 'gcp' found in the workspace or on your $PATH
Thanks in advance for any help.
l
Yeah, the GCP plugin should be installed automatically. What version of it do you have referenced in your go.mod file? As a work around you can always install the plugin manually:
Copy code
pulumi plugin install resource gcp vX.X.X
e
I have v3.21.1 in my go mod. Any idea on what would be the best way to hook into the pulumi Github Actions docker?
l
The command you run in this instance is
pulumi/actions preview
Can you first run a
pulumi/actions plugin install resource gcp v3.21.1
?
e
I just tried adding a step
- name: install-gcp-plugin
uses: <docker://pulumi/actions>
with:
args: plugin install resource gcp v3.21.1
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_CI: pr
PULUMI_ROOT: infra/cluster/processing
before the preview step. It installs the plugin successfully, but the preview command still fails with the same error message.