https://pulumi.com logo
Title
r

refined-terabyte-65361

09/13/2021, 9:11 PM
Hi i need some understanding on how to use pulumi console so far i have been deploying resources using pulumi local i am trying pulumi login https://api.pulumi.com when i try to deploy resource
pulumi login <https://api.pulumi.com>
pulumi stack select --create dev
pulumi --stack dev up --diff --yes
deployment gets stuck in this state
+ pulumi:pulumi:Stack: (create)
i dont see any error when i enable verbose mode I am not sure how pulumi console works
s

steep-toddler-94095

09/13/2021, 9:14 PM
those steps look fine. Are you able to share your code?
r

refined-terabyte-65361

09/13/2021, 9:15 PM
I am using jenkins to deploy below is my jenkinsfile i am using
#!groovy

import groovy.transform.Field

@Field
def pulumiPod = '''
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: main
    image: pulumi/pulumi:v3.3.1
    command:
    - cat
    tty: true
    resources:
      requests:
        memory: "200Mi"
        cpu: 100m
      limits:
        memory: "400Mi"
        cpu: 100m
  restartPolicy: Never
'''

pipeline {
  agent {
    kubernetes {
      yaml pulumiPod
      defaultContainer "main"
    }
  }

  options {
    disableConcurrentBuilds()
  }
  environment {
    PULUMI_ACCESS_TOKEN = credentials("pulumi-credentials")
    PULUMI_CONFIG_PASSPHRASE = credentials("pulumi-token")
    AWS_ACCESS_KEY_ID = credentials("aws-key")
    AWS_SECRET_ACCESS_KEY = credentials("aws-secret")
    AWS_REGION = "us-west-2"
  }
  stages {
    stage("Checkout Code") {
      steps {
        dir('pulumi'){
        git(
            branch: 'pulumi',
            url: '<https://github.com/rajeshwer/ecr.git>'
            )
        }
    }
} 

    stage('Setup') {
      steps {
        dir('/home/jenkins/agent/workspace/git/pulumi/deploy'){
        sh """
        npm install
        pulumi login <https://api.pulumi.com>
        """
      }
    } 
    }
    
    stage('Main') {
        steps {
              dir('/home/jenkins/agent/workspace/git/pulumi/deploy'){
                    withCredentials([aws(accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'aws', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
                      //  sh '''python -m pip install awscli'''
                      //sh '''sleep 1000 '''
                       sh '''aws s3 ls && pulumi stack select --create ping-s3 && pulumi --stack ping-s3 preview --diff && pulumi --stack ping-s3 up --diff --yes'''
                        //sh 'set -euo pipefail && python -m pip install awscli && ./../../shell/shell.sh'                               
    }
  }
}
}
}
}
this is pulumi code https://github.com/rajeshwer/ecr/tree/pulumi/deploy I just created a stack and project which gives default example of s3
s

steep-toddler-94095

09/13/2021, 9:18 PM
is this happening both locally and in CI?
r

refined-terabyte-65361

09/13/2021, 9:21 PM
Sorry this works fine in my local this issue is in CI (pulumi pod )
s

steep-toddler-94095

09/13/2021, 9:23 PM
ok. are you sure all the credentials are correct within that main stage?
r

refined-terabyte-65361

09/13/2021, 9:23 PM
i tried without ci just by running pulumi container i see the same issue I will draft steps to recreate and share
yes credentials are correct i tested by adding stage where i did aws s3 ls and i am able to list existing buckets
This is from live view and it gets stuck there for ever
s

steep-toddler-94095

09/13/2021, 9:29 PM
this may not be it, but you should use the v3.12.0 image instead
r

refined-terabyte-65361

09/13/2021, 9:30 PM
error: an unhandled error occurred: Program exited with non-zero exit code: -1
s

steep-toddler-94095

09/13/2021, 9:30 PM
also
pulumi --stack ping-s3 preview --diff
isn't really necessary if you're doing a
up --yes --diff
anyways
r

refined-terabyte-65361

09/13/2021, 9:30 PM
sure let me try with v3.12.0 and see
👍 1
s

steep-toddler-94095

09/13/2021, 9:31 PM
does the error only happen on
up
? no issues with
pulumi preview
or
pulumi stack ls
r

refined-terabyte-65361

09/13/2021, 9:32 PM
ya it happens only during pulumi up pulumi stack ls works and pulumi stack select also works as expected
s

steep-toddler-94095

09/13/2021, 9:34 PM
what about
pulumi up
on an already existing stack?
when you run locally in the container you aren't imposing those resource restrictions on the container are you?
r

refined-terabyte-65361

09/13/2021, 9:36 PM
resource restrictions ? meaning mem and cpu ?
s

steep-toddler-94095

09/13/2021, 9:36 PM
yeah
r

refined-terabyte-65361

09/13/2021, 9:38 PM
yes locally i am not setting any resource restrictions
s

steep-toddler-94095

09/13/2021, 9:39 PM
and
pulumi up
on an existing stack works? it's only an error when creating a new stack?
r

refined-terabyte-65361

09/13/2021, 9:42 PM
both new stack and existing stack when i run pulumi up in pulumi conatiner (in local)/Pulumi pod from ci are getting stuck
I see this in pulumi console but i dint undertsand what this was
s

steep-toddler-94095

09/13/2021, 9:56 PM
not sure what's going on either to be honest 😕 at least it's working locally so you might just have to check every bit of difference you might have in the container vs your local environment
b

billowy-army-68599

09/13/2021, 11:05 PM
@refined-terabyte-65361 this is not enough to run Pulumi:
resources:
      requests:
        memory: "200Mi"
        cpu: 100m
      limits:
        memory: "400Mi"
        cpu: 100m
please remove these and try again
r

refined-terabyte-65361

09/13/2021, 11:05 PM
sure