Code Monkey home page Code Monkey logo

porter's Introduction

CNCF Sandbox Project porter

Porter

Package your application, client tools, configuration, and deployment logic into an installer that you can distribute and run with a single command. Based on the Cloud Native Application Bundle Specification, CNAB, Porter provides a declarative authoring experience that lets you focus on what you know best: your application.

Learn all about Porter at porter.sh

Porter Mixins

Mixins provide out-of-the-box support for interacting with different tools and services from inside a bundle. You can always create a mixin, or use the exec mixin and a Custom Dockerfile if a custom mixin doesn't exist yet.

Porter Mixins are available for below platform's:

Platform Supported?
Docker ✔️
Docker-Compose ✔️
Kubernetes ✔️
Helm ✔️
GCloud ✔️
Terraform ✔️
aws ✔️
Azure ✔️
exec ✔️

Porter Plugins

Plugins let you store Porter's data and retrieve secrets from an external service.

Porter Plugins are available for below platform's:

Platform Supported?
Hashicorp ✔️
Azure ✔️
Kubernetes ✔️

Contact

  • Mailing List - Great for following the project at a high level because it is low traffic, mostly release notes and blog posts on new features.
  • Forum - Share an idea or propose a design where everyone can benefit from the discussion and find answers to questions later.
  • Dev Meeting - Biweekly meeting where we discuss Porter Enhancement Proposals, demo new features and help other contributors.
  • Open an Issue - If you are having trouble or found a bug, ask on GitHub so that we can prioritize it and make sure you get an answer.
  • Slack - We have a #porter channel and there's also #cnab for deep thoughts about the CNAB specification.

Looking for Contributors

Want to work on Porter with us? 💖 We are actively seeking out new contributors with the hopes of building up both casual contributors and enticing some of you into becoming reviewers and maintainers.

Start with our New Contributors Guide

Porter wouldn't be possible without our contributors, carrying the load and making it better every day! 🙇‍♀️

Do you use Porter?

Take our user survey and let us know if you are using Porter. Project funding is contingent upon knowing that we have active users!

Roadmap

Porter is an open-source project and things get done as quickly as we have motivated contributors working on features that interest them. 😉

We use a single project board across all of our repositories to track open issues and pull requests.

The roadmap represents what the maintainers have said that they are currently working on and plan to work on over the next few months. We use the "on-hold" bucket to communicate items of interest that do not have a maintainer who will be working on them.

Check out our roadmap

porter's People

Contributors

agmeteor avatar arhell avatar bdegeeter avatar carolynvs avatar carolynvs-msft avatar dark-art108 avatar dependabot[bot] avatar dev-drprasad avatar flynnduism avatar gaurimadhok avatar hrittikhere avatar iennae avatar jarnfast avatar jemgoss avatar jeremyrickard avatar joshuabezaleel avatar kichristensen avatar ludfjig avatar mchorfa avatar reveurguy avatar schristoff avatar sgettys avatar simongdavies avatar simpcyclassy avatar tchaudhry91 avatar thorstenhans avatar tompaana avatar troy0820 avatar vdice avatar vinozzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

porter's Issues

Support other markup languages beyond yaml

The porter configuration file (porter.yaml) could really be in any markup language, and should be up to the bundle author to select. There isn't anything stopping us from having everyone use a different language.

Let's switch to viper for reading in that file so that @radu-matei can use HCL.

Implement exec mixin runtime

we always look for a source leaf node - and plug in the real values

$ mixin-runtime install -- STDIN
name: parsed name
command: bash -c "Hello, $CNAB_P_NAME"
parameters:
name: susie

Draft CNAB authoring spec

  • Write a draft of a CNAB Authoring Spec based on porter.
  • Define the goal of having an authoring spec, what does having a spec help us accomplish.
  • Identify key elements from porter that would be necessary for other authoring tools to adhere to in order for them to work together. For example being able to author a bundle that depends upon another bundle that was authored with a different tool. (Not sure if this should be in scope?)

generate run command

  • porter run porter.yaml
  • figure out the action
  • running the steps for each action, calling to the mixin-runtime
    • porter-runtime needs to check the exit code from the mixin and stop if necessary
    • porter-runtime needs to include the mixin's stderr in our stderr
    • mixin runs in a separate process (not exec'd)
    • porter-runtime echoing out the step description

Add declarative referenced images to porter manifest

An important part of the CNAB spec is the use of referenced images. We need to have a way to handle this with Porter. It would be nice for the mixins to be able to report what they will use at bundle generation time per #70 , however in the interim we can make this a declarative feature and include it in the porter manifest.

Improve mixin installation

$ porter mixin install NAME --url URL [--version VERSION]
# Adds an entry for the mixin to the porter config
# copies $(URL)/latest/name to ~/.porter/mixins/NAME

$ porter mixin upgrade NAME [--version VERSION]
# uses the porter config to find the URL
# copies $(URL)/$(VERSION)/name to the mixin dir

$ porter mixin delete NAME
# remote the entry from the config
# deletes the mixin dir

E2E test Test

Once we have build and run, let's add a simple end to end test to our CI (essentially expanding on the test that is already there for porter run) so that it follows our workflow and tries out all the pieces)

  • porter init
  • porter build
  • docker push
  • duffle install

helm mixin should output the service urls/names

When I use the mysql helm chart, the host isn't one of the outputs (in the secrets). If the helm mixin made the services available in the outputs, I could piece together the proper host connection string.

Wire parameters and credentials from the bundle into the mixin

install:
  - description: "Install Wordpress Helm Chart"
    helm:
      name:
        source: bundle.name
      chart: stable/wordpress
      parameters:
        externalDatabase.database:
          source: bundle.parameters.database-name
        externalDatabase.host:
          source: bundle.credentials.dbhost
        externalDatabase.user:
          source: bundle.credentials.dbuser
        externalDatabase.password:
          source: bundle.credentials.dbpassword

Design: Dependency Graph Traversal

Currently we only resolve dependencies down a single level. Eventually more complicated bundles will want to have dependencies that have dependencies too. Resolve and apply them from the bottom up.

Porter `init` should setup porter environment

porter should have a command like init that sets up your "Porter Home" with cross compiled binaries for porter and the mixins to support building invocation images.

For example, I download the Windows porter binary. porter init should create a directory structure under %HOME%/.porter/ and %HOME%/.porter/mixins with appropriate cross platform binaries. These will be used to populate the Docker invocation images when created.

porter build

  • read the porter.yaml, pick the mixins (DONE)

  • make the dockerfile, entrypoint must be /cnab/app/run (DONE)

  • put in the FROM (DONE)

  • copy in porter.yaml + run (DONE)

  • call the mixin's, let them add more stuff

  • pick a FROM

    • start with debian: for POC (DONE)
    • pare it down (eventually it's configurable)
  • add the porter binary (DONE-ish)

    • exec mixin (standalone executable + stuff) (DONE-ish)
    • /porter/bin/porter-runtime (DOEN-ish)
    • /porter/mixins/NAME/mixin-runtime (assume executable is named mixin) (DONE-ish)

Azure Mixin

Implement an Azure mixin that is capable of provisioning a CosmosDB suitable for the MySQL + Wordpress example.

Don't print help text for runtime errors

We should handle our errors in the main cobra cli wiring of cmd/porter so that help text isn't printed for every error, just cli validation errors.

GOT

duffle install PORTER-HELLO -f bundle.json --insecure
Executing install action...
executing porter install configuration from /cnab/app/porter.yaml
Install Hello World
Hello World
Try Helm
Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp 127.0.0.1:8080: connect: connection refused
Error: exit status 1
err: exit status 1
Usage:
  helm install [flags]

Flags:
  -h, --help   help for install

Error: mixin execution failed: exit status 1
Usage:
  porter run [flags]

Flags:
      --action string   The bundle action to execute (Defaults to CNAB_ACTION)
  -f, --file string     The porter configuration file (Defaults to porter.yaml) (default "porter.yaml")
  -h, --help            help for run

Global Flags:
      --debug   Enable debug logging

WANT

duffle install PORTER-HELLO -f bundle.json --insecure
Executing install action...
executing porter install configuration from /cnab/app/porter.yaml
Install Hello World
Hello World
Try Helm
Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp 127.0.0.1:8080: connect: connection refused
Error: mixin execution failed: exit status 1

Document mixin architecture

  • azure and helm mixins initially
  • build time mixin (handles copying stuff into the invocation image)
  • runtime mixin (handles executing instructions from the porter.yaml)

Create skeleton Porter CLI

Create the skeleton Porter CLI:

  • porter init - makes porter.yaml
  • porter build - (re)generate Dockerfile
  • porter version - Prints Ralpha 0.1

Make additional bundle metadata available to template

Right now the porter manifest lets a bundle author template out values for certain things, bundle.parameters.NAME, bundle.credentials.NAME, etc.

But metadata about the bundle can't be substituted in yet. I would like to be able to do something like this in my porter manifest:

bundle.name

We have a view pieces of information in our bundle metadata that would be nice to make available:

  • Name
  • Description
  • Version
  • Image

It may help you when you implement this to move those fields into a new embedded struct on the Manifest. If you need to do that, feel free.

This is the function that would need to be modified:
https://github.com/deislabs/porter/blob/9eed13889d855c5665c42b9b4b2ac8153a8feae4/pkg/config/manifest.go#L647

That would let someone use bundle.*

There is another function

https://github.com/deislabs/porter/blob/9eed13889d855c5665c42b9b4b2ac8153a8feae4/pkg/config/manifest.go#L83

That lets someone use bundle.dependencies.NAME.*, for example to access metadata about one of their dependencies, bundle.dependencies.mysql.version.

It would be nice (though not required), if both were updated.

See https://porter.sh/authoring-bundles/ for more context on the porter manifest.

Create the run script if it doesn't exist on build

The run script is created at porter create but really it's a boring file that we don't encourage people to modify. Let's make it so that if its not present during porter build, we recreate it for them. That way you can just check in the run script if you modified it.

Make the FROM configurable

When a Dockerfile is in the bundle directory, porter will use that as the base, instead of starting from our template, and then layer its new lines on top of that. When you provide your own Dockerfile, then it is your own responsibility to take care of ca certificates and generally have a working base image.

If all you care about is setting the base image, but don't want to customize it further, like copying in extra files, then you can do that in the porter config file

Update: Turns out what I originally suggested wouldn't work. So instead I added a new field to the manifest dockerfile so the user can specify a custom Dockerfile template.

Rename the current `init` command

We should rename the new init command to allow init to be used to setup porter for the first time.

New command could be something like porter create or porter new.

Define bundle dependencies

This just populates the bundle dependencies section, and then merges the porter.yaml's together when building the image. Wiring the dependencies is another issue.

Helm Mixin

Implement a mixin for helm charts

  • Buildtime
  • Runtime
  • Support common helm install flags
    • namespace
    • version
    • set
    • replace
    • values

Pipe mixin output through porter run

Right now the mixin output isn't piped, so it always prints to stdout/stderr. It needs to be piped back through into our stdout/stderr, so that when we are running in a docker container that it is being logged appropriately.

porter.sh

Host our docs site on porter.sh. Cute landing page encouraged! 🚀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.