Commit graph

202 commits

Author SHA1 Message Date
joeduffy 954fd9ae78 Use real configuration in ec2instance example
This change eliminates the hard-coded region from the ec2instance
example, and instead uses the new `aws.config.region` configuration
variable.  This makes the code more amenable to multi-instancing.
2017-02-28 16:14:18 -08:00
joeduffy 977b16b2cc Add basic targeting capability
This change partially implements pulumi/coconut#94, by adding the
ability to name targets during creation and reuse those names during
deletion and update.  This simplifies the management of deployment
records, checkpoints, and snapshots.

I've opted to call these things "husks" (perhaps going overboard with
joy after our recent renaming).  The basic idea is that for any
executable Nut that will be deployed, you have a nutpack/ directory
whose layout looks roughly as follows:

    nutpack/
        bin/
            Nutpack.json
            ... any other compiled artifacts ...
        husks/
            ... one snapshot per husk ...

For example, if we had a stage and prod husk, we would have:

    nutpack/
        bin/...
        husks/
            prod.json
            stage.json

In the prod.json and stage.json files, we'd have the most recent
deployment record for that environment.  These would presumably get
checked in and versioned along with the overall Nut, so that we
can use Git history for rollbacks, etc.

The create, update, and delete commands look in the right place for
these files automatically, so you don't need to manually supply them.
2017-02-25 09:24:52 -08:00
joeduffy 32379da4f5 Fix a few lingering issues from rename 2017-02-25 07:51:29 -08:00
joeduffy fbb56ab5df Coconut! 2017-02-25 07:25:33 -08:00
joeduffy 14e3f19437 Implement name property in AWS provider/library 2017-02-24 15:41:56 -08:00
joeduffy 271eaefb5c Fix ec2instance CIDR property 2017-02-23 15:04:07 -08:00
joeduffy 39d2fd4e96 Change mu.Bucket to mu.x.Bucket in Thumbnaile 2017-02-19 09:26:25 -08:00
joeduffy 2e8b04f2a7 Get the minimal AWS sample compiling/verifying/evaluating 2017-02-11 13:33:11 -08:00
joeduffy 0b299f0ae5 Update ec2instance so that it compiles/verifies/evals 2017-02-10 09:10:13 -08:00
joeduffy c821634761 Restructure the examples
This restructures the examples directory a bit, into three buckets:

* basic/: simplistic examples, like hello world and whatnot.

* conversions/: actual conversions from existing samples (with the source cited).

* scenarios/: more complex examples that demonstrate various features of the system.
2017-02-09 16:07:45 -08:00
joeduffy e8f54f3f4d Add a minimal MuJS blueprint example 2017-02-09 13:36:18 -08:00
joeduffy a0de263930 Add a tsconfig to the Thumbnailer example 2017-02-03 12:14:40 -08:00
joeduffy 7854e0d393 Merge branch 'master' of github.com:marapongo/mu 2017-02-03 12:09:56 -08:00
joeduffy 03b065015f Add a missing } 2017-02-03 12:09:48 -08:00
Joe Duffy dbf86736e1 Move ec2instance example underneath aws/
I just introduced the examples/aws/ directory yesterday to hold some
of our basic AWS examples, as I expect us to start accumulating more
of them.  So this just moves ec2instance underneath that directory.
We should probably think about further reorganizing these (e.g., into
demos/, scenarios/, etc.), ass we accumulate more examples.
2017-02-03 05:38:06 -08:00
Luke Hoban 464bd4fe28 Simple EC2 instance example 2017-02-02 22:03:12 -08:00
joeduffy e953c68074 Add a minimal AWS VPC blueprint to the examples 2017-02-02 10:53:35 -08:00
joeduffy d1986910b9 Check in the thumbnailer example from our docs 2017-01-28 11:33:15 -08:00
joeduffy 5374a2e3fa Add a example web crawler Mu blueprint
This adds an example web crawler blueprinted, derived from the AOSA
book's asynchronous I/O coroutines example.
2017-01-12 14:59:18 -08:00
joeduffy 6a23300d21 Reformat example; use "new()" in place of "resources" 2016-12-16 11:15:33 -08:00
joeduffy 284cec204d Experiment with intersection types
This change experiments with using intersection types to cut down
on some of the boilerplate -- and make reuse easier -- in the
service definitions.
2016-12-16 10:04:46 -08:00
joeduffy ed1eebe7e5 Clean up imports 2016-12-15 19:42:48 -08:00
joeduffy 2e941bbc57 Make an initial attempt at a better factoring
This splits the overall example rack service into many sub-services.
This leads to a much cleaner factoring of the code.  Note that there are
some missing properties -- it's hard to eyeball this without a real compiler.
But the essence of the example is pretty spot on.
2016-12-15 19:40:34 -08:00
joeduffy 68a3d27a73 Use "prop: value" instead of "prop = value"
I personally prefer this syntax.  It is more "declarative" and, particularly
because we support true assignments, I feel like it's more representative of
what's going on.  It's easier to scan for real imperative assignments.  This
approach also eliminates a single horizontal character per assignment.
2016-12-15 17:57:36 -08:00
joeduffy 14471c0ac7 Experiment with different syntax for resource creation
In this change, ":= new" declares a new resource.

In addition, we change arrays to be Go-like, in that zero-initialized
ones can be appended to safely, such that declaring a new instance is
done merely by stating "var arr: T[]".
2016-12-15 17:50:10 -08:00
joeduffy 47e1125f3b Use arrays to cut down on boilerplate
This is all hand-waving, of course, however it's helping with the language design.
2016-12-15 16:58:21 -08:00
joeduffy 5e652c3dd3 Check in the Xovnoc conversion example 2016-12-15 16:40:49 -08:00
joeduffy 46e89084bf Add a hypothetical Echo example 2016-12-14 15:13:17 -08:00
joeduffy ffae234af0 Add a Mu.yaml to the MongoDB/Twilio example 2016-11-23 16:28:00 -08:00
joeduffy d55acad652 Add a workspace file to our demo
This just sets the default cloud provider to AWS.
2016-11-22 09:50:53 -08:00
joeduffy 7f712243f7 Demonstrate hypothetical mu/app type in the demo 2016-11-22 08:58:06 -08:00
joeduffy efe69a2e2c Explicitly declare the demo's dependencies 2016-11-18 16:52:51 -08:00
joeduffy 74ebf36dd0 Update conversion modules to the latest 2016-11-17 05:26:32 -08:00
joeduffy d44a2c95ff Update the demo script to reference the DSL 2016-11-16 18:06:46 -08:00
joeduffy 001bcc097d Make a few updates to the demo Mu.yaml so that it compiles 2016-11-16 18:05:59 -08:00
joeduffy 19d5fcbd93 Fix a lambda typo in the demo code 2016-11-07 17:03:32 -08:00
joeduffy 8ce0ff95e9 Remove the Dockerfile from demo1/build2
The Mu stack stands alone and hence doesn't require a Dockerfile.
2016-11-07 17:02:36 -08:00
joeduffy c208ab65bb Replace Mu.yaml service description with a "source" directive 2016-11-07 10:16:11 -08:00
joeduffy 7323436760 Rearrange demo directory so the "build" variants stand alone 2016-11-07 10:15:38 -08:00
joeduffy 736008168d Add two variants to the Mu demo
This adds two hypothetical variants to the Mu demo, "building" new capabilities
up from the basic Express and MongoDB app we start with:

1) The first variant is to leverage the Mu SDK for service discovery and
   configuration, eliminating the "loosely typed" approach that is common with
   Docker (e.g., having to fetch connection URLs from arguments, environment
   variables, etc).  This extends the Mu type system "into" the Docker container,
   whereas previously it stopped at the boundary.

2) The second variant really takes this to the next level, embellishing the nice
   DSL-like approach.  In this model, infrastructure is expressed in code.
2016-11-07 09:37:47 -08:00
joeduffy 31717d5f95 Eliminate manual persistence from demo Mufile
Instead of manually creating a volume, we will arrange for the mongodb/mongodb
to auto-mount a mu/x/fs/volume, as per [the cloud-neutral design doc](/docs/xcloud.md).
2016-11-06 12:36:28 -08:00
joeduffy ea707cab68 Add a reminder to figure out Security metadata in Mufiles 2016-11-04 15:43:03 -07:00
joeduffy 7e26ab050d Add the "demo1" example app
This just adds a simple voting app for the demo script.  It leverages
a Node.js Express app for the frontend and a MongoDB database for the backend.
It conditionally provisions and attaches to an AWS Elastic Block Store volume
in the event that it's targeting an AWS cluster, and ephemeral storage otherwise.
2016-11-04 12:17:46 -07:00
joeduffy 8f529cb3d8 Add the Nginx hypothetical examples
This was really just a brainstorming exercise that helped get to the final
model we landed on.  I'm archiving it for posterity.  I'll decide whether to
carry it forward or delete it and leave it as an artifact for future reference
as I make more progress on the overall architecture and file format specification.
2016-11-01 11:01:55 -07:00
joeduffy 07444a9612 Add some README scaffolding around the converted examples 2016-11-01 10:39:36 -07:00
joeduffy d6b2575008 Add a few lingering changes to the Mu voting example
Some of this is out of date, however I'm archiving work in progress,
and will freshen it up momentarily.
2016-11-01 10:31:21 -07:00
joeduffy 8c3dbf9d6d Add Docker Compose and Kubernetes conversions as submodules 2016-11-01 10:30:39 -07:00
joeduffy 7d7609fc82 Fix a typo (cust => client variable name) 2016-10-25 17:25:12 -07:00
joeduffy 1ae888ce02 Add a sample app that sends a Twilio SMS anytime Mongo is updated
This was an interesting example I found in the Mulesoft GitHub repos.  It seemed like
a perfect candidate for Riff/Mu/Lambda, so I sketched out what it might look like.
2016-10-25 17:23:50 -07:00
joeduffy bbe6280d46 Sketch out the Mu YAML metadata for the vote50 app 2016-10-19 15:58:51 -07:00
joeduffy 26968a3314 Sketch out an AWS CloudFormation based compilation of the vote50 app
This change adds a .mu/ directory to the vote50 app.  Inside are the "expected"
contents that the Mu compiler should output.  Eventually we will validate against
this that the (currently non-existent) compiler generates the correct thing.

This isn't complete, although I can manually create bits and pieces of the stacks
using CloudFormation.  More files will come; for example, the code packages.

In a nutshell:

    .mu/                                # Shared files agnostic to the cloud target
        aws-native-cf/                  # Files specific to the AWS CloudFormation target
            app.template.yaml           # The CloudFormation stack for the overall app
            services/                   # A directory containing service-specific stacks
                voting.template.yaml    # The CloudFormation stack for the VotingService
        services/                       # Service files agnostic to the cloud target
            voting.proto                # The gRPC definition for VotingService's API
        mu.yaml                         # The Mu package manifest (minimal for now)
2016-10-15 12:18:28 -07:00
joeduffy b1aa61e03d Create a sample app that exposes a voting API for all 50 states 2016-10-15 09:00:28 -07:00