Skip to content

Commit

Permalink
Rename Containerbuddy to ContainerPilot
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Apr 12, 2016
1 parent eb1b209 commit 3316dfc
Show file tree
Hide file tree
Showing 50 changed files with 188 additions and 188 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Contributing

Please report any issues you encounter with Containerbuddy or its documentation by opening a Github issue (https://github.com/joyent/containerbuddy/issues). Roadmap items will be maintained as [enhancements](https://github.com/joyent/containerbuddy/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement). PRs are welcome on any issue.
Please report any issues you encounter with ContainerPilot or its documentation by opening a Github issue (https://github.com/joyent/containerpilot/issues). Roadmap items will be maintained as [enhancements](https://github.com/joyent/containerpilot/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement). PRs are welcome on any issue.


Thanks to the following contributors:
- [@bbox-kula](https://github.com/bbox-kula): [first steps to allowing multiple discovery backends](https://github.com/joyent/containerbuddy/pull/4)
- [@bbox-kula](https://github.com/bbox-kula): [first steps to allowing multiple discovery backends](https://github.com/joyent/containerpilot/pull/4)
- [@justenwalker](https://github.com/justenwalker): hooks for preStop and postStop, deregistering services on SIGTERM, config templates, TravisCI integration, improved interface config parsing, and many many more code contributions.
- [@wleese](https://github.com/wleese): [support for CONSUL_HTTP_TOKEN auth](https://github.com/joyent/containerbuddy/pull/79)
- [@wleese](https://github.com/wleese): [support for CONSUL_HTTP_TOKEN auth](https://github.com/joyent/containerpilot/pull/79)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN go get github.com/golang/lint/golint \

ENV CGO_ENABLED 0
ENV GO15VENDOREXPERIMENT 1
ENV GOPATH /go:/cb
ENV GOPATH /go:/cp
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 41 additions & 41 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os/exec"

"github.com/joyent/containerbuddy/discovery"
"github.com/joyent/containerbuddy/utils"
"github.com/joyent/containerpilot/discovery"
"github.com/joyent/containerpilot/utils"
)

// Backend represents a command to execute when another application changes
Expand Down
2 changes: 1 addition & 1 deletion backends/backends_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/joyent/containerbuddy/utils"
"github.com/joyent/containerpilot/utils"
)

func TestOnChangeCmd(t *testing.T) {
Expand Down
18 changes: 9 additions & 9 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"strings"
"sync"

"github.com/joyent/containerbuddy/backends"
"github.com/joyent/containerbuddy/discovery"
"github.com/joyent/containerbuddy/services"
"github.com/joyent/containerbuddy/telemetry"
"github.com/joyent/containerbuddy/utils"
"github.com/joyent/containerpilot/backends"
"github.com/joyent/containerpilot/discovery"
"github.com/joyent/containerpilot/services"
"github.com/joyent/containerpilot/telemetry"
"github.com/joyent/containerpilot/utils"
)

var (
Expand All @@ -43,7 +43,7 @@ func GetConfig() *Config {
return globalConfig
}

// Config is the top-level Containerbuddy Configuration
// Config is the top-level ContainerPilot Configuration
type Config struct {
Consul string `json:"consul,omitempty"`
Etcd json.RawMessage `json:"etcd,omitempty"`
Expand Down Expand Up @@ -88,7 +88,7 @@ func LoadConfig() (*Config, error) {
os.Exit(0)
}
if configFlag == "" {
configFlag = os.Getenv("CONTAINERBUDDY")
configFlag = os.Getenv("CONTAINERPILOT")
}

if cfg, err := parseConfig(configFlag); err != nil {
Expand All @@ -112,12 +112,12 @@ func initializeConfig(cfg *Config) (*Config, error) {

// onStart has been deprecated for preStart. Remove in 2.0
if cfg.PreStart != nil && cfg.OnStart != nil {
fmt.Println("The onStart option has been deprecated in favor of preStart. Containerbuddy will use only the preStart option provided")
fmt.Println("The onStart option has been deprecated in favor of preStart. ContainerPilot will use only the preStart option provided")
}

// alias the onStart behavior to preStart
if cfg.PreStart == nil && cfg.OnStart != nil {
fmt.Println("The onStart option has been deprecated in favor of preStart. Containerbuddy will use the onStart option as a preStart")
fmt.Println("The onStart option has been deprecated in favor of preStart. ContainerPilot will use the onStart option as a preStart")
cfg.PreStart = cfg.OnStart
}

Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestMetricServiceCreation(t *testing.T) {
t.Errorf("Expected telemetry service but got %v", config.Services)
} else {
service := config.Services[0]
if service.Name != "containerbuddy" {
if service.Name != "containerpilot" {
t.Errorf("Got incorrect service back: %v", service)
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestLoggingBootstrap(t *testing.T) {
t.Errorf("Expected output to Stdout")
}
if _, ok := std.Formatter.(*DefaultLogFormatter); !ok {
t.Errorf("Expected *containerbuddy.DefaultLogFormatter got: %v", reflect.TypeOf(std.Formatter))
t.Errorf("Expected *containerpilot.DefaultLogFormatter got: %v", reflect.TypeOf(std.Formatter))
}
}

Expand Down
2 changes: 1 addition & 1 deletion config/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestParseEnvironment(t *testing.T) {
}

func TestTemplate(t *testing.T) {
env := parseEnvironment([]string{"NAME=Template", "USER=buddy"})
env := parseEnvironment([]string{"NAME=Template", "USER=pilot"})
validateTemplate(t, "One var", `Hello, {{.NAME}}!`, env, "Hello, Template!")
validateTemplate(t, "Var undefined", `Hello, {{.NONAME}}!`, env, "Hello, !")
validateTemplate(t, "Default", `Hello, {{.NONAME | default "World" }}!`, env, "Hello, World!")
Expand Down
2 changes: 1 addition & 1 deletion core/poll.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core

import (
"github.com/joyent/containerbuddy/config"
"github.com/joyent/containerpilot/config"
"time"
)

Expand Down
6 changes: 3 additions & 3 deletions core/signals.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"time"

log "github.com/Sirupsen/logrus"
"github.com/joyent/containerbuddy/config"
"github.com/joyent/containerbuddy/services"
"github.com/joyent/containerbuddy/utils"
"github.com/joyent/containerpilot/config"
"github.com/joyent/containerpilot/services"
"github.com/joyent/containerpilot/utils"
)

// globals are eeeeevil
Expand Down
8 changes: 4 additions & 4 deletions core/signals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"testing"
"time"

"github.com/joyent/containerbuddy/config"
"github.com/joyent/containerbuddy/discovery"
"github.com/joyent/containerbuddy/services"
"github.com/joyent/containerbuddy/utils"
"github.com/joyent/containerpilot/config"
"github.com/joyent/containerpilot/discovery"
"github.com/joyent/containerpilot/services"
"github.com/joyent/containerpilot/utils"
)

// ------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion discovery/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *Consul) registerCheck(service ServiceDefinition) error {
&consul.AgentCheckRegistration{
ID: service.ID,
Name: service.ID,
Notes: fmt.Sprintf("TTL for %s set by containerbuddy", service.Name),
Notes: fmt.Sprintf("TTL for %s set by containerpilot", service.Name),
ServiceID: service.ID,
AgentServiceCheck: consul.AgentServiceCheck{
TTL: fmt.Sprintf("%ds", service.TTL),
Expand Down
2 changes: 1 addition & 1 deletion discovery/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func parseEndpoints(raw json.RawMessage) []string {
// NewEtcdConfig creates a new service discovery backend for etcd
func NewEtcdConfig(config json.RawMessage) Etcd {
etcd := Etcd{
Prefix: "/containerbuddy",
Prefix: "/containerpilot",
}
var rawConfig etcdRawConfig
etcdConfig := client.Config{}
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Fixtures Directory: `integration_tests/fixtures`

- Folders in the fixtures directory will be built as docker images in alphabetical order
- Each folder should contain a `Dockerfile` and any resources necessary to build the image
- The resulting image will be named `cbfix_fixture_name`
- The resulting image will be named `cpfix_fixture_name`

*Note*: Since fixtures are created in alpha order, they can have FROM directives for previously created images

Expand All @@ -42,7 +42,7 @@ This script can make some assumptions:
- `COMPOSE_FILE`
- `COMPOSE_PROJECT_NAME` - The name of the test folder
- `DOCKER_IP` - The IP of docker on the host machine
- `CONTAINERBUDDY_BIN` - Absolute path to containerbuddy binary on the host.
- `CONTAINERPILOT_BIN` - Absolute path to containerpilot binary on the host.
- all fixtures in `integration_tests/fixtures` are created and are available as images

## How tests are executed
Expand All @@ -52,7 +52,7 @@ This script can make some assumptions:
- For each fixture:
- Copy `build` into `integration_test/fixtures/fixture_name/build` so it can easily be sourced by the `Dockerfile`
- `cd integration_tests/fixtures/fixture_name`
- `docker build -t cbfix_fixture_name .`
- `docker build -t cpfix_fixture_name .`

### Run tests
- Scan through all folders in `integration_tests/tests` in alpha order
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/fixtures/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ RUN apt-get update && \

RUN npm install -g json http-server

COPY build/containerbuddy /bin/containerbuddy
COPY build/containerpilot /bin/containerpilot
COPY app-with-consul.json /app-with-consul.json
COPY app-with-etcd.json /app-with-etcd.json
COPY reload-app.sh /reload-app.sh
COPY reload-app-etcd.sh /reload-app-etcd.sh
COPY sensor.sh /sensor.sh

# by default use app-consul.json, allows for override in docker-compose
ENV CONTAINERBUDDY=file:///app-with-consul.json
ENV CONTAINERPILOT=file:///app-with-consul.json

ENTRYPOINT [ "/bin/containerbuddy", \
ENTRYPOINT [ "/bin/containerpilot", \
"/usr/local/bin/node", \
"/usr/local/bin/http-server", "/srv", "-p", "8000"]
2 changes: 1 addition & 1 deletion integration_tests/fixtures/app/app-with-consul.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"port": 9090,
"sensors": [
{
"namespace": "containerbuddy",
"namespace": "containerpilot",
"subsystem": "app",
"name": "some_counter",
"help": "help text",
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/fixtures/app/app-with-etcd.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"etcd":{
"endpoints": "http://etcd:4001",
"prefix": "/containerbuddy"
"prefix": "/containerpilot"
},
"preStart": "/reload-app-etcd.sh",
"services": [
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/fixtures/app/reload-app-etcd.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/bash

# get all the healthy application servers and write the json to file
curl -s etcd:4001/v2/keys/containerbuddy/app | json > /tmp/lastQuery.json
curl -s etcd:4001/v2/keys/containerpilot/app | json > /tmp/lastQuery.json

cat <<EOF > /srv/index.html
<html>
<head>
<title>Containerbuddy Demo</title>
<title>ContainerPilot Demo</title>
<script>
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
</head>
<body onload="JavaScript:timedRefresh(5000);">
<h1>Containerbuddy Demo</h1>
<h1>ContainerPilot Demo</h1>
<h2>This page served by app server: $(hostname)</h2>
Last service health check changed at $(date):
<pre>
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/fixtures/app/reload-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ curl -s consul:8500/v1/health/service/app?passing | json > /tmp/lastQuery.json
cat <<EOF > /srv/index.html
<html>
<head>
<title>Containerbuddy Demo</title>
<title>ContainerPilot Demo</title>
<script>
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
</head>
<body onload="JavaScript:timedRefresh(5000);">
<h1>Containerbuddy Demo</h1>
<h1>ContainerPilot Demo</h1>
<h2>This page served by app server: $(hostname)</h2>
Last service health check changed at $(date):
<pre>
Expand Down
10 changes: 5 additions & 5 deletions integration_tests/fixtures/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nginx container including Containerbuddy
# Nginx container including ContainerPilot
FROM alpine:3.3

# install nginx and tooling we need
Expand All @@ -17,14 +17,14 @@ RUN curl -Lo /tmp/consul_template_0.11.0_linux_amd64.zip https://github.com/hash
RUN curl -Lo /bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.11.0/confd-0.11.0-linux-amd64 && \
chmod 755 /bin/confd

# add Containerbuddy build and configuration
COPY build/containerbuddy /bin/containerbuddy
# add ContainerPilot build and configuration
COPY build/containerpilot /bin/containerpilot
COPY etc /etc

EXPOSE 80

# by default use nginx-with-consul.json, allows for override in docker-compose
ENV CONTAINERBUDDY=file:///etc/nginx-with-consul.json
ENV CONTAINERPILOT=file:///etc/nginx-with-consul.json

ENTRYPOINT [ "/bin/containerbuddy", \
ENTRYPOINT [ "/bin/containerpilot", \
"nginx", "-g", "daemon off;"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = "nginx-etcd.tmpl"
dest = "/etc/nginx/nginx.conf"
owner = "nginx"
prefix = "/containerbuddy"
prefix = "/containerpilot"
mode = "0644"
keys = [
"/app"
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/fixtures/nginx/etc/nginx-with-etcd.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"etcd":{
"endpoints": "http://etcd:4001",
"prefix": "/containerbuddy"
"prefix": "/containerpilot"
},
"services": [
{
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/fixtures/test_probe/src/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewEtcdProbe() (EtcdProbe, error) {
return nil, err
}
kapi := etcd.NewKeysAPI(client)
return EtcdProbe(etcdClient{Client: client, API: kapi, Prefix: "/containerbuddy"}), nil
return EtcdProbe(etcdClient{Client: client, API: kapi, Prefix: "/containerpilot"}), nil
}

// WaitForServices waits for the healthy services count to equal the count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
)

// TestDiscovery tests that Containerbuddy registers all services and that
// TestDiscovery tests that ContainerPilot registers all services and that
// Nginx has a working route to App
func TestDiscovery(args []string) bool {

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/fixtures/test_probe/src/test_sigterm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "log"

// TestSigterm tests that containerbuddy will deregister the service on a SIGTERM
// TestSigterm tests that containerpilot will deregister the service on a SIGTERM
func TestSigterm(args []string) bool {
if len(args) != 1 {
log.Println("TestSigterm requires 1 argument")
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/fixtures/zombie_maker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM alpine:3.3

ADD build/containerbuddy /bin/containerbuddy
ADD build/containerpilot /bin/containerpilot
ADD app.json /app.json

ADD zombie.sh /zombie.sh
RUN chmod 755 /zombie.sh

ENTRYPOINT [\
"/bin/containerbuddy","-config=file:///app.json",\
"/bin/containerpilot","-config=file:///app.json",\
"tail","-f"]
Loading

0 comments on commit 3316dfc

Please sign in to comment.