From 38f7cc60c41fc961b1a643dee55cd8aa42c568bb Mon Sep 17 00:00:00 2001 From: Bill Farner Date: Tue, 15 Nov 2016 11:25:03 -0800 Subject: [PATCH] Move sources to a top-level pkg/ directory Signed-off-by: Bill Farner --- README.md | 54 +++++++----------- cmd/cli/flavor.go | 10 ++-- cmd/cli/group.go | 6 +- cmd/cli/instance.go | 6 +- cmd/cli/main.go | 4 +- cmd/cli/plugin.go | 2 +- cmd/group/main.go | 16 +++--- cmd/manager/main.go | 12 ++-- cmd/manager/os.go | 6 +- cmd/manager/swarm.go | 8 +-- {images => docs/images}/arch.png | Bin docs/tutorial.md | 4 +- {cli => pkg/cli}/logging.go | 0 {cli => pkg/cli}/serverutil.go | 4 +- {cli => pkg/cli}/version.go | 0 {discovery => pkg/discovery}/dir.go | 2 +- {discovery => pkg/discovery}/dir_test.go | 4 +- {discovery => pkg/discovery}/discovery.go | 2 +- .../dockerfiles}/Dockerfile.build | 0 .../example}/flavor/combo/README.md | 2 +- .../example}/flavor/combo/example.json | 0 .../example}/flavor/combo/flavor.go | 8 +-- .../example}/flavor/combo/flavor_test.go | 10 ++-- {example => pkg/example}/flavor/combo/main.go | 8 +-- .../example}/flavor/swarm/README.md | 4 +- {example => pkg/example}/flavor/swarm/main.go | 8 +-- .../flavor/swarm/swarm-vagrant-manager.json | 0 .../flavor/swarm/swarm-vagrant-workers.json | 0 .../example}/flavor/vanilla/README.md | 2 +- .../example}/flavor/vanilla/example.json | 0 .../example}/flavor/vanilla/main.go | 6 +- .../example}/flavor/zookeeper/README.md | 6 +- .../example}/flavor/zookeeper/main.go | 6 +- .../zookeeper/vagrant-zk-docker-registry.json | 0 .../flavor/zookeeper/vagrant-zk-docker.json | 0 .../example}/flavor/zookeeper/vagrant-zk.json | 0 .../example}/instance/file/README.md | 6 +- .../example}/instance/file/main.go | 4 +- .../example}/instance/file/plugin.go | 2 +- .../example}/instance/terraform/README.md | 14 ++--- .../terraform/aws-two-tier/group.json | 0 .../instance-plugin-properties.json | 0 .../aws-two-tier/instance-plugin-spec.json | 0 .../instance/terraform/aws-two-tier/main.tf | 0 .../terraform/aws-two-tier/variables.tf | 0 .../instance/terraform/cattle_demo.md | 0 .../example}/instance/terraform/example.png | Bin .../example}/instance/terraform/images/1.png | Bin .../example}/instance/terraform/images/2.png | Bin .../example}/instance/terraform/main.go | 4 +- .../example}/instance/terraform/plugin.go | 2 +- .../instance/terraform/terminated.png | Bin .../example}/instance/vagrant/main.go | 6 +- {leader => pkg/leader}/file/file.go | 2 +- {leader => pkg/leader}/file/file_test.go | 2 +- {leader => pkg/leader}/leader.go | 0 {leader => pkg/leader}/poller.go | 0 {leader => pkg/leader}/poller_test.go | 0 {leader => pkg/leader}/swarm/swarm.go | 2 +- {leader => pkg/leader}/swarm/swarm_test.go | 4 +- {manager => pkg/manager}/group_plugin_impl.go | 4 +- {manager => pkg/manager}/manager.go | 10 ++-- {manager => pkg/manager}/spec.go | 2 +- .../mock}/docker/docker/client/api.go | 0 {mock => pkg/mock}/generate.go | 0 {mock => pkg/mock}/plugin/group/group.go | 4 +- {mock => pkg/mock}/spi/flavor/flavor.go | 6 +- {mock => pkg/mock}/spi/instance/instance.go | 2 +- {plugin => pkg/plugin}/flavor/swarm/flavor.go | 8 +-- .../plugin}/flavor/swarm/flavor_test.go | 8 +-- .../plugin}/flavor/vanilla/flavor.go | 6 +- .../plugin}/flavor/zookeeper/flavor.go | 6 +- {plugin => pkg/plugin}/group/README.md | 0 {plugin => pkg/plugin}/group/group.go | 8 +-- .../plugin}/group/integration_test.go | 8 +-- {plugin => pkg/plugin}/group/quorum.go | 2 +- {plugin => pkg/plugin}/group/quorum_test.go | 4 +- {plugin => pkg/plugin}/group/rollingupdate.go | 4 +- {plugin => pkg/plugin}/group/scaled.go | 6 +- {plugin => pkg/plugin}/group/scaler.go | 2 +- {plugin => pkg/plugin}/group/scaler_test.go | 4 +- {plugin => pkg/plugin}/group/state.go | 10 ++-- {plugin => pkg/plugin}/group/testplugin.go | 8 +-- {plugin => pkg/plugin}/group/types/types.go | 4 +- .../plugin}/group/types/types_test.go | 0 .../plugin}/group/util/randstring.go | 0 {plugin => pkg/plugin}/group/util/runstop.go | 0 .../plugin}/instance/vagrant/instance.go | 2 +- {plugin => pkg/plugin}/plugin.go | 0 {rpc => pkg/rpc}/client/client.go | 0 {rpc => pkg/rpc}/flavor/client.go | 8 +-- {rpc => pkg/rpc}/flavor/rpc_test.go | 8 +-- {rpc => pkg/rpc}/flavor/service.go | 2 +- {rpc => pkg/rpc}/flavor/types.go | 6 +- {rpc => pkg/rpc}/group/client.go | 4 +- {rpc => pkg/rpc}/group/rpc_test.go | 6 +- {rpc => pkg/rpc}/group/service.go | 2 +- {rpc => pkg/rpc}/group/types.go | 2 +- {rpc => pkg/rpc}/instance/client.go | 4 +- {rpc => pkg/rpc}/instance/rpc_test.go | 4 +- {rpc => pkg/rpc}/instance/service.go | 2 +- {rpc => pkg/rpc}/instance/types.go | 2 +- {rpc => pkg/rpc}/server/server.go | 0 {rpc => pkg/rpc}/server/server_test.go | 6 +- {spi => pkg/spi}/flavor/spi.go | 4 +- {spi => pkg/spi}/group/spi.go | 2 +- {spi => pkg/spi}/instance/spi.go | 0 {spi => pkg/spi}/instance/types.go | 0 {store => pkg/store}/README.md | 0 {store => pkg/store}/file/file.go | 2 +- {store => pkg/store}/store.go | 0 {store => pkg/store}/swarm/swarm.go | 2 +- {store => pkg/store}/swarm/swarm_test.go | 0 {util => pkg/util}/docker/1.24/docker.go | 0 templates/vagrant.tmpl | 18 ------ 115 files changed, 211 insertions(+), 239 deletions(-) rename {images => docs/images}/arch.png (100%) rename {cli => pkg/cli}/logging.go (100%) rename {cli => pkg/cli}/serverutil.go (83%) rename {cli => pkg/cli}/version.go (100%) rename {discovery => pkg/discovery}/dir.go (97%) rename {discovery => pkg/discovery}/dir_test.go (93%) rename {discovery => pkg/discovery}/discovery.go (97%) rename {dockerfiles => pkg/dockerfiles}/Dockerfile.build (100%) rename {example => pkg/example}/flavor/combo/README.md (95%) rename {example => pkg/example}/flavor/combo/example.json (100%) rename {example => pkg/example}/flavor/combo/flavor.go (95%) rename {example => pkg/example}/flavor/combo/flavor_test.go (94%) rename {example => pkg/example}/flavor/combo/main.go (85%) rename {example => pkg/example}/flavor/swarm/README.md (93%) rename {example => pkg/example}/flavor/swarm/main.go (87%) rename {example => pkg/example}/flavor/swarm/swarm-vagrant-manager.json (100%) rename {example => pkg/example}/flavor/swarm/swarm-vagrant-workers.json (100%) rename {example => pkg/example}/flavor/vanilla/README.md (96%) rename {example => pkg/example}/flavor/vanilla/example.json (100%) rename {example => pkg/example}/flavor/vanilla/main.go (82%) rename {example => pkg/example}/flavor/zookeeper/README.md (82%) rename {example => pkg/example}/flavor/zookeeper/main.go (81%) rename {example => pkg/example}/flavor/zookeeper/vagrant-zk-docker-registry.json (100%) rename {example => pkg/example}/flavor/zookeeper/vagrant-zk-docker.json (100%) rename {example => pkg/example}/flavor/zookeeper/vagrant-zk.json (100%) rename {example => pkg/example}/instance/file/README.md (78%) rename {example => pkg/example}/instance/file/main.go (88%) rename {example => pkg/example}/instance/file/plugin.go (98%) rename {example => pkg/example}/instance/terraform/README.md (93%) rename {example => pkg/example}/instance/terraform/aws-two-tier/group.json (100%) rename {example => pkg/example}/instance/terraform/aws-two-tier/instance-plugin-properties.json (100%) rename {example => pkg/example}/instance/terraform/aws-two-tier/instance-plugin-spec.json (100%) rename {example => pkg/example}/instance/terraform/aws-two-tier/main.tf (100%) rename {example => pkg/example}/instance/terraform/aws-two-tier/variables.tf (100%) rename {example => pkg/example}/instance/terraform/cattle_demo.md (100%) rename {example => pkg/example}/instance/terraform/example.png (100%) rename {example => pkg/example}/instance/terraform/images/1.png (100%) rename {example => pkg/example}/instance/terraform/images/2.png (100%) rename {example => pkg/example}/instance/terraform/main.go (91%) rename {example => pkg/example}/instance/terraform/plugin.go (99%) rename {example => pkg/example}/instance/terraform/terminated.png (100%) rename {example => pkg/example}/instance/vagrant/main.go (88%) rename {leader => pkg/leader}/file/file.go (95%) rename {leader => pkg/leader}/file/file_test.go (97%) rename {leader => pkg/leader}/leader.go (100%) rename {leader => pkg/leader}/poller.go (100%) rename {leader => pkg/leader}/poller_test.go (100%) rename {leader => pkg/leader}/swarm/swarm.go (95%) rename {leader => pkg/leader}/swarm/swarm_test.go (90%) rename {manager => pkg/manager}/group_plugin_impl.go (95%) rename {manager => pkg/manager}/manager.go (97%) rename {manager => pkg/manager}/spec.go (89%) rename {mock => pkg/mock}/docker/docker/client/api.go (100%) rename {mock => pkg/mock}/generate.go (100%) rename {mock => pkg/mock}/plugin/group/group.go (94%) rename {mock => pkg/mock}/spi/flavor/flavor.go (92%) rename {mock => pkg/mock}/spi/instance/instance.go (97%) rename {plugin => pkg/plugin}/flavor/swarm/flavor.go (97%) rename {plugin => pkg/plugin}/flavor/swarm/flavor_test.go (96%) rename {plugin => pkg/plugin}/flavor/vanilla/flavor.go (92%) rename {plugin => pkg/plugin}/flavor/zookeeper/flavor.go (96%) rename {plugin => pkg/plugin}/group/README.md (100%) rename {plugin => pkg/plugin}/group/group.go (97%) rename {plugin => pkg/plugin}/group/integration_test.go (98%) rename {plugin => pkg/plugin}/group/quorum.go (98%) rename {plugin => pkg/plugin}/group/quorum_test.go (96%) rename {plugin => pkg/plugin}/group/rollingupdate.go (98%) rename {plugin => pkg/plugin}/group/scaled.go (95%) rename {plugin => pkg/plugin}/group/scaler.go (99%) rename {plugin => pkg/plugin}/group/scaler_test.go (93%) rename {plugin => pkg/plugin}/group/state.go (89%) rename {plugin => pkg/plugin}/group/testplugin.go (94%) rename {plugin => pkg/plugin}/group/types/types.go (97%) rename {plugin => pkg/plugin}/group/types/types_test.go (100%) rename {plugin => pkg/plugin}/group/util/randstring.go (100%) rename {plugin => pkg/plugin}/group/util/runstop.go (100%) rename {plugin => pkg/plugin}/instance/vagrant/instance.go (99%) rename {plugin => pkg/plugin}/plugin.go (100%) rename {rpc => pkg/rpc}/client/client.go (100%) rename {rpc => pkg/rpc}/flavor/client.go (90%) rename {rpc => pkg/rpc}/flavor/rpc_test.go (97%) rename {rpc => pkg/rpc}/flavor/service.go (97%) rename {rpc => pkg/rpc}/flavor/types.go (88%) rename {rpc => pkg/rpc}/group/client.go (93%) rename {rpc => pkg/rpc}/group/rpc_test.go (97%) rename {rpc => pkg/rpc}/group/service.go (97%) rename {rpc => pkg/rpc}/group/types.go (96%) rename {rpc => pkg/rpc}/instance/client.go (93%) rename {rpc => pkg/rpc}/instance/rpc_test.go (98%) rename {rpc => pkg/rpc}/instance/service.go (97%) rename {rpc => pkg/rpc}/instance/types.go (95%) rename {rpc => pkg/rpc}/server/server.go (100%) rename {rpc => pkg/rpc}/server/server_test.go (87%) rename {spi => pkg/spi}/flavor/spi.go (93%) rename {spi => pkg/spi}/group/spi.go (95%) rename {spi => pkg/spi}/instance/spi.go (100%) rename {spi => pkg/spi}/instance/types.go (100%) rename {store => pkg/store}/README.md (100%) rename {store => pkg/store}/file/file.go (96%) rename {store => pkg/store}/store.go (100%) rename {store => pkg/store}/swarm/swarm.go (98%) rename {store => pkg/store}/swarm/swarm_test.go (100%) rename {util => pkg/util}/docker/1.24/docker.go (100%) delete mode 100644 templates/vagrant.tmpl diff --git a/README.md b/README.md index 7fe9c41f8..b9b83f3d5 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ environments while using shared components and consistent interfaces. _InfraKit_ leverages _Plugins_ to manage arbitrary systems in diverse environments, which can be composed to meet different needs. Technically, a Plugin is an HTTP server with a well-defined API, listening on a unix socket. -[Utilities](spi/http) are provided as libraries to simplify Plugin development in Go. +[Utilities](pkg/rpc) are provided as libraries to simplify Plugin development in Go. ### Plugin types #### Group @@ -43,7 +43,7 @@ Since _InfraKit_ emphasizes on declarative infrastructure, there are no operatio state to another. Instead, you _declare_ your desired state of the infrastructure. _InfraKit_ is responsible for converging towards, and maintaining, that desired state. -Therefore, a [group plugin](spi/group/spi.go) manages Groups of Instances and exposes the operations that are of +Therefore, a [group plugin](pkg/spi/group/spi.go) manages Groups of Instances and exposes the operations that are of interest to a user: + commit a group configuration, to start managing a group @@ -60,7 +60,7 @@ infrastructure management system. This would allow you to use _InfraKit_ toolin different infrastructure using the same interface. #### Instance -Instances are members of a group. An [instance plugin](spi/instance/spi.go) manages some physical resource instances. +Instances are members of a group. An [instance plugin](pkg/spi/instance/spi.go) manages some physical resource instances. It knows only about individual instances and nothing about Groups. Instance is technically defined by the plugin, and need not be a physical machine at all. @@ -73,7 +73,7 @@ persistent, stable state. These properties are captured via the _flavors_ of the #### Flavor Flavors help distinguish members of one group from another by describing how these members should be treated. -A [flavor plugin](spi/flavor/spi.go) can be thought of as defining what runs on an Instance. +A [flavor plugin](pkg/spi/flavor/spi.go) can be thought of as defining what runs on an Instance. It is responsible for dictating commands to run services, and check the health of those services. Flavors allow a group of instances to have different characteristics. In a group of cattle, @@ -93,12 +93,12 @@ to start a discussion before contributing to these plugins with non-trivial code | plugin | type | description | |:---------------------------------------------------|:---------|:----------------------------------------| -| [swarm](example/flavor/swarm) | flavor | runs Docker in Swarm mode | -| [vanilla](example/flavor/vanilla) | flavor | manual specification of instance fields | -| [zookeeper](example/flavor/zookeeper) | flavor | run an Apache ZooKeeper ensemble | -| [infrakit/file](example/instance/file) | instance | useful for development and testing | -| [infrakit/terraform](example/instance/terraform) | instance | creates instances using Terraform | -| [infrakit/vagrant](example/instance/vagrant) | instance | creates Vagrant VMs | +| [swarm](pkg/example/flavor/swarm) | flavor | runs Docker in Swarm mode | +| [vanilla](pkg/example/flavor/vanilla) | flavor | manual specification of instance fields | +| [zookeeper](pkg/example/flavor/zookeeper) | flavor | run an Apache ZooKeeper ensemble | +| [infrakit/file](pkg/example/instance/file) | instance | useful for development and testing | +| [infrakit/terraform](pkg/example/instance/terraform) | instance | creates instances using Terraform | +| [infrakit/vagrant](pkg/example/instance/vagrant) | instance | creates Vagrant VMs | #### Supported implementations @@ -154,32 +154,22 @@ $ make binaries ``` Executables will be placed in the `./build` directory. This will produce binaries for tools and several reference Plugin implementations: - + [`infrakit`](./cmd/cli/README.md): a command line interface to interact with plugins - + [`infrakit-group-default`](./cmd/group/README.md): the default [Group plugin](./spi/group) - + [`infrakit-instance-file`](./example/instance/file): an Instance plugin using dummy files to represent instances - + [`infrakit-instance-terraform`](./example/instance/terraform): + + [`infrakit`](cmd/cli/README.md): a command line interface to interact with plugins + + [`infrakit-group-default`](cmd/group/README.md): the default [Group plugin](./spi/group) + + [`infrakit-instance-file`](pkg/example/instance/file): an Instance plugin using dummy files to represent instances + + [`infrakit-instance-terraform`](pkg/example/instance/terraform): an Instance plugin integrating [Terraform](https://www.terraform.io) - + [`infrakit-instance-vagrant`](./example/instance/vagrant): + + [`infrakit-instance-vagrant`](pkg/example/instance/vagrant): an Instance plugin using [Vagrant](https://www.vagrantup.com/) - + [`infrakit-flavor-vanilla`](./example/flavor/vanilla): + + [`infrakit-flavor-vanilla`](pkg/example/flavor/vanilla): a Flavor plugin for plain vanilla set up with user data and labels - + [`infrakit-flavor-zookeeper`](./example/flavor/zookeeper): + + [`infrakit-flavor-zookeeper`](pkg/example/flavor/zookeeper): a Flavor plugin for [Apache ZooKeeper](https://zookeeper.apache.org/) ensemble members - + [`infrakit-flavor-swarm`](./example/flavor/swarm): + + [`infrakit-flavor-swarm`](pkg/example/flavor/swarm): a Flavor plugin for Docker in [Swarm mode](https://docs.docker.com/engine/swarm/). All provided binaries have a `help` sub-command to get usage and a `version` sub-command to identify the build revision. -## Examples -There are a few examples of _InfraKit_ plugins: - - + Terraform Instance Plugin - - [README](./example/instance/terraform/README.md) - - [Code] (./example/instance/terraform/plugin.go) and [configs](./example/instance/terraform/aws-two-tier) - + Zookeeper / Vagrant - - [README](./example/flavor/zookeeper/README.md) - - [Code] (./plugin/flavor/zookeeper) - # Design @@ -200,10 +190,10 @@ A common pattern for a JSON object looks like this: There is only one `Properties` field in this JSON and its value is a JSON object. The opaque JSON value for `Properties` is decoded via the Go `Spec` struct defined within the package of the plugin -- -for example -- [`vanilla.Spec`](/plugin/flavor/vanilla/flavor.go). +for example -- [`vanilla.Spec`](pkg/plugin/flavor/vanilla/flavor.go). The JSON above is a _value_, but the type of the value belongs outside the structure. For example, the -default Group [Spec](/plugin/group/types/types.go) is composed of an Instance plugin, a Flavor plugin, and an +default Group [Spec](pkg/plugin/group/types/types.go) is composed of an Instance plugin, a Flavor plugin, and an Allocation: ```json @@ -305,7 +295,7 @@ The CLI shows which plugins are [discoverable](cmd/cli/README.md#list-plugins). ## Docs -Design docs can be found [here](./docs). +Additional documentation can be found [here](docs). ## Reporting security issues @@ -327,7 +317,7 @@ _InfraKit_ is currently focused on supporting setup and management of base infra orchestrator. The image below illustrates an architecture we are working towards supporting - a Docker cluster in Swarm mode. -![arch image](images/arch.png) +![arch image](docs/images/arch.png) This configuration co-locates _InfraKit_ with Swarm manager nodes and offers high availability of _InfraKit_ itself and Swarm managers (using attached storage). _InfraKit_ is shown managing two groups - managers and workers that will be diff --git a/cmd/cli/flavor.go b/cmd/cli/flavor.go index 5895f5dfa..ab67fec73 100644 --- a/cmd/cli/flavor.go +++ b/cmd/cli/flavor.go @@ -8,11 +8,11 @@ import ( "strings" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/discovery" - "github.com/docker/infrakit/plugin/group/types" - flavor_plugin "github.com/docker/infrakit/rpc/flavor" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/discovery" + "github.com/docker/infrakit/pkg/plugin/group/types" + flavor_plugin "github.com/docker/infrakit/pkg/rpc/flavor" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/spf13/cobra" ) diff --git a/cmd/cli/group.go b/cmd/cli/group.go index d7befa9e0..3d9e88a72 100644 --- a/cmd/cli/group.go +++ b/cmd/cli/group.go @@ -9,9 +9,9 @@ import ( "strings" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/discovery" - group_plugin "github.com/docker/infrakit/rpc/group" - "github.com/docker/infrakit/spi/group" + "github.com/docker/infrakit/pkg/discovery" + group_plugin "github.com/docker/infrakit/pkg/rpc/group" + "github.com/docker/infrakit/pkg/spi/group" "github.com/spf13/cobra" ) diff --git a/cmd/cli/instance.go b/cmd/cli/instance.go index 887adcd44..49a305add 100644 --- a/cmd/cli/instance.go +++ b/cmd/cli/instance.go @@ -9,9 +9,9 @@ import ( "strings" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/discovery" - instance_plugin "github.com/docker/infrakit/rpc/instance" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/discovery" + instance_plugin "github.com/docker/infrakit/pkg/rpc/instance" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/spf13/cobra" ) diff --git a/cmd/cli/main.go b/cmd/cli/main.go index 5be17551b..562de667e 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -5,8 +5,8 @@ import ( "os" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/discovery" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/discovery" "github.com/spf13/cobra" ) diff --git a/cmd/cli/plugin.go b/cmd/cli/plugin.go index 014568513..b0bf03d15 100644 --- a/cmd/cli/plugin.go +++ b/cmd/cli/plugin.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/docker/infrakit/discovery" + "github.com/docker/infrakit/pkg/discovery" "github.com/spf13/cobra" ) diff --git a/cmd/group/main.go b/cmd/group/main.go index 9574774ca..4465f604a 100644 --- a/cmd/group/main.go +++ b/cmd/group/main.go @@ -5,14 +5,14 @@ import ( "time" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/discovery" - "github.com/docker/infrakit/plugin/group" - flavor_client "github.com/docker/infrakit/rpc/flavor" - group_server "github.com/docker/infrakit/rpc/group" - instance_client "github.com/docker/infrakit/rpc/instance" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/discovery" + "github.com/docker/infrakit/pkg/plugin/group" + flavor_client "github.com/docker/infrakit/pkg/rpc/flavor" + group_server "github.com/docker/infrakit/pkg/rpc/group" + instance_client "github.com/docker/infrakit/pkg/rpc/instance" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/spf13/cobra" ) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index cf020d900..2481340f6 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -5,12 +5,12 @@ import ( "path/filepath" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/discovery" - "github.com/docker/infrakit/leader" - "github.com/docker/infrakit/manager" - group_rpc "github.com/docker/infrakit/rpc/group" - "github.com/docker/infrakit/store" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/discovery" + "github.com/docker/infrakit/pkg/leader" + "github.com/docker/infrakit/pkg/manager" + group_rpc "github.com/docker/infrakit/pkg/rpc/group" + "github.com/docker/infrakit/pkg/store" "github.com/spf13/cobra" ) diff --git a/cmd/manager/os.go b/cmd/manager/os.go index 3297572d1..3f295b7fe 100644 --- a/cmd/manager/os.go +++ b/cmd/manager/os.go @@ -6,9 +6,9 @@ import ( "path/filepath" "time" - "github.com/docker/infrakit/discovery" - file_leader "github.com/docker/infrakit/leader/file" - file_store "github.com/docker/infrakit/store/file" + "github.com/docker/infrakit/pkg/discovery" + file_leader "github.com/docker/infrakit/pkg/leader/file" + file_store "github.com/docker/infrakit/pkg/store/file" "github.com/spf13/cobra" ) diff --git a/cmd/manager/swarm.go b/cmd/manager/swarm.go index 424e6b744..5f329f1aa 100644 --- a/cmd/manager/swarm.go +++ b/cmd/manager/swarm.go @@ -5,10 +5,10 @@ import ( log "github.com/Sirupsen/logrus" "github.com/docker/go-connections/tlsconfig" - "github.com/docker/infrakit/discovery" - swarm_leader "github.com/docker/infrakit/leader/swarm" - swarm_store "github.com/docker/infrakit/store/swarm" - "github.com/docker/infrakit/util/docker/1.24" + "github.com/docker/infrakit/pkg/discovery" + swarm_leader "github.com/docker/infrakit/pkg/leader/swarm" + swarm_store "github.com/docker/infrakit/pkg/store/swarm" + "github.com/docker/infrakit/pkg/util/docker/1.24" "github.com/spf13/cobra" ) diff --git a/images/arch.png b/docs/images/arch.png similarity index 100% rename from images/arch.png rename to docs/images/arch.png diff --git a/docs/tutorial.md b/docs/tutorial.md index 176f45387..7b114aa2b 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -62,8 +62,8 @@ Now we must create the JSON for a group. You will find that the JSON structures This defines the name of the `Plugin` to use and the `Properties` to configure it with. The plugins are free to define their own configuration schema. Plugins in this repository follow a convention of using a `Spec` Go struct to define -the `Properties` schema for each plugin. The [`group.Spec`](/plugin/group/types/types.go) in the default Group plugin, -and [`vanilla.Spec`](/plugin/flavor/vanilla/flavor.go) are examples of this pattern. +the `Properties` schema for each plugin. The [`group.Spec`](../pkg/plugin/group/types/types.go) in the default Group plugin, +and [`vanilla.Spec`](../pkg/plugin/flavor/vanilla/flavor.go) are examples of this pattern. From listing the plugins earlier, we have two plugins running. `instance-file` is the name of the File Instance Plugin, and `flavor-vanilla` is the name of the Vanilla Flavor Plugin. diff --git a/cli/logging.go b/pkg/cli/logging.go similarity index 100% rename from cli/logging.go rename to pkg/cli/logging.go diff --git a/cli/serverutil.go b/pkg/cli/serverutil.go similarity index 83% rename from cli/serverutil.go rename to pkg/cli/serverutil.go index 436c82040..2eef2e8de 100644 --- a/cli/serverutil.go +++ b/pkg/cli/serverutil.go @@ -4,8 +4,8 @@ import ( "path" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/discovery" - "github.com/docker/infrakit/rpc/server" + "github.com/docker/infrakit/pkg/discovery" + "github.com/docker/infrakit/pkg/rpc/server" ) // RunPlugin runs a plugin server, advertising with the provided name for discovery. diff --git a/cli/version.go b/pkg/cli/version.go similarity index 100% rename from cli/version.go rename to pkg/cli/version.go diff --git a/discovery/dir.go b/pkg/discovery/dir.go similarity index 97% rename from discovery/dir.go rename to pkg/discovery/dir.go index 1cc6b7e6b..1e865ed6b 100644 --- a/discovery/dir.go +++ b/pkg/discovery/dir.go @@ -8,7 +8,7 @@ import ( "sync" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/plugin" + "github.com/docker/infrakit/pkg/plugin" ) type dirPluginDiscovery struct { diff --git a/discovery/dir_test.go b/pkg/discovery/dir_test.go similarity index 93% rename from discovery/dir_test.go rename to pkg/discovery/dir_test.go index e78aefb1e..e3a76b109 100644 --- a/discovery/dir_test.go +++ b/pkg/discovery/dir_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - rpc "github.com/docker/infrakit/rpc/instance" - "github.com/docker/infrakit/rpc/server" + rpc "github.com/docker/infrakit/pkg/rpc/instance" + "github.com/docker/infrakit/pkg/rpc/server" "github.com/stretchr/testify/require" ) diff --git a/discovery/discovery.go b/pkg/discovery/discovery.go similarity index 97% rename from discovery/discovery.go rename to pkg/discovery/discovery.go index 68739726f..8973b00fc 100644 --- a/discovery/discovery.go +++ b/pkg/discovery/discovery.go @@ -6,7 +6,7 @@ import ( "os/user" "path" - "github.com/docker/infrakit/plugin" + "github.com/docker/infrakit/pkg/plugin" ) // Plugins provides access to plugin discovery. diff --git a/dockerfiles/Dockerfile.build b/pkg/dockerfiles/Dockerfile.build similarity index 100% rename from dockerfiles/Dockerfile.build rename to pkg/dockerfiles/Dockerfile.build diff --git a/example/flavor/combo/README.md b/pkg/example/flavor/combo/README.md similarity index 95% rename from example/flavor/combo/README.md rename to pkg/example/flavor/combo/README.md index 3d04d2d36..1769042b2 100644 --- a/example/flavor/combo/README.md +++ b/pkg/example/flavor/combo/README.md @@ -1,7 +1,7 @@ InfraKit Flavor Plugin - Combo ============================== -A [reference](../../../README.md#reference-implementations) implementation of a Flavor Plugin that supports composition +A [reference](/README.md#reference-implementations) implementation of a Flavor Plugin that supports composition of other Flavors. The Combo plugin allows you to use Flavors as mixins, combining their Instance properties: diff --git a/example/flavor/combo/example.json b/pkg/example/flavor/combo/example.json similarity index 100% rename from example/flavor/combo/example.json rename to pkg/example/flavor/combo/example.json diff --git a/example/flavor/combo/flavor.go b/pkg/example/flavor/combo/flavor.go similarity index 95% rename from example/flavor/combo/flavor.go rename to pkg/example/flavor/combo/flavor.go index b9441c35d..c2ac9f2c6 100644 --- a/example/flavor/combo/flavor.go +++ b/pkg/example/flavor/combo/flavor.go @@ -3,10 +3,10 @@ package main import ( "encoding/json" "errors" - "github.com/docker/infrakit/plugin/group" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "strings" ) diff --git a/example/flavor/combo/flavor_test.go b/pkg/example/flavor/combo/flavor_test.go similarity index 94% rename from example/flavor/combo/flavor_test.go rename to pkg/example/flavor/combo/flavor_test.go index 9af92532e..8d4f2b670 100644 --- a/example/flavor/combo/flavor_test.go +++ b/pkg/example/flavor/combo/flavor_test.go @@ -3,11 +3,11 @@ package main import ( "encoding/json" "errors" - mock_flavor "github.com/docker/infrakit/mock/spi/flavor" - "github.com/docker/infrakit/plugin/group" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + mock_flavor "github.com/docker/infrakit/pkg/mock/spi/flavor" + "github.com/docker/infrakit/pkg/plugin/group" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "testing" diff --git a/example/flavor/combo/main.go b/pkg/example/flavor/combo/main.go similarity index 85% rename from example/flavor/combo/main.go rename to pkg/example/flavor/combo/main.go index ef269d195..c71e01dd4 100644 --- a/example/flavor/combo/main.go +++ b/pkg/example/flavor/combo/main.go @@ -4,10 +4,10 @@ import ( "os" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/discovery" - flavor_rpc "github.com/docker/infrakit/rpc/flavor" - "github.com/docker/infrakit/spi/flavor" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/discovery" + flavor_rpc "github.com/docker/infrakit/pkg/rpc/flavor" + "github.com/docker/infrakit/pkg/spi/flavor" "github.com/spf13/cobra" ) diff --git a/example/flavor/swarm/README.md b/pkg/example/flavor/swarm/README.md similarity index 93% rename from example/flavor/swarm/README.md rename to pkg/example/flavor/swarm/README.md index ebefee2fb..79f4173f9 100644 --- a/example/flavor/swarm/README.md +++ b/pkg/example/flavor/swarm/README.md @@ -1,7 +1,7 @@ InfraKit Flavor Plugin - Swarm ============================== -A [reference](../../../README.md#reference-implementations) implementation of a Flavor Plugin that creates a Docker +A [reference](/README.md#reference-implementations) implementation of a Flavor Plugin that creates a Docker cluster in [Swarm Mode](https://docs.docker.com/engine/swarm/). @@ -24,7 +24,7 @@ The supported fields are: ## Example -Begin by building plugin [binaries](../../../README.md#binaries). +Begin by building plugin [binaries](/README.md#binaries). ### Security diff --git a/example/flavor/swarm/main.go b/pkg/example/flavor/swarm/main.go similarity index 87% rename from example/flavor/swarm/main.go rename to pkg/example/flavor/swarm/main.go index 2df452b6f..d5020c5b4 100644 --- a/example/flavor/swarm/main.go +++ b/pkg/example/flavor/swarm/main.go @@ -5,10 +5,10 @@ import ( log "github.com/Sirupsen/logrus" "github.com/docker/go-connections/tlsconfig" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/plugin/flavor/swarm" - flavor_plugin "github.com/docker/infrakit/rpc/flavor" - "github.com/docker/infrakit/util/docker/1.24" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/plugin/flavor/swarm" + flavor_plugin "github.com/docker/infrakit/pkg/rpc/flavor" + "github.com/docker/infrakit/pkg/util/docker/1.24" "github.com/spf13/cobra" ) diff --git a/example/flavor/swarm/swarm-vagrant-manager.json b/pkg/example/flavor/swarm/swarm-vagrant-manager.json similarity index 100% rename from example/flavor/swarm/swarm-vagrant-manager.json rename to pkg/example/flavor/swarm/swarm-vagrant-manager.json diff --git a/example/flavor/swarm/swarm-vagrant-workers.json b/pkg/example/flavor/swarm/swarm-vagrant-workers.json similarity index 100% rename from example/flavor/swarm/swarm-vagrant-workers.json rename to pkg/example/flavor/swarm/swarm-vagrant-workers.json diff --git a/example/flavor/vanilla/README.md b/pkg/example/flavor/vanilla/README.md similarity index 96% rename from example/flavor/vanilla/README.md rename to pkg/example/flavor/vanilla/README.md index 675decbf5..21edbe407 100644 --- a/example/flavor/vanilla/README.md +++ b/pkg/example/flavor/vanilla/README.md @@ -1,7 +1,7 @@ InfraKit Flavor Plugin - Vanilla ================================ -A [reference](../../../README.md#reference-implementations) implementation of a Flavor Plugin that supports direct +A [reference](/README.md#reference-implementations) implementation of a Flavor Plugin that supports direct injection of Instance fields. While we can specify a list of logical ID's (for example, IP addresses), `Init` and `Tags` diff --git a/example/flavor/vanilla/example.json b/pkg/example/flavor/vanilla/example.json similarity index 100% rename from example/flavor/vanilla/example.json rename to pkg/example/flavor/vanilla/example.json diff --git a/example/flavor/vanilla/main.go b/pkg/example/flavor/vanilla/main.go similarity index 82% rename from example/flavor/vanilla/main.go rename to pkg/example/flavor/vanilla/main.go index d539c162a..e148893ca 100644 --- a/example/flavor/vanilla/main.go +++ b/pkg/example/flavor/vanilla/main.go @@ -4,9 +4,9 @@ import ( "os" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/plugin/flavor/vanilla" - flavor_plugin "github.com/docker/infrakit/rpc/flavor" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/plugin/flavor/vanilla" + flavor_plugin "github.com/docker/infrakit/pkg/rpc/flavor" "github.com/spf13/cobra" ) diff --git a/example/flavor/zookeeper/README.md b/pkg/example/flavor/zookeeper/README.md similarity index 82% rename from example/flavor/zookeeper/README.md rename to pkg/example/flavor/zookeeper/README.md index dbb307e6f..b0a5bf1ee 100644 --- a/example/flavor/zookeeper/README.md +++ b/pkg/example/flavor/zookeeper/README.md @@ -1,14 +1,14 @@ InfraKit Flavor Plugin - Zookeeper ================================== -A [reference](../../../README.md#reference-implementations) implementation of a Flavor Plugin that creates an +A [reference](/README.md#reference-implementations) implementation of a Flavor Plugin that creates an [Apache ZooKeeper](https://zookeeper.apache.org/) ensemble. This is a plugin for handling Zookeeper ensemble. ## Running -Begin by building plugin [binaries](../../../README.md#binaries). +Begin by building plugin [binaries](/README.md#binaries). Start the [vagrant instance plugin](/example/instance/vagrant): @@ -31,7 +31,7 @@ $ build/infrakit-flavor-zookeeper INFO[0000] Listening at: ~/.infrakit/plugins/flavor-zookeeper ``` -Be sure to verify that the plugin is [discoverable](../../../cmd/cli/README.md#list-plugins). +Be sure to verify that the plugin is [discoverable](/cmd/cli/README.md#list-plugins). Here's a JSON for the group we'd like to see [vagrant-zk.json](./vagrant-zk.json): diff --git a/example/flavor/zookeeper/main.go b/pkg/example/flavor/zookeeper/main.go similarity index 81% rename from example/flavor/zookeeper/main.go rename to pkg/example/flavor/zookeeper/main.go index a8316cb10..bf0175d37 100644 --- a/example/flavor/zookeeper/main.go +++ b/pkg/example/flavor/zookeeper/main.go @@ -4,9 +4,9 @@ import ( "os" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - zk "github.com/docker/infrakit/plugin/flavor/zookeeper" - flavor_plugin "github.com/docker/infrakit/rpc/flavor" + "github.com/docker/infrakit/pkg/cli" + zk "github.com/docker/infrakit/pkg/plugin/flavor/zookeeper" + flavor_plugin "github.com/docker/infrakit/pkg/rpc/flavor" "github.com/spf13/cobra" ) diff --git a/example/flavor/zookeeper/vagrant-zk-docker-registry.json b/pkg/example/flavor/zookeeper/vagrant-zk-docker-registry.json similarity index 100% rename from example/flavor/zookeeper/vagrant-zk-docker-registry.json rename to pkg/example/flavor/zookeeper/vagrant-zk-docker-registry.json diff --git a/example/flavor/zookeeper/vagrant-zk-docker.json b/pkg/example/flavor/zookeeper/vagrant-zk-docker.json similarity index 100% rename from example/flavor/zookeeper/vagrant-zk-docker.json rename to pkg/example/flavor/zookeeper/vagrant-zk-docker.json diff --git a/example/flavor/zookeeper/vagrant-zk.json b/pkg/example/flavor/zookeeper/vagrant-zk.json similarity index 100% rename from example/flavor/zookeeper/vagrant-zk.json rename to pkg/example/flavor/zookeeper/vagrant-zk.json diff --git a/example/instance/file/README.md b/pkg/example/instance/file/README.md similarity index 78% rename from example/instance/file/README.md rename to pkg/example/instance/file/README.md index b2680f7f1..fe458b06a 100644 --- a/example/instance/file/README.md +++ b/pkg/example/instance/file/README.md @@ -1,12 +1,12 @@ InfraKit Instance Plugin - File =============================== -A [reference](../../../README.md#reference-implementations) implementation of an Instance Plugin that can accept any +A [reference](/README.md#reference-implementations) implementation of an Instance Plugin that can accept any configuration and writes the configuration to disk as `provision`. It is useful for testing and debugging. ## Building -Begin by building plugin [binaries](../../../README.md#binaries). +Begin by building plugin [binaries](/README.md#binaries). ## Usage @@ -26,7 +26,7 @@ $ build/infrakit-instance-file --name=another-file --dir=./test INFO[0000] Listening at: ~/.infrakit/plugins/another-file ``` -Be sure to verify that the plugin is [discoverable](../../../cmd/cli/README.md#list-plugins). +Be sure to verify that the plugin is [discoverable](/cmd/cli/README.md#list-plugins). Note that there should be two file instance plugins running now with different names (`instance-file`, and `another-file`). diff --git a/example/instance/file/main.go b/pkg/example/instance/file/main.go similarity index 88% rename from example/instance/file/main.go rename to pkg/example/instance/file/main.go index e94e318b9..fcc55cea5 100644 --- a/example/instance/file/main.go +++ b/pkg/example/instance/file/main.go @@ -4,8 +4,8 @@ import ( "os" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - instance_plugin "github.com/docker/infrakit/rpc/instance" + "github.com/docker/infrakit/pkg/cli" + instance_plugin "github.com/docker/infrakit/pkg/rpc/instance" "github.com/spf13/cobra" ) diff --git a/example/instance/file/plugin.go b/pkg/example/instance/file/plugin.go similarity index 98% rename from example/instance/file/plugin.go rename to pkg/example/instance/file/plugin.go index c4d10d853..adc1d14d2 100644 --- a/example/instance/file/plugin.go +++ b/pkg/example/instance/file/plugin.go @@ -7,7 +7,7 @@ import ( "time" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/spf13/afero" "math/rand" ) diff --git a/example/instance/terraform/README.md b/pkg/example/instance/terraform/README.md similarity index 93% rename from example/instance/terraform/README.md rename to pkg/example/instance/terraform/README.md index 0eb1dca40..4d7d9b861 100644 --- a/example/instance/terraform/README.md +++ b/pkg/example/instance/terraform/README.md @@ -1,7 +1,7 @@ InfraKit Instance Plugin - Terraform ===================================== -A [reference](../../../README.md#reference-implementations) implementation of an Instance Plugin that creates machines +A [reference](/README.md#reference-implementations) implementation of an Instance Plugin that creates machines using [Terraform](https://www.terraform.io). In this concept, InfraKit provides the active group management while Terraform performs the functions of resource provisioning. @@ -14,7 +14,7 @@ example from the Terraform project. There are some minor changes: coming in the future. + Removed the output variables which depended on the ELB. -The entire integration can be seen in the file [`plugin.go`](./plugin.go). Some interesting points: +The entire integration can be seen in the file [`plugin.go`](plugin.go). Some interesting points: + Provisioning via Terraform is simply creating a `.tf.json` file on disk and calling `terraform apply`. + `terraform apply` uses a local lock file to make sure only one process is access and updating the @@ -28,7 +28,7 @@ The entire integration can be seen in the file [`plugin.go`](./plugin.go). Some and then reading the `tfstate` file. The generated tf json file instances are essentially "promises" that terraform will eventually provision. A tighter integration is worth investigation. -[Here](./cattle_demo.md) is a simple demo of using Terraform with group and Vanilla plugins. +[Here](cattle_demo.md) is a simple demo of using Terraform with group and Vanilla plugins. ## Configuration @@ -106,7 +106,7 @@ and update its state. ## Running -Begin by building plugin [binaries](../../../README.md#binaries). +Begin by building plugin [binaries](/README.md#binaries). The plugin requires a directory (`--dir`) that will be used to contain the `tfstate` and `tf.json` files. It also checks to make sure it can call `terraform`. @@ -121,7 +121,7 @@ $ build/infrakit-instance-terraform --dir=./example/instance/terraform/aws-two-t INFO[0000] Listening at: ~/.infrakit/plugins/instance-terraform ``` -Be sure to verify that the plugin is [discoverable](../../../cmd/cli/README.md#list-plugins). +Be sure to verify that the plugin is [discoverable](/cmd/cli/README.md#list-plugins). Now lets try to validate something. Instead of reading from stdin we are loading from a file to avoid problems with bad bash substitution beacuse Terrafrom configs use `$` to indicate variables. @@ -191,7 +191,7 @@ instance-1475004829 - other=values,provi You should verify that the instances are indeed created in the AWS Console. In AWS Console you can filter by tag `provisioner` with value `infrakit-terraform-example`: -![RSG Screenshot](./example.png) +![RSG Screenshot](example.png) Now destroy the instance: @@ -202,4 +202,4 @@ $ build/infrakit instance --name instance-terraform describe ID LOGICAL TAGS ``` -![RSG Screenshot](./terminated.png) +![RSG Screenshot](terminated.png) diff --git a/example/instance/terraform/aws-two-tier/group.json b/pkg/example/instance/terraform/aws-two-tier/group.json similarity index 100% rename from example/instance/terraform/aws-two-tier/group.json rename to pkg/example/instance/terraform/aws-two-tier/group.json diff --git a/example/instance/terraform/aws-two-tier/instance-plugin-properties.json b/pkg/example/instance/terraform/aws-two-tier/instance-plugin-properties.json similarity index 100% rename from example/instance/terraform/aws-two-tier/instance-plugin-properties.json rename to pkg/example/instance/terraform/aws-two-tier/instance-plugin-properties.json diff --git a/example/instance/terraform/aws-two-tier/instance-plugin-spec.json b/pkg/example/instance/terraform/aws-two-tier/instance-plugin-spec.json similarity index 100% rename from example/instance/terraform/aws-two-tier/instance-plugin-spec.json rename to pkg/example/instance/terraform/aws-two-tier/instance-plugin-spec.json diff --git a/example/instance/terraform/aws-two-tier/main.tf b/pkg/example/instance/terraform/aws-two-tier/main.tf similarity index 100% rename from example/instance/terraform/aws-two-tier/main.tf rename to pkg/example/instance/terraform/aws-two-tier/main.tf diff --git a/example/instance/terraform/aws-two-tier/variables.tf b/pkg/example/instance/terraform/aws-two-tier/variables.tf similarity index 100% rename from example/instance/terraform/aws-two-tier/variables.tf rename to pkg/example/instance/terraform/aws-two-tier/variables.tf diff --git a/example/instance/terraform/cattle_demo.md b/pkg/example/instance/terraform/cattle_demo.md similarity index 100% rename from example/instance/terraform/cattle_demo.md rename to pkg/example/instance/terraform/cattle_demo.md diff --git a/example/instance/terraform/example.png b/pkg/example/instance/terraform/example.png similarity index 100% rename from example/instance/terraform/example.png rename to pkg/example/instance/terraform/example.png diff --git a/example/instance/terraform/images/1.png b/pkg/example/instance/terraform/images/1.png similarity index 100% rename from example/instance/terraform/images/1.png rename to pkg/example/instance/terraform/images/1.png diff --git a/example/instance/terraform/images/2.png b/pkg/example/instance/terraform/images/2.png similarity index 100% rename from example/instance/terraform/images/2.png rename to pkg/example/instance/terraform/images/2.png diff --git a/example/instance/terraform/main.go b/pkg/example/instance/terraform/main.go similarity index 91% rename from example/instance/terraform/main.go rename to pkg/example/instance/terraform/main.go index dc26acbc8..be4711a0c 100644 --- a/example/instance/terraform/main.go +++ b/pkg/example/instance/terraform/main.go @@ -5,8 +5,8 @@ import ( "os/exec" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - instance_plugin "github.com/docker/infrakit/rpc/instance" + "github.com/docker/infrakit/pkg/cli" + instance_plugin "github.com/docker/infrakit/pkg/rpc/instance" "github.com/spf13/cobra" ) diff --git a/example/instance/terraform/plugin.go b/pkg/example/instance/terraform/plugin.go similarity index 99% rename from example/instance/terraform/plugin.go rename to pkg/example/instance/terraform/plugin.go index 5b19c8b53..7fe3fa9bb 100644 --- a/example/instance/terraform/plugin.go +++ b/pkg/example/instance/terraform/plugin.go @@ -16,7 +16,7 @@ import ( "time" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/nightlyone/lockfile" "github.com/spf13/afero" ) diff --git a/example/instance/terraform/terminated.png b/pkg/example/instance/terraform/terminated.png similarity index 100% rename from example/instance/terraform/terminated.png rename to pkg/example/instance/terraform/terminated.png diff --git a/example/instance/vagrant/main.go b/pkg/example/instance/vagrant/main.go similarity index 88% rename from example/instance/vagrant/main.go rename to pkg/example/instance/vagrant/main.go index 3152b58cc..e3cb4bc1a 100644 --- a/example/instance/vagrant/main.go +++ b/pkg/example/instance/vagrant/main.go @@ -5,9 +5,9 @@ import ( "text/template" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/cli" - "github.com/docker/infrakit/plugin/instance/vagrant" - instance_plugin "github.com/docker/infrakit/rpc/instance" + "github.com/docker/infrakit/pkg/cli" + "github.com/docker/infrakit/pkg/plugin/instance/vagrant" + instance_plugin "github.com/docker/infrakit/pkg/rpc/instance" "github.com/spf13/cobra" ) diff --git a/leader/file/file.go b/pkg/leader/file/file.go similarity index 95% rename from leader/file/file.go rename to pkg/leader/file/file.go index e5c4601a5..317e4b71a 100644 --- a/leader/file/file.go +++ b/pkg/leader/file/file.go @@ -8,7 +8,7 @@ import ( "time" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/leader" + "github.com/docker/infrakit/pkg/leader" ) // NewDetector return an implementation of leader detector diff --git a/leader/file/file_test.go b/pkg/leader/file/file_test.go similarity index 97% rename from leader/file/file_test.go rename to pkg/leader/file/file_test.go index 65b5eccae..a36e28b74 100644 --- a/leader/file/file_test.go +++ b/pkg/leader/file/file_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/docker/infrakit/leader" + "github.com/docker/infrakit/pkg/leader" "github.com/stretchr/testify/require" ) diff --git a/leader/leader.go b/pkg/leader/leader.go similarity index 100% rename from leader/leader.go rename to pkg/leader/leader.go diff --git a/leader/poller.go b/pkg/leader/poller.go similarity index 100% rename from leader/poller.go rename to pkg/leader/poller.go diff --git a/leader/poller_test.go b/pkg/leader/poller_test.go similarity index 100% rename from leader/poller_test.go rename to pkg/leader/poller_test.go diff --git a/leader/swarm/swarm.go b/pkg/leader/swarm/swarm.go similarity index 95% rename from leader/swarm/swarm.go rename to pkg/leader/swarm/swarm.go index cf4cda9d8..8652e579c 100644 --- a/leader/swarm/swarm.go +++ b/pkg/leader/swarm/swarm.go @@ -5,7 +5,7 @@ import ( log "github.com/Sirupsen/logrus" "github.com/docker/docker/client" - "github.com/docker/infrakit/leader" + "github.com/docker/infrakit/pkg/leader" "golang.org/x/net/context" ) diff --git a/leader/swarm/swarm_test.go b/pkg/leader/swarm/swarm_test.go similarity index 90% rename from leader/swarm/swarm_test.go rename to pkg/leader/swarm/swarm_test.go index 9952bce89..920a3d5a6 100644 --- a/leader/swarm/swarm_test.go +++ b/pkg/leader/swarm/swarm_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/docker/infrakit/leader" - docker_mock "github.com/docker/infrakit/mock/docker/docker/client" + "github.com/docker/infrakit/pkg/leader" + docker_mock "github.com/docker/infrakit/pkg/mock/docker/docker/client" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "golang.org/x/net/context" diff --git a/manager/group_plugin_impl.go b/pkg/manager/group_plugin_impl.go similarity index 95% rename from manager/group_plugin_impl.go rename to pkg/manager/group_plugin_impl.go index 05831801c..2d714294a 100644 --- a/manager/group_plugin_impl.go +++ b/pkg/manager/group_plugin_impl.go @@ -4,8 +4,8 @@ import ( "encoding/json" log "github.com/Sirupsen/logrus" - rpc "github.com/docker/infrakit/rpc/group" - "github.com/docker/infrakit/spi/group" + rpc "github.com/docker/infrakit/pkg/rpc/group" + "github.com/docker/infrakit/pkg/spi/group" ) // proxyForGroupPlugin registers a group plugin that this manager will proxy for. diff --git a/manager/manager.go b/pkg/manager/manager.go similarity index 97% rename from manager/manager.go rename to pkg/manager/manager.go index ff647e9fb..e9a082b8b 100644 --- a/manager/manager.go +++ b/pkg/manager/manager.go @@ -7,11 +7,11 @@ import ( "errors" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/discovery" - "github.com/docker/infrakit/leader" - rpc "github.com/docker/infrakit/rpc/group" - "github.com/docker/infrakit/spi/group" - "github.com/docker/infrakit/store" + "github.com/docker/infrakit/pkg/discovery" + "github.com/docker/infrakit/pkg/leader" + rpc "github.com/docker/infrakit/pkg/rpc/group" + "github.com/docker/infrakit/pkg/spi/group" + "github.com/docker/infrakit/pkg/store" ) // Backend is the admin / server interface diff --git a/manager/spec.go b/pkg/manager/spec.go similarity index 89% rename from manager/spec.go rename to pkg/manager/spec.go index 6786f37bb..279ae6781 100644 --- a/manager/spec.go +++ b/pkg/manager/spec.go @@ -3,7 +3,7 @@ package manager import ( "encoding/json" - "github.com/docker/infrakit/spi/group" + "github.com/docker/infrakit/pkg/spi/group" ) // GlobalSpec is a simple model of a collection of Group plugin configs diff --git a/mock/docker/docker/client/api.go b/pkg/mock/docker/docker/client/api.go similarity index 100% rename from mock/docker/docker/client/api.go rename to pkg/mock/docker/docker/client/api.go diff --git a/mock/generate.go b/pkg/mock/generate.go similarity index 100% rename from mock/generate.go rename to pkg/mock/generate.go diff --git a/mock/plugin/group/group.go b/pkg/mock/plugin/group/group.go similarity index 94% rename from mock/plugin/group/group.go rename to pkg/mock/plugin/group/group.go index a57501e68..b36385be5 100644 --- a/mock/plugin/group/group.go +++ b/pkg/mock/plugin/group/group.go @@ -4,8 +4,8 @@ package group import ( - flavor "github.com/docker/infrakit/spi/flavor" - instance "github.com/docker/infrakit/spi/instance" + flavor "github.com/docker/infrakit/pkg/spi/flavor" + instance "github.com/docker/infrakit/pkg/spi/instance" gomock "github.com/golang/mock/gomock" ) diff --git a/mock/spi/flavor/flavor.go b/pkg/mock/spi/flavor/flavor.go similarity index 92% rename from mock/spi/flavor/flavor.go rename to pkg/mock/spi/flavor/flavor.go index dd8651e18..d21315055 100644 --- a/mock/spi/flavor/flavor.go +++ b/pkg/mock/spi/flavor/flavor.go @@ -5,9 +5,9 @@ package instance import ( json "encoding/json" - types "github.com/docker/infrakit/plugin/group/types" - flavor "github.com/docker/infrakit/spi/flavor" - instance "github.com/docker/infrakit/spi/instance" + types "github.com/docker/infrakit/pkg/plugin/group/types" + flavor "github.com/docker/infrakit/pkg/spi/flavor" + instance "github.com/docker/infrakit/pkg/spi/instance" gomock "github.com/golang/mock/gomock" ) diff --git a/mock/spi/instance/instance.go b/pkg/mock/spi/instance/instance.go similarity index 97% rename from mock/spi/instance/instance.go rename to pkg/mock/spi/instance/instance.go index 982ae1172..244765d84 100644 --- a/mock/spi/instance/instance.go +++ b/pkg/mock/spi/instance/instance.go @@ -5,7 +5,7 @@ package instance import ( json "encoding/json" - instance "github.com/docker/infrakit/spi/instance" + instance "github.com/docker/infrakit/pkg/spi/instance" gomock "github.com/golang/mock/gomock" ) diff --git a/plugin/flavor/swarm/flavor.go b/pkg/plugin/flavor/swarm/flavor.go similarity index 97% rename from plugin/flavor/swarm/flavor.go rename to pkg/plugin/flavor/swarm/flavor.go index 78984d0b6..6a1d7d5dc 100644 --- a/plugin/flavor/swarm/flavor.go +++ b/pkg/plugin/flavor/swarm/flavor.go @@ -9,10 +9,10 @@ import ( docker_types "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/plugin/group/util" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/plugin/group/util" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "golang.org/x/net/context" "text/template" ) diff --git a/plugin/flavor/swarm/flavor_test.go b/pkg/plugin/flavor/swarm/flavor_test.go similarity index 96% rename from plugin/flavor/swarm/flavor_test.go rename to pkg/plugin/flavor/swarm/flavor_test.go index 418a3c4d1..11b6c6a7c 100644 --- a/plugin/flavor/swarm/flavor_test.go +++ b/pkg/plugin/flavor/swarm/flavor_test.go @@ -6,10 +6,10 @@ import ( docker_types "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" - mock_client "github.com/docker/infrakit/mock/docker/docker/client" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + mock_client "github.com/docker/infrakit/pkg/mock/docker/docker/client" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "testing" diff --git a/plugin/flavor/vanilla/flavor.go b/pkg/plugin/flavor/vanilla/flavor.go similarity index 92% rename from plugin/flavor/vanilla/flavor.go rename to pkg/plugin/flavor/vanilla/flavor.go index 0d29e21dd..9fc94fdc4 100644 --- a/plugin/flavor/vanilla/flavor.go +++ b/pkg/plugin/flavor/vanilla/flavor.go @@ -4,9 +4,9 @@ import ( "encoding/json" "strings" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" ) // Spec is the model of the Properties section of the top level group spec. diff --git a/plugin/flavor/zookeeper/flavor.go b/pkg/plugin/flavor/zookeeper/flavor.go similarity index 96% rename from plugin/flavor/zookeeper/flavor.go rename to pkg/plugin/flavor/zookeeper/flavor.go index 4b72ff438..eb41e5637 100644 --- a/plugin/flavor/zookeeper/flavor.go +++ b/pkg/plugin/flavor/zookeeper/flavor.go @@ -5,9 +5,9 @@ import ( "encoding/json" "errors" "fmt" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "strings" "text/template" ) diff --git a/plugin/group/README.md b/pkg/plugin/group/README.md similarity index 100% rename from plugin/group/README.md rename to pkg/plugin/group/README.md diff --git a/plugin/group/group.go b/pkg/plugin/group/group.go similarity index 97% rename from plugin/group/group.go rename to pkg/plugin/group/group.go index ac8a5ffa3..521ceb081 100644 --- a/plugin/group/group.go +++ b/pkg/plugin/group/group.go @@ -4,10 +4,10 @@ import ( "errors" "fmt" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/group" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/group" + "github.com/docker/infrakit/pkg/spi/instance" "sync" "time" ) diff --git a/plugin/group/integration_test.go b/pkg/plugin/group/integration_test.go similarity index 98% rename from plugin/group/integration_test.go rename to pkg/plugin/group/integration_test.go index f4e1765bd..77ffb4191 100644 --- a/plugin/group/integration_test.go +++ b/pkg/plugin/group/integration_test.go @@ -3,10 +3,10 @@ package group import ( "encoding/json" "fmt" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/group" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/group" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/stretchr/testify/require" "strings" "sync" diff --git a/plugin/group/quorum.go b/pkg/plugin/group/quorum.go similarity index 98% rename from plugin/group/quorum.go rename to pkg/plugin/group/quorum.go index 4a02c63f5..44c211ad5 100644 --- a/plugin/group/quorum.go +++ b/pkg/plugin/group/quorum.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" "reflect" "sync" "time" diff --git a/plugin/group/quorum_test.go b/pkg/plugin/group/quorum_test.go similarity index 96% rename from plugin/group/quorum_test.go rename to pkg/plugin/group/quorum_test.go index 1a686d731..f3b5709a8 100644 --- a/plugin/group/quorum_test.go +++ b/pkg/plugin/group/quorum_test.go @@ -1,8 +1,8 @@ package group import ( - mock_group "github.com/docker/infrakit/mock/plugin/group" - "github.com/docker/infrakit/spi/instance" + mock_group "github.com/docker/infrakit/pkg/mock/plugin/group" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/golang/mock/gomock" "testing" "time" diff --git a/plugin/group/rollingupdate.go b/pkg/plugin/group/rollingupdate.go similarity index 98% rename from plugin/group/rollingupdate.go rename to pkg/plugin/group/rollingupdate.go index c92d083e8..45863874c 100644 --- a/plugin/group/rollingupdate.go +++ b/pkg/plugin/group/rollingupdate.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "sort" "time" ) diff --git a/plugin/group/scaled.go b/pkg/plugin/group/scaled.go similarity index 95% rename from plugin/group/scaled.go rename to pkg/plugin/group/scaled.go index 89a652f4f..4b228899d 100644 --- a/plugin/group/scaled.go +++ b/pkg/plugin/group/scaled.go @@ -3,9 +3,9 @@ package group import ( "fmt" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "sync" ) diff --git a/plugin/group/scaler.go b/pkg/plugin/group/scaler.go similarity index 99% rename from plugin/group/scaler.go rename to pkg/plugin/group/scaler.go index 7de11a0f7..3c55b4c03 100644 --- a/plugin/group/scaler.go +++ b/pkg/plugin/group/scaler.go @@ -3,7 +3,7 @@ package group import ( "fmt" log "github.com/Sirupsen/logrus" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" "sort" "sync" "time" diff --git a/plugin/group/scaler_test.go b/pkg/plugin/group/scaler_test.go similarity index 93% rename from plugin/group/scaler_test.go rename to pkg/plugin/group/scaler_test.go index 042ae7cd7..007dbe04f 100644 --- a/plugin/group/scaler_test.go +++ b/pkg/plugin/group/scaler_test.go @@ -1,8 +1,8 @@ package group import ( - mock_group "github.com/docker/infrakit/mock/plugin/group" - "github.com/docker/infrakit/spi/instance" + mock_group "github.com/docker/infrakit/pkg/mock/plugin/group" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/golang/mock/gomock" "testing" "time" diff --git a/plugin/group/state.go b/pkg/plugin/group/state.go similarity index 89% rename from plugin/group/state.go rename to pkg/plugin/group/state.go index f49b72bac..7005c789c 100644 --- a/plugin/group/state.go +++ b/pkg/plugin/group/state.go @@ -2,11 +2,11 @@ package group import ( "fmt" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/plugin/group/util" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/group" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/plugin/group/util" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/group" + "github.com/docker/infrakit/pkg/spi/instance" "sync" ) diff --git a/plugin/group/testplugin.go b/pkg/plugin/group/testplugin.go similarity index 94% rename from plugin/group/testplugin.go rename to pkg/plugin/group/testplugin.go index cc6b99652..2dc72408b 100644 --- a/plugin/group/testplugin.go +++ b/pkg/plugin/group/testplugin.go @@ -4,10 +4,10 @@ import ( "encoding/json" "errors" "fmt" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/plugin/group/util" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/plugin/group/util" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "sync" ) diff --git a/plugin/group/types/types.go b/pkg/plugin/group/types/types.go similarity index 97% rename from plugin/group/types/types.go rename to pkg/plugin/group/types/types.go index f7aacc3d0..62c75f9f7 100644 --- a/plugin/group/types/types.go +++ b/pkg/plugin/group/types/types.go @@ -5,8 +5,8 @@ import ( "encoding/base64" "encoding/json" "fmt" - "github.com/docker/infrakit/spi/group" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/group" + "github.com/docker/infrakit/pkg/spi/instance" ) // Spec is the configuration schema for the plugin, provided in group.Spec.Properties diff --git a/plugin/group/types/types_test.go b/pkg/plugin/group/types/types_test.go similarity index 100% rename from plugin/group/types/types_test.go rename to pkg/plugin/group/types/types_test.go diff --git a/plugin/group/util/randstring.go b/pkg/plugin/group/util/randstring.go similarity index 100% rename from plugin/group/util/randstring.go rename to pkg/plugin/group/util/randstring.go diff --git a/plugin/group/util/runstop.go b/pkg/plugin/group/util/runstop.go similarity index 100% rename from plugin/group/util/runstop.go rename to pkg/plugin/group/util/runstop.go diff --git a/plugin/instance/vagrant/instance.go b/pkg/plugin/instance/vagrant/instance.go similarity index 99% rename from plugin/instance/vagrant/instance.go rename to pkg/plugin/instance/vagrant/instance.go index 7ee01a77f..ae4aa044e 100644 --- a/plugin/instance/vagrant/instance.go +++ b/pkg/plugin/instance/vagrant/instance.go @@ -11,7 +11,7 @@ import ( "path" "text/template" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" ) // VagrantFile is the minimum definition of the vagrant file diff --git a/plugin/plugin.go b/pkg/plugin/plugin.go similarity index 100% rename from plugin/plugin.go rename to pkg/plugin/plugin.go diff --git a/rpc/client/client.go b/pkg/rpc/client/client.go similarity index 100% rename from rpc/client/client.go rename to pkg/rpc/client/client.go diff --git a/rpc/flavor/client.go b/pkg/rpc/flavor/client.go similarity index 90% rename from rpc/flavor/client.go rename to pkg/rpc/flavor/client.go index cdc636187..ff902675b 100644 --- a/rpc/flavor/client.go +++ b/pkg/rpc/flavor/client.go @@ -2,10 +2,10 @@ package flavor import ( "encoding/json" - "github.com/docker/infrakit/plugin/group/types" - rpc_client "github.com/docker/infrakit/rpc/client" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + rpc_client "github.com/docker/infrakit/pkg/rpc/client" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" ) // NewClient returns a plugin interface implementation connected to a remote plugin diff --git a/rpc/flavor/rpc_test.go b/pkg/rpc/flavor/rpc_test.go similarity index 97% rename from rpc/flavor/rpc_test.go rename to pkg/rpc/flavor/rpc_test.go index 7c20295e8..becadb52e 100644 --- a/rpc/flavor/rpc_test.go +++ b/pkg/rpc/flavor/rpc_test.go @@ -5,10 +5,10 @@ import ( "errors" "testing" - "github.com/docker/infrakit/plugin/group/types" - rpc_server "github.com/docker/infrakit/rpc/server" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + rpc_server "github.com/docker/infrakit/pkg/rpc/server" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/stretchr/testify/require" "io/ioutil" "path" diff --git a/rpc/flavor/service.go b/pkg/rpc/flavor/service.go similarity index 97% rename from rpc/flavor/service.go rename to pkg/rpc/flavor/service.go index 6483b8a7a..4e6dc9e59 100644 --- a/rpc/flavor/service.go +++ b/pkg/rpc/flavor/service.go @@ -1,7 +1,7 @@ package flavor import ( - "github.com/docker/infrakit/spi/flavor" + "github.com/docker/infrakit/pkg/spi/flavor" "net/http" ) diff --git a/rpc/flavor/types.go b/pkg/rpc/flavor/types.go similarity index 88% rename from rpc/flavor/types.go rename to pkg/rpc/flavor/types.go index dcf88b1a0..fa719e147 100644 --- a/rpc/flavor/types.go +++ b/pkg/rpc/flavor/types.go @@ -3,9 +3,9 @@ package flavor import ( "encoding/json" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/flavor" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/flavor" + "github.com/docker/infrakit/pkg/spi/instance" ) // ValidateRequest is the rpc wrapper for request parameters to Validate diff --git a/rpc/group/client.go b/pkg/rpc/group/client.go similarity index 93% rename from rpc/group/client.go rename to pkg/rpc/group/client.go index fa24d7b4f..bddc6dbf8 100644 --- a/rpc/group/client.go +++ b/pkg/rpc/group/client.go @@ -1,8 +1,8 @@ package group import ( - rpc_client "github.com/docker/infrakit/rpc/client" - "github.com/docker/infrakit/spi/group" + rpc_client "github.com/docker/infrakit/pkg/rpc/client" + "github.com/docker/infrakit/pkg/spi/group" ) // NewClient returns a plugin interface implementation connected to a remote plugin diff --git a/rpc/group/rpc_test.go b/pkg/rpc/group/rpc_test.go similarity index 97% rename from rpc/group/rpc_test.go rename to pkg/rpc/group/rpc_test.go index 14bdedf5c..05438861d 100644 --- a/rpc/group/rpc_test.go +++ b/pkg/rpc/group/rpc_test.go @@ -5,9 +5,9 @@ import ( "errors" "testing" - rpc_server "github.com/docker/infrakit/rpc/server" - "github.com/docker/infrakit/spi/group" - "github.com/docker/infrakit/spi/instance" + rpc_server "github.com/docker/infrakit/pkg/rpc/server" + "github.com/docker/infrakit/pkg/spi/group" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/stretchr/testify/require" "io/ioutil" "path" diff --git a/rpc/group/service.go b/pkg/rpc/group/service.go similarity index 97% rename from rpc/group/service.go rename to pkg/rpc/group/service.go index 2a6446eae..5e0304a3a 100644 --- a/rpc/group/service.go +++ b/pkg/rpc/group/service.go @@ -1,7 +1,7 @@ package group import ( - "github.com/docker/infrakit/spi/group" + "github.com/docker/infrakit/pkg/spi/group" "net/http" ) diff --git a/rpc/group/types.go b/pkg/rpc/group/types.go similarity index 96% rename from rpc/group/types.go rename to pkg/rpc/group/types.go index 0bc72c79c..3ab33ed65 100644 --- a/rpc/group/types.go +++ b/pkg/rpc/group/types.go @@ -1,7 +1,7 @@ package group import ( - "github.com/docker/infrakit/spi/group" + "github.com/docker/infrakit/pkg/spi/group" ) // CommitGroupRequest is the rpc wrapper for input to commit a group diff --git a/rpc/instance/client.go b/pkg/rpc/instance/client.go similarity index 93% rename from rpc/instance/client.go rename to pkg/rpc/instance/client.go index a4f173a31..940541ddb 100644 --- a/rpc/instance/client.go +++ b/pkg/rpc/instance/client.go @@ -2,8 +2,8 @@ package instance import ( "encoding/json" - rpc_client "github.com/docker/infrakit/rpc/client" - "github.com/docker/infrakit/spi/instance" + rpc_client "github.com/docker/infrakit/pkg/rpc/client" + "github.com/docker/infrakit/pkg/spi/instance" ) // NewClient returns a plugin interface implementation connected to a plugin diff --git a/rpc/instance/rpc_test.go b/pkg/rpc/instance/rpc_test.go similarity index 98% rename from rpc/instance/rpc_test.go rename to pkg/rpc/instance/rpc_test.go index 7674a477e..133906b00 100644 --- a/rpc/instance/rpc_test.go +++ b/pkg/rpc/instance/rpc_test.go @@ -5,8 +5,8 @@ import ( "errors" "testing" - rpc_server "github.com/docker/infrakit/rpc/server" - "github.com/docker/infrakit/spi/instance" + rpc_server "github.com/docker/infrakit/pkg/rpc/server" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/stretchr/testify/require" "io/ioutil" "path" diff --git a/rpc/instance/service.go b/pkg/rpc/instance/service.go similarity index 97% rename from rpc/instance/service.go rename to pkg/rpc/instance/service.go index 98154dc45..5e1bd06d7 100644 --- a/rpc/instance/service.go +++ b/pkg/rpc/instance/service.go @@ -2,7 +2,7 @@ package instance import ( "errors" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" "net/http" ) diff --git a/rpc/instance/types.go b/pkg/rpc/instance/types.go similarity index 95% rename from rpc/instance/types.go rename to pkg/rpc/instance/types.go index 78aa6c65a..3077cdbee 100644 --- a/rpc/instance/types.go +++ b/pkg/rpc/instance/types.go @@ -3,7 +3,7 @@ package instance import ( "encoding/json" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" ) // ValidateRequest is the rpc wrapper for the Validate method args diff --git a/rpc/server/server.go b/pkg/rpc/server/server.go similarity index 100% rename from rpc/server/server.go rename to pkg/rpc/server/server.go diff --git a/rpc/server/server_test.go b/pkg/rpc/server/server_test.go similarity index 87% rename from rpc/server/server_test.go rename to pkg/rpc/server/server_test.go index cfcd46955..90eb89395 100644 --- a/rpc/server/server_test.go +++ b/pkg/rpc/server/server_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - plugin_mock "github.com/docker/infrakit/mock/spi/instance" - plugin_rpc "github.com/docker/infrakit/rpc/instance" - "github.com/docker/infrakit/spi/instance" + plugin_mock "github.com/docker/infrakit/pkg/mock/spi/instance" + plugin_rpc "github.com/docker/infrakit/pkg/rpc/instance" + "github.com/docker/infrakit/pkg/spi/instance" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/spi/flavor/spi.go b/pkg/spi/flavor/spi.go similarity index 93% rename from spi/flavor/spi.go rename to pkg/spi/flavor/spi.go index 32f2f32c3..81a2c81f4 100644 --- a/spi/flavor/spi.go +++ b/pkg/spi/flavor/spi.go @@ -2,8 +2,8 @@ package flavor import ( "encoding/json" - "github.com/docker/infrakit/plugin/group/types" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/plugin/group/types" + "github.com/docker/infrakit/pkg/spi/instance" ) // Health is an indication of whether the Flavor is functioning properly. diff --git a/spi/group/spi.go b/pkg/spi/group/spi.go similarity index 95% rename from spi/group/spi.go rename to pkg/spi/group/spi.go index b6e9a2abc..0eec99ab5 100644 --- a/spi/group/spi.go +++ b/pkg/spi/group/spi.go @@ -2,7 +2,7 @@ package group import ( "encoding/json" - "github.com/docker/infrakit/spi/instance" + "github.com/docker/infrakit/pkg/spi/instance" ) // Plugin defines the functions for a Group plugin. diff --git a/spi/instance/spi.go b/pkg/spi/instance/spi.go similarity index 100% rename from spi/instance/spi.go rename to pkg/spi/instance/spi.go diff --git a/spi/instance/types.go b/pkg/spi/instance/types.go similarity index 100% rename from spi/instance/types.go rename to pkg/spi/instance/types.go diff --git a/store/README.md b/pkg/store/README.md similarity index 100% rename from store/README.md rename to pkg/store/README.md diff --git a/store/file/file.go b/pkg/store/file/file.go similarity index 96% rename from store/file/file.go rename to pkg/store/file/file.go index 0d756f08a..a91affb4c 100644 --- a/store/file/file.go +++ b/pkg/store/file/file.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/docker/infrakit/store" + "github.com/docker/infrakit/pkg/store" ) type snapshot struct { diff --git a/store/store.go b/pkg/store/store.go similarity index 100% rename from store/store.go rename to pkg/store/store.go diff --git a/store/swarm/swarm.go b/pkg/store/swarm/swarm.go similarity index 98% rename from store/swarm/swarm.go rename to pkg/store/swarm/swarm.go index 29c5ea3f1..a1bae3023 100644 --- a/store/swarm/swarm.go +++ b/pkg/store/swarm/swarm.go @@ -11,7 +11,7 @@ import ( log "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" - "github.com/docker/infrakit/store" + "github.com/docker/infrakit/pkg/store" "golang.org/x/net/context" ) diff --git a/store/swarm/swarm_test.go b/pkg/store/swarm/swarm_test.go similarity index 100% rename from store/swarm/swarm_test.go rename to pkg/store/swarm/swarm_test.go diff --git a/util/docker/1.24/docker.go b/pkg/util/docker/1.24/docker.go similarity index 100% rename from util/docker/1.24/docker.go rename to pkg/util/docker/1.24/docker.go diff --git a/templates/vagrant.tmpl b/templates/vagrant.tmpl deleted file mode 100644 index 430ba911c..000000000 --- a/templates/vagrant.tmpl +++ /dev/null @@ -1,18 +0,0 @@ -Vagrant.configure("2") do |config| - config.vm.box = "{{.Properties.Box}}" - {{if .Properties.BoxVersion }} - config.vm.box_version = "{{.Properties.BoxVersion}}" - {{end}} - {{if .Properties.BoxURL }} - config.vm.box_url = "{{.Properties.BoxURL}}" - {{end}} - config.vm.hostname = "infrakit.box" - config.vm.network "private_network"{{.NetworkOptions}} - - config.vm.provision :shell, path: "boot.sh" - - config.vm.provider :virtualbox do |vb| - vb.memory = {{.Properties.Memory}} - vb.cpus = {{.Properties.CPUs}} - end -end \ No newline at end of file