Commit graph

61 commits

Author SHA1 Message Date
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls (#3750)

* Switch away from native grpc impl. (#3728)

* Remove usage of the 'deasync' library from @pulumi/pulumi. (#3752)

* Only retry as long as we get unavailable back.  Anything else continues. (#3769)

* Handle all errors for now. (#3781)


* Do not assume --yes was present when using pulumi in non-interactive mode (#3793)

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes (#4288)

Adjust C# generation

* Replace IDeployment with a sealed class (#4318)

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty (#4320)

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen (#4379)
2020-04-14 09:30:25 +01:00
Luke Hoban d9a18f0aa8
Revert back to ts-node ^7.0.0 (#4007)
We upgraded to `ts-node@^8.0.0`  2.5 months ago as part of https://github.com/pulumi/pulumi/pull/3627, though it seems it wasn't really necessary to make that update for the purposes of the PR - updating the default TypeScript version.

The `8.0.0` series of `ts-node` unfortunately dropped all of it's caching support, due to what appear to be some corner-case correctness issues with the cache.  We have not seen reports of those issues for Pulumi, and have much more experience with the `7.0.0` series overall (2 years vs. 2 months).  The performance difference between `7.0.0` and `8.0.0` of ts-node for Pulumi is massive - it adds 4-4.5s to each of `pulumi preview` and `pulumi up` even on a trivial program.

As a result, for now we will revert back to `ts-node@^7.0.0`.  In the future, we may want to look into our own caching layer or alternative to `ts-node` to ensure we get the behaviour and performance we expect.

Part of #3671.
2020-03-02 08:33:01 -08:00
Mike Metral 1f192d024e Lock dep ts-node to v8.5.4 2020-01-10 12:18:46 -05:00
CyrusNajmabadi 7cbdf58105
Update to TypeScript 3.7 (#3627) 2019-12-17 11:00:45 -08:00
Maciej Lisiewski bcdd27e092 Updates grpc package to 1.24.2 for js sdk (#3512)
Fixes building grpc package with gcc8 and newer
Fixes building grpc package for node 13.x
Matches minor grpc release (1.24.x) to version used by dotnet sdk
2019-11-19 11:56:26 -08:00
Alex Clemmer a40008db41 StreamInvoke should return AsyncIterable that completes
A user who calls `StreamInvoke` probably expects the `AsyncIterable`
that is returned to gracefully terminate. This is currently not the
case.

Where does something like this go wrong? A better question might be
where any of this went right, because several days later, after
wandering into civilization from the great Wilderness of Bugs, I must
confess that I've forgotten if any of it had.

`AsyncIterable` is a pull-based API. `for await (...)` will continuously
call `next` ("pull") on the underlying `AsyncIterator` until the
iterable is exhausted. But, gRPC's streaming-return API is _push_ based.
That is to say, when a streaming RPC is called, data is provided by
callback on the stream object, like:

    call.on("data", (thing: any) => {... do thing ...});

Our goal in `StreamInvoke` is to convert the push-based gRPC routines
into the pull-based `AsyncIterable` retrun type. You may remember your
CS theory this is one of those annoying "fundamental mismatches" in
abstraction. So we're off to a good start.

Until this point, we've depended on a library,
`callback-to-async-iterator` to handle the details of being this bridge.
Our trusting nature and innocent charm has mislead us. This library is
not worthy of our trust. Instead of doing what we'd like it to do, it
returns (in our case) an `AsyncIterable` that will never complete.
Yes,, this `AsyncIterable` will patiently wait for eternity, which
honestly is kind of poetic when you sit down in a nice bath and think
about that fun time you considered eating your computer instead of
finishing this idiotic bug.

Indeed, this is the sort of bug that you wonder where it even comes
from. Our query libraries? Why aren't these `finally` blocks executing?
Is our language host terminating early? Is gRPC angry at me, and just
passive-aggrssively not servicing some of my requests? Oh god I've been
up for 48 hours, why is that wallpaper starting to move? And by the way,
a fun interlude to take in an otherwise very productive week is to try
to understand the gRPC streaming node client, which is code-gen'd, but
which also takes the liberty of generating itself at runtime, so that
gRPC is code-gen'ing a code-gen routine, which makes the whole thing
un-introspectable, un-debuggable, and un-knowable. That's fine, I didn't
need to understand any of this anyway, thanks friends.

But we've come out the other side knowing that the weak link in this
very sorry chain of incredibly weak links, is this dependency.

This commit removes this dependency for a better monster: the one we
know.

It is at this time that I'd like to announce that I am quitting my job
at Pulumi. I thank you all for the good times, but mostly, for taking
this code over for me.
2019-11-12 13:51:19 -08:00
CyrusNajmabadi b39b5500c5
Lock to 3.6.3 version of TS as 3.7.x releases contain changes that break our version of typedoc. (#3462) 2019-11-06 17:36:32 -08:00
Alex Clemmer f195cc0d4d Implement StreamInvoke 2019-11-05 10:47:48 -08:00
CyrusNajmabadi b135af10be
Enable full strict mode. (#3218) 2019-09-11 16:21:35 -07:00
CyrusNajmabadi 4d9336caa9
Specify the 8.0 version of node types. (#3215) 2019-09-11 10:54:44 -07:00
Matt Ellis 83e4bbdebb Lock to an earlier version of gRPC
The most recently released version of gRPC has a `index.d.ts` file in
it that does not work when complied with noImplicitAny. Until a fix
can be made upstream, lock to an earlier version so that we can build
without turning off noImplicitAny.
2019-07-09 14:39:53 -07:00
CyrusNajmabadi 504478c641
Move to latest version of package (#2889) 2019-06-29 15:51:20 -07:00
CyrusNajmabadi c47ae413c3
Lock to a specific version of the read-package-tree library. (#2882) 2019-06-26 13:46:00 -07:00
Matt Ellis e3151c1528
Merge pull request #2837 from pulumi/ellismg/update-node-version
Update supported versions list
2019-06-17 13:27:58 -07:00
CyrusNajmabadi 11a19a4990
Make it possible to get a StackReference output promptly (#2824) 2019-06-17 12:25:56 -07:00
Matt Ellis ad7397b310 Update supported versions list
We no longer support Node 6.X (it went end of life at the end of
April, we stopped testing on it, and now we use features that are not
in Node 6 like `Object.values`.

Note that we support 8+, and add an `engines` section to our
package.json so folks who try to install on older versions of node see
warnings.
2019-06-17 12:11:38 -07:00
Alex Clemmer 02788b9b32 Implement listResourceOutputs in the Node.js SDK
This commit will expose the new `Invoke` routine that lists resource
outputs through the Node.js SDK.

This API is implemented via a new API, `EnumerablePromise`, which is a
collection of simple query primitives built onto the `Promise` API. The
query model is lazy and LINQ-like, and generally intended to make
`Promise` simpler to deal with in query scenarios. See #2601 for more
details.

Fixes #2600.
2019-06-03 14:56:49 -07:00
Matt Ellis cb6ccb8026 Fix repository section of package.json
See https://docs.npmjs.com/files/package.json#repository for guidence
from NPM on how to do this.
2019-05-31 17:52:53 -07:00
CyrusNajmabadi b84b3d487d
Revert "Simplify signature of pulumi.all (#2527)" (#2775)
This reverts commit b32892e0c1.
2019-05-28 10:54:56 -07:00
Dominik-K a80d29c897 NodeJS: add semver as dependency (imported in runtime/closure/v8Hooks.js) (#2763) 2019-05-23 12:26:47 -06:00
CyrusNajmabadi b32892e0c1
Simplify signature of pulumi.all (#2527) 2019-05-21 13:13:23 -04:00
Matt Ellis 8979e301d1 Bump gRPC dependency to 1.20.2
This version has prebuilt binaries for Node 12.
2019-05-01 10:04:27 -07:00
Matt Ellis d000896a49 Bump @types/node dependency 2018-11-13 11:20:21 -08:00
Matt Ellis e84eab0d9f Add Node 11 scouting build 2018-10-25 19:07:04 -07:00
CyrusNajmabadi 43674dcef5
Switch to upath so that all paths are in unix-format (#2019) 2018-10-03 12:06:55 -07:00
CyrusNajmabadi 937391259e
Update linter version. (#1946) 2018-09-15 02:59:01 -07:00
CyrusNajmabadi 0d6acebecd
Be resilient to encountering invalid data in a package.json file. (#1897) 2018-09-06 16:35:14 -07:00
CyrusNajmabadi 193af7bda8
Simpler way of stating which dependencies need to be available at runtime. (#1890) 2018-09-05 16:18:31 -07:00
Matt Ellis ce5eaa8343 Support TypeScript in a more first-class way
This change lets us set runtime specific options in Pulumi.yaml, which
will flow as arguments to the language hosts. We then teach the nodejs
host that when the `typescript` is set to `true` that it should load
ts-node before calling into user code. This allows using typescript
natively without an explicit compile step outside of Pulumi.

This works even when a tsconfig.json file is not present in the
application and should provide a nicer inner loop for folks writing
typescript (I'm pretty sure everyone has run into the "but I fixed
that bug!  Why isn't it getting picked up?  Oh, I forgot to run tsc"
problem.

Fixes #958
2018-08-06 14:00:58 -07:00
CyrusNajmabadi 5a52c1c080
Actually export function. (#1710) 2018-08-06 15:45:06 -04:00
CyrusNajmabadi 0614b1d052
Move node_module inclusion logic down to pulumi/pulumi so we can use it from both aws and azure. (#1705) 2018-08-06 14:12:19 -04:00
Joe Duffy 091c0e1c23
Upgrade Node.js SDK to TypeScript 3.0 (#1669)
Per pulumi/pulumi#1668. No code changes required, just package.json
and lockfile updates.
2018-07-30 23:19:28 -07:00
CyrusNajmabadi 48df5bfe1e
Update pulumi/pulumi to run on Nodejs v10. (#1658) 2018-07-25 16:55:20 -07:00
Matt Ellis 9b24ad9738 Update gRPC to 1.12.2
This version has an updated protobufs dependency, which will remove
the warnings from `npm audit`.

Fixes #1350
2018-05-30 15:42:10 -07:00
joeduffy 12a2626c59 Prepare package for public publishing
This adds a warning to the top of the README.md and adds a license
to the package.json (to eliminate the associated warning).
2018-05-18 11:21:32 -07:00
Sean Gillespie 68911900fd
Graceful shutdown (#1320)
* Graceful RPC shutdown: CLI side

* Handle unavailable resource monitor in language hosts

* Fix a comment

* Don't commit package-lock.json

* fix mangled pylint pragma

* Rebase against master and fix Gopkg.lock

* Code review feedback

* Fix a race between closing the callerEventsOpt channel and terminating a goroutine that writes to it

* glog -> logging
2018-05-16 15:37:34 -07:00
Joe Duffy a74aa51662
Rename pulumi package to @pulumi/pulumi (#917)
In order to begin publishing our core SDK package to NPM, we will
need it to be underneath the @pulumi scope so that it may remain
private.  Eventually, we can alias pulumi back to it.

This is part of pulumi/pulumi#915.
2018-02-12 13:13:13 -08:00
Pat Gavlin f848090479 Return all computed inputs from Provider.Check.
As documented in issue #616, the inputs/defaults/outputs model we have
today has fundamental problems. The crux of the issue is that our
current design requires that defaults present in the old state of a
resource are applied to the new inputs for that resource.
Unfortunately, it is not possible for the engine to decide which
defaults remain applicable and which do not; only the provider has that
knowledge.

These changes take a more tactical approach to resolving this issue than
that originally proposed in #616 that avoids breaking compatibility with
existing checkpoints. Rather than treating the Pulumi inputs as the
provider input properties for a resource, these inputs are first
translated by `Check`. In order to accommodate provider defaults that
were chosen for the old resource but should not change for the new,
`Check` now takes the old provider inputs as well as the new Pulumi
inputs. Rather than the Pulumi inputs and provider defaults, the
provider inputs returned by `Check` are recorded in the checkpoint file.

Put simply, these changes remove defaults as a first-class concept
(except inasmuch as is required to retain the ability to read old
checkpoint files) and move the responsibilty for manging and
merging defaults into the provider that supplies them.

Fixes #616.
2017-12-03 09:33:16 -08:00
Joe Duffy 16ade183d8
Add a manifest to checkpoint files (#630)
This change adds a new manifest section to the checkpoint files.
The existing time moves into it, and we add to it the version of
the Pulumi CLI that created it, along with the names, types, and
versions of all plugins used to generate the file.  There is a
magic cookie that we also use during verification.

This is to help keep us sane when debugging problems "in the wild,"
and I'm sure we will add more to it over time (checksum, etc).

For example, after an up, you can now see this in `pulumi stack`:

```
Current stack is demo:
    Last updated at 2017-12-01 13:48:49.815740523 -0800 PST
    Pulumi version v0.8.3-79-g1ab99ad
    Plugin pulumi-provider-aws [resource] version v0.8.3-22-g4363e77
    Plugin pulumi-langhost-nodejs [language] version v0.8.3-79-g77bb6b6
    Checkpoint file is /Users/joeduffy/dev/code/src/github.com/pulumi/pulumi-aws/.pulumi/stacks/webserver/demo.json
```

This addresses pulumi/pulumi#628.
2017-12-01 13:50:32 -08:00
CyrusNajmabadi d007f040b9 Move from acorn to TypeScript as the parser we use when computing free variables. (#431) 2017-10-18 13:29:53 -07:00
pat@pulumi.com 9453f86c2e Implement dynamic resources.
A dynamic resource is a resource whose provider is implemented alongside
the resource itself. This provider may close over and use orther
resources in the implementation of its CRUD operations. The provider
itself must be stateless, as each CRUD operation for a particular
dynamic resource type may use an independent instance of the provider.
Changes to the definition of a resource's provider result in replacement
of the resource itself (rather than a simple update), as this allows the
old provider definition to delete the old resource and the new provider
definition to create an appropriate replacement.
2017-10-16 23:06:53 -07:00
Matt Ellis fc14329cfc Stop using yarn scripts for building
We have Makefiles, so we might as well use them, instead of spliting
build logic across two systems.
2017-10-16 10:47:37 -07:00
Matt Ellis e7c3aaba69 Merge pull request #395 from pulumi/pulumi-service-interface
More engine refactoring
2017-10-11 13:44:36 -07:00
CyrusNajmabadi b713990b5e Enable 'use const' linter rule. (#405)
* Enable 'use const' linter rule.
2017-10-10 14:50:55 -07:00
Matt Ellis 6bab1dbad4 Pass $(YARNFLAGS) to all yarn invocations
This let's you set things like YARNFLAGS==--offline which is helpful
when you are on an airplane. Yarn can still pick up stuff that you had
pulled down recently from its local cache
2017-10-09 18:21:55 -07:00
Joe Duffy f6e694c72b Rename pulumi-fabric to pulumi
This includes a few changes:

* The repo name -- and hence the Go modules -- changes from pulumi-fabric to pulumi.

* The Node.js SDK package changes from @pulumi/pulumi-fabric to just pulumi.

* The CLI is renamed from lumi to pulumi.
2017-09-21 19:18:21 -07:00
joeduffy 94207acf65 Upgrade to TypeScript ^2.5.2 2017-09-14 15:02:41 -07:00
joeduffy 8aba3aae12 Upgrade gRPC to 1.6.0; use full addresses
This change upgrades gRPC to 1.6.0 to pick up a few bug fixes.

We also use the full address for gRPC endpoints, including the
interface name, as otherwise we pick the wrong interface on Linux.
2017-09-09 07:37:10 -07:00
joeduffy 88a87569f5 Link the bin/ directory
This moves us closer to what we'll have with real NPM packages.
2017-09-07 12:43:12 -07:00
joeduffy 6147afb7d1 Fix cp command on Linux 2017-09-07 07:36:10 -07:00