Remove deprecated lumix package
This commit is contained in:
parent
423e84df6e
commit
ed092213d2
21 changed files with 0 additions and 515 deletions
3
lib/lumix/.gitignore
vendored
3
lib/lumix/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
bin/
|
||||
node_modules/
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# lib/lumix
|
||||
|
||||
**NOTE:** This package is deprecated; please see lib/mantle for its replacement.
|
||||
|
||||
This is an experimental cross-platform library of stacks.
|
||||
|
||||
Please refer to the [Cross-Cloud Targeting](https://github.com/pulumi/lumi/blob/master/docs/x-cloud.md) design
|
||||
document for more details on how this might work.
|
||||
|
||||
Note that everything in here very much a work in progress and little of it actually works (yet).
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
// Licensed to Pulumi Corporation ("Pulumi") under one or more
|
||||
// contributor license agreements. See the NOTICE file distributed with
|
||||
// this work for additional information regarding copyright ownership.
|
||||
// Pulumi licenses this file to You under the Apache License, Version 2.0
|
||||
// (the "License"); you may not use this file except in compliance with
|
||||
// the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// An architecture is a combination of cloud plus optionally a scheduler that we're targeting.
|
||||
export interface Arch {
|
||||
cloud: Cloud;
|
||||
scheduler: Scheduler;
|
||||
}
|
||||
|
||||
// The cloud operating system to target.
|
||||
// TODO: As soon as this PR is merged, https://github.com/Microsoft/TypeScript/pull/10676, I believe we can replace
|
||||
// these with references to the above Clouds literals (e.g., `typeof clouds.AWS`, etc). For now, duplicate.
|
||||
export type Cloud = "aws" | "gcp" | "azure" | "vmware";
|
||||
|
||||
// The container scheduler and runtime to target.
|
||||
// TODO: As soon as this PR is merged, https://github.com/Microsoft/TypeScript/pull/10676, I believe we can replace
|
||||
// these with references to the above Clouds literals (e.g., `typeof schedulers.Swarm`, etc). For now, duplicate.
|
||||
export type Scheduler =
|
||||
undefined | // no scheduler, just use VMs.
|
||||
"swarm" | "kubernetes" | "mesos" | // cloud-neutral schedulers.
|
||||
"ecs" | "gke" | "acs"; // cloud-specific schedulers.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
name: lumix/autoscaler
|
||||
description: A service that can automatically scale other services based on policy.
|
||||
intrinsic: true
|
||||
properties:
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
name: lumix/bucket
|
||||
description: A cloud-neutral bucket of objects.
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: A unique bucket name.
|
||||
services:
|
||||
private:
|
||||
{{if isAWS .Target}}
|
||||
aws/s3/bucket:
|
||||
bucketName: {{.Args.Name}}
|
||||
{{else}}
|
||||
{{fail "Unsupported cloud target"}}
|
||||
{{end}}
|
||||
public:
|
||||
mu/app:
|
||||
api:
|
||||
provider: protobuf3
|
||||
source: ./api.proto
|
||||
arguments:
|
||||
bucket: bucket
|
||||
runtime: golang
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package pulumi.mu.x.bucket;
|
||||
|
||||
service Bucket {
|
||||
// TODO: consider an AppendObject API.
|
||||
// TODO: consider range-based read and write APIs.
|
||||
rpc CopyObject(CopyObjectRequest) returns (CopyObjectResponse) {}
|
||||
rpc DeleteObject(DeleteObjectRequest) returns (DeleteObjectResponse) {}
|
||||
rpc GetObject(GetObjectRequest) returns (GetObjectResponse) {}
|
||||
rpc GetObjectBlob(GetObjectBlobRequest) returns (stream GetObjectBlobResponse) {}
|
||||
rpc PutObject(stream PutObjectRequest) returns (PutObjectResponse) {}
|
||||
rpc ListObjects(ListObjectsRequest) returns (stream ListObjectsResponse) {}
|
||||
}
|
||||
|
||||
message CopyObjectRequest {
|
||||
string from = 1;
|
||||
string to = 2;
|
||||
}
|
||||
|
||||
message CopyObjectResponse {
|
||||
}
|
||||
|
||||
message DeleteObjectRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message DeleteObjectResponse {
|
||||
}
|
||||
|
||||
message GetObjectRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message GetObjectResponse {
|
||||
// TODO: some interesting Object metadata.
|
||||
}
|
||||
|
||||
message GetObjectBlobRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message GetObjectBlobResponse {
|
||||
bytes chunk = 1; // chunk contains a sequence of bytes, in order, represent the object's blob.
|
||||
}
|
||||
|
||||
message PutObjectRequest {
|
||||
bytes chunk = 1; // chunk is the data stream to put; the first chunk contains the UTF-8 encoded objectName.
|
||||
}
|
||||
|
||||
message PutObjectResponse {
|
||||
}
|
||||
|
||||
message ListObjectsRequest {
|
||||
string prefix = 1;
|
||||
}
|
||||
|
||||
message ListObjectsResponse {
|
||||
string name = 1;
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
// Licensed to Pulumi Corporation ("Pulumi") under one or more
|
||||
// contributor license agreements. See the NOTICE file distributed with
|
||||
// this work for additional information regarding copyright ownership.
|
||||
// Pulumi licenses this file to You under the Apache License, Version 2.0
|
||||
// (the "License"); you may not use this file except in compliance with
|
||||
// the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
module mu/clouds/aws
|
||||
import aws/ec2
|
||||
|
||||
// A base Mu cluster running in AWS, ready to host stacks.
|
||||
service Cluster {
|
||||
new() {
|
||||
// First set up a VPC with a single subnet.
|
||||
var cidr: "10.0.0.0/16"
|
||||
vpc := new ec2.VPC {
|
||||
name: context.cluster.name + "-VPC"
|
||||
cidrBlock: cidr
|
||||
}
|
||||
subnet := new ec2.Subnet {
|
||||
name: context.cluster.name + "-Subnet"
|
||||
vpc: vpc
|
||||
cidrBlock: cidr
|
||||
}
|
||||
|
||||
// Now create an Internet-facing gateway to expose this cluster's subnet to Internet traffic.
|
||||
gateway := new ec2.InternetGateway {
|
||||
name: context.cluster.name + "-InternetGateway"
|
||||
}
|
||||
attachment := new ec2.VPCGatewayAttachment {
|
||||
internetGateway: gateway
|
||||
vpc: vpc
|
||||
}
|
||||
routes := new ec2.RouteTable {
|
||||
name: context.cluster.name + "-RouteTable"
|
||||
vpc: vpc
|
||||
}
|
||||
route := new ec2.Route {
|
||||
destinationCidrBlock: "0.0.0.0/0"
|
||||
internetGateway: gateway
|
||||
vpcGatewayAttachment: attachment
|
||||
routeTable: routes
|
||||
}
|
||||
|
||||
// Finally, create a sole security group to use for everything by default.
|
||||
group := new ec2.SecurityGroup {
|
||||
name: context.cluster.name + "-SecurityGroup"
|
||||
vpc: vpc
|
||||
groupDescription: "The primary cluster's security group."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
// Licensed to Pulumi Corporation ("Pulumi") under one or more
|
||||
// contributor license agreements. See the NOTICE file distributed with
|
||||
// this work for additional information regarding copyright ownership.
|
||||
// Pulumi licenses this file to You under the Apache License, Version 2.0
|
||||
// (the "License"); you may not use this file except in compliance with
|
||||
// the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// The available cloud operating systems.
|
||||
|
||||
// Amazon Web Services.
|
||||
export const AWS = "aws";
|
||||
// Google Cloud Platform.
|
||||
export const GCP = "gcp";
|
||||
// Microsoft Azure.
|
||||
export const Azure = "azure";
|
||||
// VMWare vSphere, etc.
|
||||
export const VMWare = "vmware";
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
// Licensed to Pulumi Corporation ("Pulumi") under one or more
|
||||
// contributor license agreements. See the NOTICE file distributed with
|
||||
// this work for additional information regarding copyright ownership.
|
||||
// Pulumi licenses this file to You under the Apache License, Version 2.0
|
||||
// (the "License"); you may not use this file except in compliance with
|
||||
// the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import * as lumi from "@lumi/lumi";
|
||||
import * as aws from "@lumi/aws";
|
||||
|
||||
// A base Mu cluster, ready to host stacks.
|
||||
export default class Cluster extends lumi.Stack {
|
||||
constructor(args: ClusterArgs) {
|
||||
super();
|
||||
|
||||
// TODO: support anonymous clusters (e.g., for local testing).
|
||||
// TODO: load cluster targeting information from other places:
|
||||
// 1) workspace settings (e.g., map keyed by cluster name).
|
||||
// 2) general configuration system (e.g., defaults).
|
||||
|
||||
switch(args.arch.cloud) {
|
||||
case "aws":
|
||||
this.createAWSCloudResources(args);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unrecognized/unimplemented cloud target: ${args.arch.cloud}`);
|
||||
}
|
||||
}
|
||||
|
||||
// This function creates all of the basic resources necessary for an AWS cluster ready to host Mu stacks.
|
||||
private createAWSCloudResources(args: ClusterArgs): void {
|
||||
// First set up a VPC with a single subnet.
|
||||
let cidr = "10.0.0.0/16";
|
||||
let vpc = new aws.ec2.VPC({ name: `${args.name}-VPC`, cidrBlock: cidr });
|
||||
let subnet = new aws.ec2.Subnet({ name: `${args.name}-Subnet`, vpc: vpc, cidrBlock: cidr });
|
||||
|
||||
// Now create an Internet-facing gateway to expose this cluster's subnet to Internet traffic.
|
||||
let internetGateway = new aws.ec2.InternetGateway({ name: `${args.name}-InternetGateway` });
|
||||
let vpcGatewayAttachment = new aws.ec2.VPCGatewayAttachment(
|
||||
{ internetGateway: internetGateway, vpc: vpc });
|
||||
let routeTable = new aws.ec2.RouteTable({ name: `${args.name}-RouteTable`, vpc: vpc });
|
||||
let route = new aws.ec2.Route({
|
||||
destinationCidrBlock: "0.0.0.0/0",
|
||||
internetGateway: internetGateway,
|
||||
vpcGatewayAttachment: vpcGatewayAttachment,
|
||||
routeTable: routeTable,
|
||||
});
|
||||
|
||||
// Finally, create a sole security group to use for everything by default.
|
||||
let securityGroup = new aws.ec2.SecurityGroup({
|
||||
name: `${args.name}-SecurityGroup`,
|
||||
vpc: vpc,
|
||||
groupDescription: "The primary cluster's security group.",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export interface ClusterArgs {
|
||||
name: string; // the cluster name.
|
||||
arch: Arch; // the required architecture to target.
|
||||
}
|
||||
|
||||
// Arch is the target cloud "architecture" to target. It combines a cloud IaaS provider with an optional
|
||||
// cloud CaaS container management/scheduling layer. All mu/x abstractions switch on these to do the right thing.
|
||||
export interface Arch {
|
||||
cloud: Cloud; // the cloud IaaS provider.
|
||||
scheduler?: Scheduler; // the optional cloud CaaS scheduler.
|
||||
}
|
||||
|
||||
// Cloud specifies a cloud infrastructure (IaaS) to target.
|
||||
export type Cloud =
|
||||
"aws" | // Amazon Web Services
|
||||
"gcp" | // Google Cloud Platform
|
||||
"azure" | // Microsoft Azure
|
||||
"vmware" // VMWare vSphere, etc.
|
||||
;
|
||||
|
||||
// Scheduler specifies a cloud container management/scheduling layer (CaaS) to target.
|
||||
export type Scheduler =
|
||||
"swarm" | // Docker Swarm
|
||||
"kubernetes" | // Kubernetes
|
||||
"mesos" | // Apache Mesos
|
||||
"awsecs" | // Amazon Elastic Container Service (only valid when targeting aws)
|
||||
"gcpgke" | // Google Container Engine (only valid when targeting gcp)
|
||||
"azurecs" // Microsoft Azure Container Service (only valid when targeting azure)
|
||||
;
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
name: lumix/cluster
|
||||
description: A base Lumi cluster, ready to host stacks.
|
||||
services:
|
||||
{{if eq .Arch.Cloud "aws"}}
|
||||
{{include "Nut_aws.yaml" | indent 4}}
|
||||
{{else}}
|
||||
{{panic "Unrecognized cloud target: %v" .Arch.Cloud}}
|
||||
{{end}}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
# This file contains a standard Mu cluster blueprint for AWS.
|
||||
|
||||
{{set "cidr" "10.0.0.0/16"}}
|
||||
|
||||
private:
|
||||
aws/ec2/vpc:
|
||||
name: {{.Cluster.Name}}-VPC
|
||||
cidrBlock: {{get "cidr"}}
|
||||
aws/ec2/subnet:
|
||||
name: {{.Cluster.Name}}-Subnet
|
||||
vpc: vpc
|
||||
cidrBlock: {{get "cidr"}}
|
||||
aws/ec2/internetGateway:
|
||||
name: {{.Cluster.Name}}-InternetGateway
|
||||
aws/ec2/vpcGatewayAttachment:
|
||||
internetGateway: internetGateway
|
||||
vpc: vpc
|
||||
aws/ec2/routeTable:
|
||||
name: {{.Cluster.Name}}-RouteTable
|
||||
vpc: vpc
|
||||
aws/ec2/route:
|
||||
destinationCidrBlock: 0.0.0.0/0
|
||||
internetGateway: internetGateway
|
||||
vpcGatewayAttachment: vpcGatewayAttachment
|
||||
routeTable: routeTable
|
||||
aws/ec2/securityGroup:
|
||||
name: {{.Cluster.Name}}-SecurityGroup
|
||||
vpc: vpc
|
||||
groupDescription: The primary cluster group.
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
name: lumix/container
|
||||
description: A Docker/LXC/Windows container.
|
||||
intrinsic: true
|
||||
properties:
|
||||
build:
|
||||
type: string
|
||||
description: A path to the Dockerfile, or its directory, to build; defaults to the current directory.
|
||||
optional: true
|
||||
args:
|
||||
type: map[string]any
|
||||
description: An optional map of arguments to pass to the Dockerfile during building.
|
||||
optional: true
|
||||
image:
|
||||
type: string
|
||||
description: An image name; if building, the container will be tagged; otherwise, this image will be used.
|
||||
optional: true
|
||||
command:
|
||||
type: string[]
|
||||
description: An optional command line to override the Dockerfile's default CMD.
|
||||
optional: true
|
||||
env:
|
||||
type: map[string]string
|
||||
description: An optional environment map for envvars to be set before building and running.
|
||||
optional: true
|
||||
services:
|
||||
{{if .Arch.Cloud eq "aws"}}
|
||||
{{if .Arch.Scheduler eq "ecs"}}
|
||||
{{include "Nut_aws_ecs.yaml"}}
|
||||
{{else if .Options.SkipCodegen == false}}
|
||||
{{panic "ECS scheduler is required for AWS containers; got %v" .Arch.Scheduler}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{panic "Unrecognized cloud target: %v" .Arch.Cloud}}
|
||||
{{end}}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# This file contains the projection of a container into an AWS ECS cluster.
|
||||
|
||||
public:
|
||||
self:
|
||||
type: aws/x/cf
|
||||
resource: "AWS::ECS::TaskDefinition"
|
||||
properties:
|
||||
containerDefinitions:
|
||||
- image: .image
|
||||
memory: 128
|
||||
name: .id
|
||||
command: .command
|
||||
environment: .env
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
name: lumix/event
|
||||
description: An event that may be used to trigger execution of another service.
|
||||
intrinsic: true
|
||||
properties:
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
name: lumix/func
|
||||
description: A single standalone function for serverless scenarios.
|
||||
intrinsic: true
|
||||
properties:
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
name: lumix/gateway
|
||||
description: An API gateway and load balancer, multiplexing requests over services.
|
||||
intrinsic: true
|
||||
properties:
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
// Licensed to Pulumi Corporation ("Pulumi") under one or more
|
||||
// contributor license agreements. See the NOTICE file distributed with
|
||||
// this work for additional information regarding copyright ownership.
|
||||
// Pulumi licenses this file to You under the Apache License, Version 2.0
|
||||
// (the "License"); you may not use this file except in compliance with
|
||||
// the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
export * from "./cluster";
|
||||
|
||||
import * as clouds from "./clouds";
|
||||
import * as schedulers from "./schedulers";
|
||||
export {clouds, schedulers};
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"name": "@lumi/lumix",
|
||||
"main": "bin/index.js",
|
||||
"typings": "bin/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^2.1.4"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
// Licensed to Pulumi Corporation ("Pulumi") under one or more
|
||||
// contributor license agreements. See the NOTICE file distributed with
|
||||
// this work for additional information regarding copyright ownership.
|
||||
// Pulumi licenses this file to You under the Apache License, Version 2.0
|
||||
// (the "License"); you may not use this file except in compliance with
|
||||
// the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// The available container scheduler/runtimes.
|
||||
|
||||
// Docker Swarm.
|
||||
export const Swarm = "swarm";
|
||||
// Kubernetes.
|
||||
export const Kubernetes = "kubernetes";
|
||||
// Apache Mesos.
|
||||
export const Mesos = "mesos";
|
||||
// Amazon Elastic Container Service (only valid for AWS clouds).
|
||||
export const ECS = "ecs";
|
||||
// Google Container Engine (only valid for GCP clouds).
|
||||
export const GKE = "gke";
|
||||
// Microsoft Azure Container Service (only valid for Azure).
|
||||
export const ACS = "acs";
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "bin",
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"stripInternal": true,
|
||||
"experimentalDecorators": true,
|
||||
"pretty": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"cluster.ts",
|
||||
"clouds/index.ts",
|
||||
"schedulers/index.ts"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
name: lumix/container
|
||||
description: A Docker container.
|
||||
intrinsic: true
|
||||
properties:
|
||||
|
Loading…
Reference in a new issue