npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

orchestration

v0.2.27

Published

Orchestration is a set of utilities for Gulp that help you build and deploy versioned containers into clusters on cloud providers.

Downloads

46

Readme

Orchestration

Orchestration is a set of utilities for Gulp that help you build and deploy versioned containers into clusters on cloud providers.

Orchestration is not specific to Node.js; you can use these Gulp tasks to deploy containers for any kind of service, written in any kind of language.

Modules

Orchestration is divided into multiple NPM modules, each of which you can npm install --save-dev to install:

Orchestration also provides several utility modules:

Configuration

Configuring your app

You need to have package.json in your app. The name and version of package.json will be used for deployment.

Configuring your app's deployment

Create an orchestration.json file, which describes the files to include and the services that your application exposes:

{
  "services": {
    "development": [],
    "production": [
      {
        "type": "LoadBalancer",
        /* The external IP of the load balancer; reserve a static IP in your GCP console */
        "ipAddress": "1.1.1.1",
        "protocol": "TCP",
        /* Unique name for the exposed service in your cluster */
        "name": "my-service",
        "containerPort": 8080,
        "publicPort": 80
      }
    ]
  },
  "files": [
    /* Will be used in a future version, lists the files in your
       app to copy to a Docker container */
    "folder",
    "file",
    { "env": "environment-name", "name": "environment-specific-file" },
  ]
}

Configuring your cluster

Create a cluster.json file, which describes the target cluster on Google Cloud:

{
  /* Type of deployment, only Kubernetes on Google Cloud is supported for now */
  "type": "google-cloud-kubernetes",
  /* List of side-by-side deployment environments to support */
  "environments": {
    "development": {
      /* The GCP project for this environment */
      "project": "example-dev",
      /* The name of the GCP cluster for this environment */
      "clusterName": "example-dev",
      /* The zone of the GCP cluster for this environment */
      "clusterZone": "us-central1-f",
      /* The Docker image prefix to use for this environment */
      "dockerImagePrefix": "gcr.io/example-dev/"
    },
    "production": {
      "project": "example",
      "clusterName": "example",
      "clusterZone": "us-central1-f",
      "dockerImagePrefix": "gcr.io/example/"
    }
  }
}

The AWS CloudFormation provider makes use of CloudFormation templates, and does not use cluster.json.

Usage

var configuration = require('orchestration-configuration');
var swagger = require('orchestration-swagger');
var docker = require('orchestration-docker');
var node = require('orchestration-node');
var kubernetes = require('orchestration-kubernetes');

// IMPORTANT: Don't forget to add this line to your Gulp file!
var config = configuration.getConfiguration();

// e.g. to generate sdks based on presence of .json files in sdks/ folder:
gulp.task('swagger-sdks', function(callback) {
  swagger.generateAllSdks(callback);
});

// e.g. to build a Docker container from the current folder:
gulp.task('build-docker', function(callback) {
  // targets the 'development' environment
  docker.build(config, 'development', callback);
});

// e.g. to run your Node.js app from within a Docker container:
gulp.task('test-docker', ['build-docker'], function(callback) {
  // test in dev with 8080 mapped to 8001
  // targets the 'development' environment
  docker.testLocal(config, 'development', { 8001: 8080 }, callback);
});

// e.g. to run your Node.js app on your host machine:
gulp.task('test-host', ['build'], function(callback) {
  node.test(callback);
});

// e.g. to deploy your Node.js app to a Kubernetes cluster in Google Cloud
gulp.task('deploy-prod', ['push-docker-prod'], function(callback) {
  // targets the 'production' environment
  kubernetes.deployToCluster(config, 'production', callback);
});

More functionality and examples coming soon.