MCPcopy Index your code
hub / github.com/remind101/empire

github.com/remind101/empire @v0.13.0

repository ↗ · DeepWiki ↗ · release v0.13.0 ↗ · Ask this repo → · + Follow
2,548 symbols 7,755 edges 313 files 1,159 documented · 45% updated 2y agov0.13.0 · 2017-09-19★ 2,67789 open issues
README

Empire

readthedocs badge Circle CI Slack Status

Empire

Empire is a control layer on top of Amazon EC2 Container Service (ECS) that provides a Heroku like workflow. It conforms to a subset of the Heroku Platform API, which means you can use the same tools and processes that you use with Heroku, but with all the power of EC2 and Docker.

Empire is targeted at small to medium sized startups that are running a large number of microservices and need more flexibility than what Heroku provides. You can read the original blog post about why we built empire on the Remind engineering blog.

Quickstart

Install

To use Empire, you'll need to have an ECS cluster running. See the quickstart guide for more information.

Architecture

Empire aims to make it trivially easy to deploy a container based microservices architecture, without all of the complexities of managing systems like Mesos or Kubernetes. ECS takes care of much of that work, but Empire attempts to enhance the interface to ECS for deploying and maintaining applications, allowing you to deploy Docker images as easily as:

$ emp deploy remind101/acme-inc:master

Heroku API compatibility

Empire supports a subset of the Heroku Platform API, which means any tool that uses the Heroku API can probably be used with Empire, if the endpoint is supported.

As an example, you can use the hk CLI with Empire like this:

$ HEROKU_API_URL=<empire_url> hk ...

However, the best user experience will be by using the emp command, which is a fork of hk with Empire specific features.

Routing

Empire's routing layer is backed by internal ELBs. Any application that specifies a web process will get an internal ELB attached to its associated ECS Service. When a new version of the app is deployed, ECS manages spinning up the new versions of the process, waiting for old connections to drain, then killing the old release.

When a new internal ELB is created, an associated CNAME record will be created in Route53 under the internal TLD, which means you can use DNS for service discovery. If we deploy an app named feed then it will be available at http://feed within the ECS cluster.

Apps default to only being exposed internally, unless you add a custom domain to them. Adding a custom domain will create a new external ELB for the ECS service.

Deploying

Any tagged Docker image can be deployed to Empire as an app. Empire doesn't enforce how you tag your Docker images, but we recommend tagging the image with the git sha that it was built from (any any immutable identifier), and deploying that.

When you deploy a Docker image to Empire, it will extract a Procfile from the WORKDIR. Like Heroku, you can specify different process types that compose your service (e.g. web and worker), and scale them individually. Each process type in the Procfile maps directly to an ECS Service.

Contributing

Pull requests are more than welcome! For help with setting up a development environment, see CONTRIBUTING.md

Community

We have a google group, empire-dev, where you can ask questions and engage with the Empire community.

You can also join our Slack team for discussions and support.

Extension points exported contracts — how you extend this code

Event (Interface)
Event represents an event triggered within Empire. [10 implementers]
events.go
Authenticator (Interface)
Authenticator represents something that, given a username, password and OTP can authenticate an Empire user. [6 implementers]
server/auth/auth.go
Provisioner (Interface)
Provisioner is something that can provision custom resources. [5 implementers]
pkg/cloudformation/customresources/customresources.go
Deployer (Interface)
Deployer represents something that can deploy a github deployment. [5 implementers]
server/github/deployer.go
ProcfileExtractor (Interface)
ProcfileExtractor represents something that can extract a Procfile from an image. [4 implementers]
registry.go
SigningMethod (Interface)
Implement SigningMethod to add new methods for signing or verifying tokens. [4 implementers]
internal/jwt/signing_method.go
Protocol (Interface)
Protocol represents a service that a process exposes, like HTTP/HTTPS/TCP or SSL. [4 implementers]
twelvefactor/twelvefactor.go
Stats (Interface)
Stats provides an interface for generating instruments, like guages and counts. [4 implementers]
stats/stats.go

Core symbols most depended-on inside this repo

String
called by 790
events.go
Set
called by 62
scheduler/cloudformation/clients.go
Add
called by 60
pkg/httpmock/httpmock.go
yaml_parser_update_buffer
called by 58
procfile/internal/yaml/readerc.go
NewRequest
called by 57
pkg/heroku/heroku.go
Parse
called by 53
internal/jwt/parser.go
Exec
called by 51
internal/migrate/migrate.go
Error
called by 46
events.go

Shape

Function 1,084
Method 930
Struct 397
TypeAlias 76
Interface 44
FuncType 17

Languages

Go100%

Modules by API surface

scheduler/cloudformation/cloudformation.go80 symbols
empire.go66 symbols
scheduler/cloudformation/cloudformation_test.go57 symbols
events.go55 symbols
procfile/internal/yaml/emitterc.go53 symbols
procfile/internal/yaml/scannerc.go48 symbols
server/cloudformation/ecs.go47 symbols
twelvefactor/twelvefactor.go38 symbols
scheduler/cloudformation/template.go32 symbols
procfile/internal/yaml/yamlh.go32 symbols
procfile/internal/yaml/decode.go32 symbols
procfile/internal/yaml/apic.go30 symbols

Datastores touched

empireDatabase · 1 repos
postgresDatabase · 1 repos

For agents

$ claude mcp add empire \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact