Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify initialization of Empire core #692

Merged
merged 3 commits into from
Dec 14, 2015
Merged

Simplify initialization of Empire core #692

merged 3 commits into from
Dec 14, 2015

Conversation

ejholmes
Copy link
Contributor

Closes #688
Closes #606
Fixes #624
Fixes #525

This moves all of the configuration into cmd/empire. empire.New goes from 116 lines to just 20 lines and this makes it really simple to use a different scheduler implementation, since it's now just:

e := empire.New(db, empire.Options{})
e.Scheduler = someScheduler

This also makes it almost impossible to improperly configure empire when starting up, because it won't use fake implementations of interfaces. Everything is much more explicit now.

ECS configuration is now also logged from cmd/empire on start, making it easier to debug configuration issues:

server_1   | 2015/12/13 04:27:13 Using ECS backend with the following configuration:
server_1   | 2015/12/13 04:27:13   Cluster: empire-e01a8fac-Cluster-1L3NSOKE3TM4G
server_1   | 2015/12/13 04:27:13   ServiceRole: empire-e01a8fac-ServiceRole-1NX8XQ7IWC3LS
server_1   | 2015/12/13 04:27:13   InternalSecurityGroupID: sg-e7387381
server_1   | 2015/12/13 04:27:13   ExternalSecurityGroupID: sg-1938737f
server_1   | 2015/12/13 04:27:13   InternalSubnetIDs: [subnet-bb01c4cd subnet-c85f4091]
server_1   | 2015/12/13 04:27:13   ExternalSubnetIDs: [subnet-bb01c4cd subnet-c85f4091]
server_1   | 2015/12/13 04:27:13   ZoneID: Z3GZSDLUUUW245
server_1   | 2015/12/13 04:27:13 Streaming logs are disabled
server_1   | 2015/12/13 04:27:13 Starting on port 8080

@@ -160,6 +160,8 @@ func TestClientGetUser(t *testing.T) {
}

func TestClientIsMember(t *testing.T) {
t.Skip("This test is brittle")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in #687

@phobologic
Copy link
Contributor

👍

ejholmes added a commit that referenced this pull request Dec 14, 2015
Simplify initialization of Empire core
@ejholmes ejholmes merged commit 3bd21d2 into master Dec 14, 2015
@ejholmes ejholmes deleted the simplify branch December 14, 2015 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants