Who is the circleci pulumi orb person? getting `p...
# general
i
Who is the circleci pulumi orb person? getting
plugin 'kubernetes' found in the workspace or on your $PATH
c
🙋🏽‍♂️ that’s me.
You are using CircleCI and Pulumi, and it is failing with that error? Could you include more of it for context? e.g. is that coming from Pulumi, or e.g.
npm
?
i
thoughts here? I was going to add
yarn list @pulumi/gcp @pulumi/pulumi
to ensure they were installed with a
pulumi plugin ls
coming from:
Copy code
- pulumi/preview:
          stack: alienfast/production
          working_directory: ~/project/cloud/app
after
pulumi/login
c
Gotcha. So yeah, that sounds like Pulumi is failing for some reason. I know that the CLI will download your dependencies in many situations, but perhaps you need to explicitly call
yarn install
to get all of the prerequisites?
i
it’s a monorepo, so everything
should be installed
c
Hrm, let me think about it. Since that’s odd. Essentially the
pulumi/preview
orb just shells out to
pulumi preview ...
So it is probably something with how/where the plugins are being loaded/located.
i
I added debug and made
working_directory: ~/project/cloud/app
instead of
working_directory: cloud/app
c
I can’t think of any reason why you’d get into this state. Could you confirm that the plugin is actually installed? Like you said earlier, if you run
pulumi plugin ls
it should appear in the output.
i
Copy code
#!/bin/bash -eo pipefail
yarn list --pattern @pulumi && pulumi plugin ls
yarn list v1.12.3
warning Resolution field "react-apollo@2.5.2" is incompatible with requested version "react-apollo@^2.5.3"
warning Resolution field "react-apollo@2.5.2" is incompatible with requested version "react-apollo@^2.5.3"
├─ @pulumi/gcp@0.18.2
├─ @pulumi/kubernetes@0.22.0
├─ @pulumi/pulumi@0.17.4
└─ @pulumi/random@0.5.1
Done in 1.14s.
NAME  KIND  VERSION  SIZE  INSTALLED  LAST USED

TOTAL plugin cache size: 0 B
Ok, I have an idea
our yarn runs in a
prepare
job
then files are propagated via
persist_to_workspace
and
attach_workspace
where are the plugins installed? file path
@colossal-beach-47527 looks like I need to add the pulumi plugin file path to the
persist_to_workspace
, I just need to know which path.
c
This isn’t a part of the code I am super familiar with. But that sounds cromulent. @incalculable-sundown-82514 or @bitter-oil-46081 might have more specifics about where plug-ins are stored and what not.
b
All of the plugins are stored in
~/.pulumi/plugins
There is a sub-folder for each plugin.
So I would recommend that you just persist that entire folder.
i
this is unfortunate
* In step 8 (persist_to_workspace): Path ~/.pulumi/plugins is not relative to the workspace root (.)
ah, I’ll try without the magic ~
yeah, I’m encountering a bunch of issues trying to get the persist to work without specifying potentially differing docker user home paths
I’ll figure out something
can I set that with
PULUMI_HOME
or something like that pre-yarn?
So this behavior is also messing with yarn caching on ci
cached modules don’t reinstall so the native plugins are not there on subsequent builds
Copy code
#!/bin/bash -eo pipefail
ls -la /home/circleci/.pulumi/plugins || true
ls: cannot access '/home/circleci/.pulumi/plugins': No such file or directory
Copy code
#!/bin/bash -eo pipefail
ls -la /home/circleci/.pulumi || true
total 20
drwxr-xr-x  3 circleci circleci 4096 Apr  4 21:17 .
drwxr-xr-x 11 circleci circleci 4096 Apr  4 21:17 ..
-rw-------  1 circleci circleci   59 Apr  4 21:17 .cachedVersionInfo
drwx------  2 circleci circleci 4096 Apr  4 21:17 bin
-rw-------  1 circleci circleci  149 Apr  4 21:17 credentials.json
Copy code
#!/bin/bash -eo pipefail
echo $HOME
/home/circleci
@colossal-beach-47527 @bitter-oil-46081 I am ssh’d into the server. We have eliminated the yarn cache. Simply put, plugins are not installed.
Copy code
pulumi login
Logging in using access token from PULUMI_ACCESS_TOKEN
Logged into <http://pulumi.com|pulumi.com> as rosskevin (<https://app.pulumi.com/rosskevin>)
circleci@122be95f3249:~/project$ ls -la ~/.pulumi/
total 20
drwxr-xr-x  3 circleci circleci 4096 Apr  4 22:00 .
drwxr-xr-x 11 circleci circleci 4096 Apr  4 21:55 ..
-rw-------  1 circleci circleci   59 Apr  4 22:00 .cachedVersionInfo
drwx------  2 circleci circleci 4096 Apr  4 21:55 bin
-rw-------  1 circleci circleci  149 Apr  4 22:00 credentials.json
circleci@122be95f3249:~/project$ yarn list --pattern @pulumi 
yarn list v1.12.3
warning Resolution field "react-apollo@2.5.2" is incompatible with requested version "react-apollo@^2.5.3"
warning Resolution field "react-apollo@2.5.2" is incompatible with requested version "react-apollo@^2.5.3"
├─ @pulumi/gcp@0.18.2
├─ @pulumi/kubernetes@0.22.0
├─ @pulumi/pulumi@0.17.4
└─ @pulumi/random@0.5.1
Done in 1.11s.
I have deleted
node_modules
and yarned, still no plugins
are they installed on first use?
b
are they installed on first use?
Right now, no. They are installed via a npm post install script which calls
pulumi plugin install
Can you run
pulumi plugin install resource gcp 0.18.2
and let me know happens?
i
so that is part of the problem (with instructions at least), as
pulumi
is not available from the orb until
pulumi/login
I have confirmed after adding pulumi to the path and re-yarn they are there
b
Ahh, okay, we need to fix that. I believe you should be able to run
pulumi plugin install
from the root of your project and it will try to install all plugins you need.
i
I’ll try to use the orb login pre-yarn and see if it will work
I have 4 stacks
so not keen on that
using
pulumi/login
before
yarn
confirmed to have plugins now
c
Catching up on this thread, I guess I understand what’s going on here. Obviously we need to better document (and warn if possible), since the “must install Pulumi CLI before running `yarn`” isn’t intuitive at all.
i
you will need to warn that users depending on caching will also need to cache ~/.pulumi/plugins
So @colossal-beach-47527 onto the next thing. cwd problems with the orb
Copy code
pulumi preview --stack alienfast/production --cwd ~/project/cloud/app
Previewing update (alienfast/production):
@ Previewing update...| /                       
@ Previewing update...|                           pulumi:pulumi:Stack advisorintake-app-production running 
@ Previewing update...| / - \                           pulumi:pulumi:Stack advisorintake-app-production  error: Running program '/home/circleci/project/cloud/app' failed with an unhandled exception:
    pulumi:pulumi:Stack advisorintake-app-production  error: Error: Cannot find module '@alienfast/pulumi'
it does not appear to change to that dir before running, otherwise it would use the tsconfig from that cwd and would find the shared code module
orb use:
Copy code
- pulumi/preview:
          stack: alienfast/production
          working_directory: ~/project/cloud/app
If I actually cd to the dir, it works
Copy code
~/p/a/c/app ❯❯❯ pulumi preview --stack alienfast/production
Previewing update (alienfast/production):

     Type                             Name                                               Plan     Info
     pulumi:pulumi:Stack              advisorintake-app-production                                4 messages
 >   ├─ pulumi:pulumi:StackReference  alienfast/advisorintake-infrastructure/production  read     
 >   └─ pulumi:pulumi:StackReference  alienfast/advisorintake-identity/production        read
I’m going to bail on the orb and do it manually
yikes, at every turn a problem with ci
curl -L <https://get.pulumi.com/> | bash -s
under the circleci user account yields
Copy code
+ Extracting to /home/circleci/.pulumi/bin
mktemp: failed to create directory via template 'pulumi.XXXXXXXXXX': Permission denied
I’m simply trying to add pulumi via the install script to a circleci base image
I must have an issue with my script, using it direct in the dockerfile works fine as
RUN curl -L <https://get.pulumi.com/> | bash -s