Hello! I copied pulumi code from one directory to ...
# python
f
Hello! I copied pulumi code from one directory to another, and now it doesn't seem to want to
pulumi up
Copy code
$ pulumi up -d
warning: A new version of Pulumi is available. To upgrade from version '0.16.8' to '0.16.9', run 
   $ curl -sSL <https://get.pulumi.com> | sh
or visit <https://pulumi.io/install> for manual instructions and release notes.
Previewing update (python-webserver-testing):

     Type                 Name                                   Plan     Info
     pulumi:pulumi:Stack  webserver-py-python-webserver-testing           1 error
 
Diagnostics:
  pulumi:pulumi:Stack (webserver-py-python-webserver-testing):
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
 
error: an error occurred while advancing the preview
What's going on here?
i
ouch! I’ve tried to hammer down the bug where it doesn’t print out a useful error message but it apparently keeps cropping up… Is the
pulumi
package available to the
python
on your
PATH
? That seems to me to be the most common cause of this issue.
Also, does this reproduce when you update to pulumi
0.16.9
?
f
New version didn't help
Appears to be a python issue. I was previously using a venv and now that I moved the venv to another location on the file system... 🔥
( prior test was with system python )
Hmm still having issues after creating and then activating a new venv that uses Python 3.6.7
¯\_(ツ)_/¯
forgot to pip install requirements in the new venv
So, I got this working now. The issue was that the pulumi python module wasn't available. Perhaps that problem could be surfaced better in the errors displayed? Now I have another problem. It seems that t3 class instances aren't supported?
Copy code
KeyError: 't3.nano'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
i
oh, absolutely! It’s a bug I keep trying to track down that we don’t print anything useful when
import pulumi
throws…
glad that got you unstuck, though!
let me take a look re:
t3.nano
f
t3.micro
didn't work either
i
what’s your full code?
f
Let me toss it up in github
i
thanks!
f
While I have you...
I have a python for loop that is instantiating instances of the ec2 class, and when creating, it does them all in parallel, but on destroy, it seems to do them 1 at a time (very slow). Is that by design?
Also looking for more general guidance on how to do python pulumi code "right", but I hear more docs are coming soon?
i
So - the Pulumi engine is capable of parallelizing deletions, but it currently doesn’t for Python programs because Python previously didn’t support the machinery that the engine needed in order to safely parallelize operations. Python does support it now, so we basically can turn it on whenever we want, but we haven’t yet because it has the potential to break programs written using the “old” versions of the Python SDK. So to answer your question, 1) it’s sort of by design, for safety reasons and 2) we can trivially turn it off and parallelize deletions, once we’re sure that everyone has reasonably migrated to the new python SDK
f
Okay, glad it's coming!
I'm sure I'm probably doing it wrong 🙂
i
Regarding docs - that’s a top priority for me in the current milestone ending January 20. That said, we know our docs are generally deficient and we’re going to be working hard on them in the coming months - it’s especially bad for Python, since there are basically zero useful docs on the website. Would it help if we had more Python examples in the meantime?
f
Yes, more examples and more docs would be great.
i
awesome!
f
I'd like some general guidance on: - go about writing your pulumi python this way - don't do these things
If there are things that fit into those buckets
i
yeah, makes sense
something kinda interesting is that pulumi python is new enough that it’s not obvious yet what the dos and don’ts are… though I guess that’s what we get for inventing new programming models 😆
but more examples and docs, absolutely
f
Understand, I'd just rather not bring something to you guys and then you think I'm doing something totally stupid 🙂
because I'm doing it "the wrong way"
i
you’re absolutely not doing anything stupid, but I get the sentiment 😄
f
How do the other languages pulumi supports fit into the maturity scale?
i
TypeScript/JavaScript is far and away the most mature, followed by Python, followed by Go.
f
Good to know.
i
okay, so I think what’s going on with your code sample is that the
get_linux_ami
function hasn’t been updated to support
t3
sizes
did this come from the
pulumi/examples
repo?
f
yeah, it came from examples. And now I feel dumb for not realizing that was coming from a dictionary/map.
Thanks!
i
no problem! i hope it goes without saying but feel free to ping me anytime if you have any problems 😄
f
What about my exports issue?
i
what sort of “not work” are you seeing? not seeing any stack exports? your program crashes?
f
So, I have the export in the loop
but it only does 1 export instead of 1 for each instance
let me grab the output
ohhh, hmmm, seems to work now
nevermind then!
i
cool!
also I re-opened https://github.com/pulumi/pulumi/issues/1606 for your original issue
👍 1
f
Thanks for all the help!
i
no problem!