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

no resource plugin 'gcp' found in the workspace or on your $PATH #968

Closed
Lawouach opened this issue Apr 4, 2019 · 11 comments
Closed

no resource plugin 'gcp' found in the workspace or on your $PATH #968

Lawouach opened this issue Apr 4, 2019 · 11 comments
Assignees
Milestone

Comments

@Lawouach
Copy link

Lawouach commented Apr 4, 2019

Hey all,

I created a new gcp stack (with a Python provider) via the Dashboard today, here are its instructions:

Get Started
1. Install Pulumi on your machine, if you haven't already.

curl -fsSL https://get.pulumi.com | sh
2. Ensure the Pulumi Google Cloud provider is set up.

3. Pull down your project to get started.

pulumi new gcp-python -s Lawouach/gce/base
4. Deploy it!

pulumi up

Following these instructions led to:

$ pulumi up
Previewing update (base):

     Type                     Name      Plan     Info
     pulumi:pulumi:Stack      gce-base           
     └─ pulumi:providers:gcp  default            1 error
 
Diagnostics:
  pulumi:providers:gcp (default):
    error: no resource plugin 'gcp' found in the workspace or on your $PATH

This reminds me of this pulumi/pulumi#2097

What am I missing?

Thanks :)

@Lawouach
Copy link
Author

Lawouach commented Apr 4, 2019

You need to run:

$ pulumi plugin install resource gcp v0.18.2

Which I couldn't see indicated anywhere unfortunately. Not even on the gcp readme.

@justinvp
Copy link
Member

justinvp commented May 1, 2019

Sorry this was confusing, @Lawouach. There shouldn't be a need to install the plugin manually.

We could do a better job with the steps on http://app.pulumi.com.

When the following command is run:

pulumi new gcp-python -s Lawouach/gce/base

The CLI will output some Python-specific instructions for installing dependencies:

Created project 'gcp-python'

Saved config

Your new project is ready to go! ✨

To perform an initial deployment, run the following commands:

   1. virtualenv -p python3 venv
   2. source venv/bin/activate
   3. pip3 install -r requirements.txt

Then, run 'pulumi up'

Running those three commands (i.e. running pip3) to install the dependencies should take care of installing the gcp resource plugin automatically, and should be run before running pulumi up.

We should fix app.pulumi.com to detect if the project is Python and include those additional commands in-line before the pulumi up step.

@justinvp justinvp self-assigned this May 3, 2019
@justinvp justinvp added this to the 0.23 milestone May 3, 2019
@Lawouach
Copy link
Author

Lawouach commented May 5, 2019

Thanks for the update and kind feedback. Appreciated :)

@justinvp justinvp closed this as completed May 8, 2019
@justinvp
Copy link
Member

justinvp commented May 8, 2019

https://app.pulumi.com has been fixed to include the additional steps for Python projects. Should be live tomorrow.

@haridas
Copy link

haridas commented Aug 1, 2019

This problem still there with the latest version of pulumi version v0.17.27. I'm getting bellow error when trying the default demo project.

(ENV3) haridas:pulumi haridas$ pulumi up
Enter your passphrase to unlock config/secrets
    (set PULUMI_CONFIG_PASSPHRASE to remember):
Previewing update (dev):

     Type                     Name        Plan       Info
 +   pulumi:pulumi:Stack      pulumi-dev  create
     └─ pulumi:providers:gcp  default                1 error

Diagnostics:
  pulumi:providers:gcp (default):
    error: no resource plugin 'gcp' found in the workspace or on your $PATH

@justinvp
Copy link
Member

justinvp commented Aug 5, 2019

@haridas, what commands did you run leading up to pulumi up?

@haridas
Copy link

haridas commented Aug 5, 2019

Yes pulumi up is the command tried, This was happening for other stack based commands also.

@justinvp
Copy link
Member

justinvp commented Aug 5, 2019

@haridas, if you're using Python, you'll need to run the following three commands before running pulumi up, to create an isolated Python environment with Virtualenv and install required dependencies with pip3:

virtualenv -p python3 venv
source venv/bin/activate
pip3 install -r requirements.txt

Then:

pulumi up

@haridas
Copy link

haridas commented Aug 6, 2019

Thanks @justinvp for the reply.

I was trying with my global virtualenv ( ENV3, It is visible in my first comment ). As you suggested I gave a fresh attempt with new virtualenv.

It's working fine with new virtualenv.

I doubt some version conflict that didn't get resolved when upgrading the pulumi, I upgraded it some time back using pip install pulumi --upgrade.

Thanks for the help.

@edmondop
Copy link

I have problems when running with docker

FROM python:3.7-slim
COPY . .
# Download and install required tools.
RUN apt update && apt upgrade && apt-get install -y curl && curl -L https://get.pulumi.com/ | bash
RUN pip install "pulumi>=2.0.0,<3.0.0" && pip install "pulumi-gcp>=3.0.0,<4.0.0"
ENV PATH=$PATH:/root/.pulumi/bin
ENTRYPOINT [ "pulumi", "version" ]

I then had to remove the following two lines from the Pulumi.yaml as in the discussion on the slack channel.

name: my-proj
runtime:
  name: python
  # options:
  #   virtualenv: venv
description: proj

and when I get to execute the pulumi up I get this error:

pulumi:providers:gcp default_3_10_1  error: no resource plugin 'gcp-v3.10.1' found in the workspace or on your $PATH, install the plugin using `pulumi plugin install resource gcp v3.10.1`

It is not obvious to me how Pulumi relates with the default python installation on the docker image, what am I doing wrong?

@justinvp
Copy link
Member

Hi @edmondo1984,

Try reordering your Dockerfile so that you're updating PATH for Pulumi before running pip install:

FROM python:3.7-slim
COPY . .
# Download and install required tools.
RUN apt update && apt upgrade && apt-get install -y curl && curl -L https://get.pulumi.com/ | bash
ENV PATH=$PATH:/root/.pulumi/bin
RUN pip install "pulumi>=2.0.0,<3.0.0" && pip install "pulumi-gcp>=3.0.0,<4.0.0"
ENTRYPOINT [ "pulumi", "version" ]

When you pip install pulumi-gcp, part of the package installation shells out to pulumi plugin install resource gcp <version> to install the resource provider plugin binary, so it needs to be able to find pulumi on PATH.

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

No branches or pull requests

4 participants