Commit graph

163 commits

Author SHA1 Message Date
pat@pulumi.com 6b66437fae Track resources that are pending deletion in checkpoints.
During the course of a `pulumi update`, it is possible for a resource to
become slated for deletion. In the case that this deletion is part of a
replacement, another resource with the same URN as the to-be-deleted
resource will have been created earlier. If the `update` fails after the
replacement resource is created but before the original resource has been
deleted, the snapshot must capture that the original resource still exists
and should be deleted in a future update without losing track of the order
in which the deletion must occur relative to other deletes. Currently, we
are unable to track this information because the our checkpoints require
that no two resources have the same URN.

To fix this, these changes introduce to the update engine the notion of a
resource that is pending deletion and change checkpoint serialization to
use an array of resources rather than a map. The meaning of the former is
straightforward: a resource that is pending deletion should be deleted
during the next update.

This is a fairly major breaking change to our checkpoint files, as the
map of resources is no more. Happily, though, it makes our checkpoint
files a bit more "obvious" to any tooling that might want to grovel
or rewrite them.

Fixes #432, #387.
2017-10-18 17:09:00 -07:00
Matt Ellis 908d081e88 Construct version based on git information
We use `git describe --tags` to construct a version number based on
the current version tag.

The properties VERSION (when using make) and Version (when using
MSBuild) can be explicitly set to use a fixed value instead.

Fixes #13
2017-10-16 18:35:41 -07:00
Matt Ellis be1e698f0b Restore TESTPARALLELISM to 10
Now that we no longer recursively call yarn via yarn run and scripts,
we can use a `--mutex network` directive in a .yarnrc file at the root
of the repository to prevent multiple copies of yarn running
concurrently.
2017-10-16 10:47:37 -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
Matthew Riley a4fba1c5ee Limit test parallelism to avoid Yarn cache corruption
See e.g. https://travis-ci.com/pulumi/pulumi/builds/56843128
2017-10-13 15:18:16 -07:00
Matt Ellis 0a835bd14a Use explicit targets in Makefile for Travis
Defer build and publish logic into the makefiles instead of trying to
use Travis to do so. This let's us sidestep Travis's not great error
handling (see pulumi/home#21 for more details)
2017-09-28 13:12:13 -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
Pat Gavlin c8f315227f Early-out integration tests if PATH is incorrect.
This provides a friendlier experience if the nodejs language service is
not on the path. Also, print a helpful message at the end of
`make configure` if PATH has not yet been setup.
2017-09-18 13:06:59 -07:00
joeduffy 4c781da93b Add instructions for make configure
And also move the Node.js SDK-specific parts into the sdk/nodejs/ directory.
2017-09-11 15:17:11 -07:00
joeduffy 1c52e2d607 Run the node_modules version of node-gyp 2017-09-04 11:35:21 -07:00
joeduffy 3ff10edcc4 Add a make configure target
This change adds a `make configure` target, which handles preparing
the environment for building the project.  This includes existing
steps, like dep ensure and yarn installing the Node.js SDK NPM
dependencies, and also includes downloading the right Node.js/V8
includes, putting them in the right place, and then generating the
appropriate node-gyp project files that reference those includes.
2017-09-04 11:35:21 -07:00
joeduffy f189c40f35 Wire up Lumi to the new runtime strategy
🔥 🔥 🔥  🔥 🔥 🔥

Getting closer on #311.
2017-09-04 11:35:21 -07:00
joeduffy 9ffbb8d755 Eliminate lumi, lumijs, and lumirt packages
This change gets rid of the old-style @pulumi/lumi, @pulumi/lumijs,
and @pulumi/lumirt packages.  Instead, we have the new Node.js SDK.
2017-09-04 11:35:20 -07:00
Matt Ellis fac6c7c91c Fix Makefile on Fedora 2017-08-24 18:09:37 -07:00
joeduffy 4ea7a55aca Make all by default 2017-08-06 08:52:32 -07:00
joeduffy 60f23243ef Install before test
The tests can depend on the lumi binary (e.g., for integration testing),
so we need to run install before test in the Makefile.
2017-08-06 08:44:04 -07:00
joeduffy 2f4d7a9789 Run integration tests
This change runs the examples integration tests for every test
run.  They used to be split out because the AWS tests take so long,
but now those are in their own separate package.  Running the
integration tests here more frequently will prevent breaking the
most basic Lumi CLI commands and capabilities.
2017-08-06 08:26:20 -07:00
joeduffy 35aa6b7559 Rename pulumi/lumi to pulumi/pulumi-fabric
We are renaming Lumi to Pulumi Fabric.  This change simply renames the
pulumi/lumi repo to pulumi/pulumi-fabric, without the CLI tools and other
changes that will follow soon afterwards.
2017-08-02 09:25:22 -07:00
Joe Duffy 5da78c036b Convert to Dep 2017-08-01 18:37:06 -07:00
joeduffy 232ed7e248 Goodbye, custom AWS provider code
😥

Preparing to RI the tfbridge branch into master.
2017-07-21 14:41:01 -07:00
joeduffy fc1cd2c01e Make a publish script; fix sed for multi-OS compat
This change creates a scripts/ folder, moves our existing shell
script, gocover.sh, underneath it, and factors the publish logic
out of the Makefile and into the publish.sh file.

The syntax for sed differs between Mac OS X and GNU versions of
the tool, which is rather annoying.  This fixes it by leveraging
the fact that `sed -i.bak ...` works, although we now need to
clean up the *.bak file left behind.  (No big deal and way better
than maintaining OS-dependent logic.)
2017-07-21 09:37:14 -07:00
joeduffy 4b505acbcc Also package up LumiJS compiler in binary releases 2017-07-20 15:17:10 -07:00
joeduffy 2670e42c93 Publish built binaries upon successful push CI to master
This adds a new make target, publish, that will create a release
package and upload it to an S3 bucket.  This package simply contains
the built CLI plus the core library packages, lumi, lumirt, and lumijs.

This target is invoked automatically at the end of a successful
Travis run against a push to master.
2017-07-20 14:52:40 -07:00
Luke Hoban 1d266e38aa Add Go code coverage reports to nightly tests
Adds a make task to generate code coverage for all Go sources.

That make task re-runs the tests, and can be fairly expensive,
so it is enabled only in the nightly tests for now.

Part of #206.
2017-06-23 16:07:05 -07:00
joeduffy a019880ad5 Switch to /bin/bash as the shell for our Makefiles
This should fix the issues with escaping in Travis (fingers crossed).
Also specifies the -e flag for echo, since switching the shell to
bash led to ANSI escape codes being uninterpreted by default.
2017-06-22 14:57:09 -07:00
joeduffy 8b57310854 Tidy up more lint
This change fixes a few things:

* Most importantly, we need to place a leading "." in the paths
  to Gometalinter, otherwise some sub-linters just silently skip
  the directory altogether.  errcheck is one such linter, which
  is a very important one!

* Use an explicit Gometalinter.json file to configure the various
  settings.  This flips on a few additional linters that aren't
  on by default (line line length checking).  Sadly, a few that
  I'd like to enable take waaaay too much time, so in the future
  we may consider a nightly job (this includes code similarity,
  unused parameters, unused functions, and others that generally
  require global analysis).

* Now that we're running more, however, linting takes a while!
  The core Lumi project now takes 26 seconds to lint on my laptop.
  That's not terrible, but it's long enough that we don't want to
  do the silly "run them twice" thing our Makefiles were previously
  doing.  Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
  to rely on the fact that grep returns 1 on "zero lines".

* Finally, fix the many issues that this turned up.

I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 12:09:46 -07:00
joeduffy 9fe8ae1c7e Disable gotype linter
This disables gotype as a linter, since it depends on object files
in an annoying way (and doesn't add much beyond go build anyway).
From alecthomas/gometalinter#206, it sounds like the current plan
is to remove gotype entirely from the set of linters GML runs.
2017-06-21 14:46:03 -07:00
joeduffy 3fdfc9c7bc Run lint after build/test 2017-06-21 14:38:52 -07:00
joeduffy 9179d58eb1 Install GoMetaLinter in Travis
And also rejigger the Makefiles to properly error if it's missing.
2017-06-21 14:23:48 -07:00
joeduffy 7fe8052941 Fix some lint in our lint
After 233c5a8 landed, I noticed there are a few things to be fixed up:

    * Run gometalinter in all the right places.  We need to run both in
      lint and lint_quiet targets.  I've also cleaned up some of the logic
      around what to suppress so there's less repetition.

    * We currently @ meaningful commands, which is unfortunate, since it
      makes debugging Makefiles tough (especially when looking at CI build
      logs).  Going forward, we should only use @ for meaningless commands,
      like @echo.

    * The AWS project wasn't actually running tslint, because it needs to
      say `tslint './pack/**/*.ts' --exclude='./pack/node_modules/**'`.
      The current script of `tslint lib/aws/pack/...` wasn't actually
      running lint, hence we missed a lot of AWS lint issues.

    * Fix up the issues that these fixes uncovered.  Mostly err shadowing.
2017-06-21 13:24:35 -07:00
Britton Forsyth 233c5a8c52 [#245, #226, #185] Finished linting (#257)
* Added typescript linting to Makefiles
* Added tslint to CI and ran on examples
* Fixed tslint calling in Makefiles
* Deleted unnecessary files
2017-06-21 11:58:22 -07:00
Luke Hoban c265620f28 Makefile updates
Make nightly tests more verbose to avoid 10 minute
timeout in Travis when we have no test output.

Run aws provider tests by default again on full builds.
2017-06-17 15:43:50 -07:00
Luke Hoban d862112682 Fix Makefile target names
Fix copy/paste issue in some new Makefile targets.
2017-06-16 10:34:34 -07:00
Luke Hoban e27549e5c2 Add nightly build target
Adds a nightly build target that runs the long running provider
and examples tests.  Enables travis to run this on cron jobs,
which we will configure to trigger nightly.
2017-06-16 09:53:07 -07:00
Luke Hoban 6840dba051 Move examples test to seperate package
We need to run examples tests only after building and
installing all Lumi commands.
2017-06-16 09:24:31 -07:00
Luke Hoban 639a2d323d Test more examples
Tests all of our commonly used examples.

Also sets test parallelism to 10 by default
since we are I/O bound on API calls to
the resource providers.

Also avoids using larger EC2 examples in
our samples so that we can keep our test
costs lower :-).
2017-06-16 09:24:31 -07:00
joeduffy a42b40f1a8 Refactor runtime functionality
This change splits the core Lumi library -- which is meant to be a pure
LumiJS library without any special status -- from the runtime library --
which is really meant to be the underpinnings of "special" functionality
that integrates with the runtime in sophisticated ways.

After this change, LumiRT is at the very bottom, and, despite it using
a subset of LumiJS, it must not trigger any functionality that would
mandate the use of the LumiJS runtime library.  Atop that, the LumiJS
library is layered.  And finally, above that, Lumi depends on LumiJS.
2017-06-13 18:11:59 -07:00
Luke Hoban 441f32d155 A few tweaks to lint fixes 2017-06-13 16:47:55 -07:00
Britton Forsyth 01003ad48b Implemented highlighted edits 2017-06-13 11:01:23 -07:00
Britton Forsyth 69e4834f63 Merge branch 'master' into gometalinter 2017-06-09 14:34:51 -07:00
Britton Forsyth 3066fcda78 Implemented suggested edits 2017-06-08 11:44:16 -07:00
Britton Forsyth 7457cadf58 Fixed various additional linting issues 2017-06-08 10:21:17 -07:00
Luke Hoban 771a30c688 Save build artifacts aftifacts for Go builds
In the places we run `go build`, we should use
`go build -i` to save the `.a` files generated
during the build.  This ensures the artifacts
are availble for other Go tools (linters, IDEs), and
should also improve build speeds.
2017-06-07 17:03:07 -07:00
joeduffy cfaa7c9310 Eliminate use of nonstandard tools
This change eliminates the use of nonstandard tools in our build:

* `go test` automatically uses `GOMAXPROCS` for its parallelism
  setting.  In modern Go, this is now set to the number of processors.
  So, there is no need to set it explicitly using `nproc`.

* We can avoid `realpath` in the `lumijs` executable by making it
  a Node.js file and using a relative require import of main.

* We can avoid `realpath` in our Makefiles by just using `pwd`.
2017-06-03 11:08:09 -07:00
joeduffy 39db4dca63 Also build the Lumi stdlib during make all 2017-06-02 15:26:39 -07:00
Joe Duffy 8bbe89bd75 Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target

This change uses make for more of our tree.  Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:

    $ make all

This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.

Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 14:26:34 -07:00
joeduffy 769b0a4af0 Only run quick tests for make; add a make full target
The AWS tests take a while to run and it's easy to forget.  Further,
they are going to start taking quite a bit longer very soon.

So, this change introduces a `make full` target, which is what our
CI tests run.  But the ordinary `make` skips the long tests for faster
inner loop verification.  Over time, I'm sure we'll get far more
sophisticated with the split between inner vs. outer loop testing,
especially for performance, stress, and so on.
2017-06-02 10:30:57 -07:00
joeduffy 717609a31b Fail the build on lint warnings
Golint by default doesn't return a non-zero exit code when lint errors
are present.  To address this, we need to pass -set_exit_status.

But it gets more complicated: because we are suppressing some lint
warnings, we cannot use -set_exit_status in the lint_quiet target.
For that, we use test -z to fail if any output passes the filter.

Eventually when we do pulumi/lumi#191, we can remove this hack.
2017-06-02 09:05:28 -07:00
joeduffy e2cb211d93 Enable parallel tests
This change enables parallelism for our tests.

It also introdues a `test_core` Makefile target to just run the
core engine tests, and not the providers, since they take a long time.
This is intended only as part of the inner developer loop.
2017-06-01 14:01:26 -07:00
joeduffy e39d1c5ada Skip -printf checks in Govet
Due to https://github.com/golang/go/issues/12294, our Travis jobs are
failing with

    pkg/compiler/binder/stmtexpr.go:160: no formatting directive in Errorf call

etc, etc.  Perplexingly, this is supposedly fixed as of Go 1.7.5, and we are
running Go 1.8.2 in Travis.  However, vet is a separate binary tool, so it seems
either (1) Go's Linux distro doesn't contain the right version or (2) Travis's
image doesn't contain the right version.  I have to imagine (2) is more likely,
except that I can't actually look at the machine (and go vet doesn't have a version)!

For now, we will just skip the -printf checks.
2017-05-24 12:50:29 -07:00
joeduffy a1cf0c2a6c Update to Go 1.8.2 2017-05-24 12:50:28 -07:00
Luke Hoban 2a036c8693 More CLIDL -> LUMIDL updates 2017-05-18 17:21:08 -07:00
joeduffy b7f3d447a1 Preserve the lumi prefix on our CLI tools
This change keeps the lumi prefix on our CLI tools.

As @lukehoban pointed out in person, as soon as we do pulumi/coconut#98,
most people (other than compiler authors themselves) won't actually be
typing the commands.  And, furthermore, the commands aren't all that bad.

Eventually I assume we'll want something like `lumi-js`, or
`lumi-js-compiler`, so that binaries are discovered dynamically in a way
that is extensible for future languages.  We can tackle this during #98.
2017-05-18 12:38:58 -07:00
joeduffy dafeb77dff Rename Coconut to Lumi
This is part of pulumi/coconut#147.

After it has landed, I will rename the repo on GitHub.
2017-05-18 11:38:28 -07:00
joeduffy e97632e668 Make the IDL compiler too 2017-05-13 20:11:20 -04:00
joeduffy 0325801e99 Run go test with -cover flag
This ensures that code coverage is emitted, something we need to start
paying closer attention to as we start hardening the system.
2017-05-13 20:07:49 -04:00
joeduffy 09e786269a Correctly quote Makefile lint commands 2017-05-13 19:51:26 -04:00
joeduffy 24990062ad Run golint during make
This change runs golint during make by default, but suppresses the
class of errors we are currently permitting into the code (just those
about public documentation on APIs).
2017-04-12 11:01:16 -07:00
joeduffy 9d7bbcfa78 Restructure source layout for tools
This change restructures the overall structure for commands so that
all top-level tools are in the cmd/ directory, alongside the primary
coco command.  This is more "idiomatic Go" in its layout, and makes
room for additional command line tools (like cocogo for IDL).
2017-04-12 10:38:12 -07:00
joeduffy fbb56ab5df Coconut! 2017-02-25 07:25:33 -08:00
joeduffy 5774999957 Clean up the Makefile
This adds a bunch of independent targets to the Makefile, to help
run individual commands as needed.  It also skips running `golint`
by default (per golint's advice, actually), because it spews lots
of documentation-related things at the moment, which we are
intentionally ignoring.  (Mainly just hundreds of public members
without comments; eventually we'll need to tackle this.)
2017-01-27 15:42:55 -08:00
joeduffy a4ac29554d Test packages when making the project 2016-11-15 19:25:06 -08:00
joeduffy e75f06bb2b Sketch a mu build command and its scaffolding
This adds a bunch of general scaffolding and the beginning of a `build` command.

The general engineering scaffolding includes:

* Glide for dependency management.
* A Makefile that runs govet and golint during builds.
* Google's Glog library for logging.
* Cobra for command line functionality.

The Mu-specific scaffolding includes some packages:

* mu/pkg/diag: A package for compiler-like diagnostics.  It's fairly barebones
  at the moment, however we can embellish this over time.
* mu/pkg/errors: A package containing Mu's predefined set of errors.
* mu/pkg/workspace: A package containing workspace-related convenience helpers.

in addition to a main entrypoint that simply wires up and invokes the CLI.  From
there, the mu/cmd package takes over, with the Cobra-defined CLI commands.

Finally, the mu/pkg/compiler package actually implements the compiler behavior.
Or, it will.  For now, it simply parses a JSON or YAML Mufile into the core
mu/pkg/api types, and prints out the result.
2016-11-15 14:30:34 -05:00