2018-04-28 22:05:30 +02:00
|
|
|
PROJECT_NAME := Pulumi SDK
|
Get the empty Python program working
This change gets enough of the Python SDK up and running that the
empty Python program will work. Mostly just scaffolding, but the
basic structure is now in place. The primary remaining work is to
wire up resource creation to the gRPC interfaces.
In summary:
* The basic structure is as follows:
- Everything goes into sdk/python/.
- sdk/python/cmd/pulumi-langhost-python is a Go language host
that simply knows how to spawn Python processes to run out
entrypoint in response to requests by the engine.
- sdk/python/cmd/pulumi-langhost-python-exec is a little Python
shim that is invoked by the language host to run Python programs,
and is responsible for setting up the minimal goo before we can
do so (RPC connections and the like).
- sdk/python/lib/ contains a Python Pip package suitable for PyPi.
- In there, we have two packages: the root pulumi package that
contains all of the basic Pulumi programming model abstractions,
and pulumi.runtime, which contains the implementation of
resource registration, RPC interfacing with the engine, and so on.
* Add logic in our test framework to conditionalize on the language
type and react accordingly. This will allow us to skip Yarn for
Python projects and eventually run Pip if there's a requirements.txt.
* Created the basic project structure, including all of the usual
Make targets for installing into the proper places.
* Building also runs Pylint and we are clean.
There are a few other minor things in here:
* Add an "empty" test for both Node.js and Python. These pass.
* Fix an existing bug in plugin shutdown logic. At some point, we
started waiting for stderr/stdout to flush before shutting down
the plugin; but if certain failures happen "early" during the
plugin launch process, these channels will never get initialized
and so waiting for them deadlocks.
* Recently we seem to have added logic to delete test temp
directories if a failure happened during initialization of said
temp directories. This is unfortunate, because you often need to
look at the temp directory to see what failed. We already clean
them up elsewhere after the full test completes successfully, so
I don't think we need to be doing this, and I've removed it.
Still many loose ends (config, resources, etc), but it's a start!
2018-01-13 19:29:34 +01:00
|
|
|
SUB_PROJECTS := sdk/nodejs sdk/python
|
2017-11-12 01:20:56 +01:00
|
|
|
include build/common.mk
|
2017-06-21 23:23:48 +02:00
|
|
|
|
2017-12-05 22:39:13 +01:00
|
|
|
PROJECT := github.com/pulumi/pulumi
|
|
|
|
PROJECT_PKGS := $(shell go list ./cmd/... ./pkg/... | grep -v /vendor/)
|
|
|
|
EXTRA_TEST_PKGS := $(shell go list ./examples/ ./tests/... | grep -v /vendor/)
|
2018-03-16 01:07:01 +01:00
|
|
|
VERSION := $(shell scripts/get-version)
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
GOMETALINTERBIN := gometalinter
|
|
|
|
GOMETALINTER := ${GOMETALINTERBIN} --config=Gometalinter.json
|
2017-06-21 23:46:03 +02:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
TESTPARALLELISM := 10
|
2018-01-24 00:56:58 +01:00
|
|
|
|
|
|
|
# Our travis workers are a little show and sometime the fast tests take a little longer
|
|
|
|
ifeq ($(TRAVIS),true)
|
|
|
|
TEST_FAST_TIMEOUT := 10m
|
|
|
|
else
|
2017-12-15 21:12:06 +01:00
|
|
|
TEST_FAST_TIMEOUT := 2m
|
2018-01-24 00:56:58 +01:00
|
|
|
endif
|
2017-06-16 18:50:56 +02:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
build::
|
2017-12-01 22:50:32 +01:00
|
|
|
go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
|
2017-01-28 00:42:55 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
install::
|
2017-12-01 22:50:32 +01:00
|
|
|
GOBIN=$(PULUMI_BIN) go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
|
2017-10-05 23:08:35 +02:00
|
|
|
|
2017-11-01 00:39:23 +01:00
|
|
|
LINT_SUPPRESS="or be unexported"
|
2017-11-12 01:20:56 +01:00
|
|
|
lint::
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) main.go | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
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 21:09:46 +02:00
|
|
|
$(GOMETALINTER) ./pkg/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) ./cmd/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-01-28 00:42:55 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
test_fast::
|
2017-12-15 21:12:06 +01:00
|
|
|
go test -timeout $(TEST_FAST_TIMEOUT) -cover -parallel ${TESTPARALLELISM} ${PROJECT_PKGS}
|
2017-08-06 17:52:32 +02:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
test_all::
|
2017-12-05 22:39:13 +01:00
|
|
|
PATH=$(PULUMI_ROOT)/bin:$(PATH) go test -cover -parallel ${TESTPARALLELISM} ${EXTRA_TEST_PKGS}
|
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 23:26:34 +02:00
|
|
|
|
2018-03-06 23:36:50 +01:00
|
|
|
.PHONY: publish_tgz
|
|
|
|
publish_tgz:
|
2017-11-12 01:20:56 +01:00
|
|
|
$(call STEP_MESSAGE)
|
2018-03-06 23:36:50 +01:00
|
|
|
./scripts/publish_tgz.sh
|
|
|
|
|
|
|
|
.PHONY: publish_packages
|
|
|
|
publish_packages:
|
|
|
|
$(call STEP_MESSAGE)
|
|
|
|
./scripts/publish_packages.sh
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
.PHONY: coverage
|
|
|
|
coverage:
|
|
|
|
$(call STEP_MESSAGE)
|
2017-11-20 20:12:04 +01:00
|
|
|
./scripts/gocover.sh
|
2017-06-24 00:11:20 +02:00
|
|
|
|
2017-09-28 20:53:08 +02:00
|
|
|
# The travis_* targets are entrypoints for CI.
|
2017-11-12 01:20:56 +01:00
|
|
|
.PHONY: travis_cron travis_push travis_pull_request travis_api
|
|
|
|
travis_cron: all coverage
|
2018-03-06 23:36:50 +01:00
|
|
|
travis_push: only_build publish_tgz only_test publish_packages
|
2017-09-28 20:53:08 +02:00
|
|
|
travis_pull_request: all
|
|
|
|
travis_api: all
|