Commit Graph

76 Commits

Author SHA1 Message Date
Jean-Laurent de Morlhon 45cf74508a Better naming & cleanup
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-12-24 16:11:46 +01:00
Euan 8d98d2b7b7 amazonec2: Convert EC2 API calls to official SDK
This does an almost 1-to-1 translation of API calls.

The differences are as follows:
1. Use the SDK waiter for spot instance request fulfillment
2. Uses the toplevel private/public ip fields instead of the
   networkinterface's fields
3. Recognizes the 'Terminated' state as an error explicitly instead of
   implicitly.
4. Uses filters on DescribeSecurityGroups to find the correct one more
   efficiently and to limit to a given VPC.

Other than that, it really should be identical apart from the perhaps
obvious error message differences.

Signed-off-by: Euan <euank@euank.com>
2015-12-24 15:57:02 +01:00
Jean-Laurent de Morlhon 6d5bc99387 Typo
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-11-30 17:23:11 +01:00
Vladimir Varankin 0735f3f447 fix drivers GetUrl to build propper IPv6 addr
Signed-off-by: Vladimir Varankin <nek.narqo+git@gmail.com>
2015-11-13 13:19:15 +03:00
Olivier Gambier 89d9854943 Another pass at linting
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-11-10 16:58:14 +01:00
David Gageot 11922080a1 FIX #2171 Fix faulty flag and add tests for SetConfigFromFlags
Signed-off-by: David Gageot <david@gageot.net>
2015-11-05 18:57:03 +01:00
David Gageot 6c5dc41e6d Revert "Remove useless duplication on GetSSHHostname"
This reverts commit b6462eb6d0.

Signed-off-by: David Gageot <david@gageot.net>
2015-10-26 18:47:14 +01:00
Nathan LeClaire 8b9291de64 Merge pull request #2033 from dmp42/03-cleanup
Code cleanup
2015-10-23 11:27:44 -07:00
Olivier Gambier b6462eb6d0 Remove useless duplication on GetSSHHostname
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-10-21 13:48:13 -07:00
feelobot 6b7628a175 Use SDK to Validate VpcID with SubnetId
Signed-off-by: feelobot <felix.a.rod@gmail.com>
2015-10-20 12:37:33 -07:00
Dave Henderson 2a6e3dbf40 Fix log.* method calls which meant to be log.*f
Stuff like `log.Debug("foo bar: %s", baz)` really wants to be
`log.Debugf("foo bar: %s", baz)`...

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-17 15:59:25 -04:00
Nathan LeClaire c8edb33ecd Move towards using external binaries / RPC plugins
- First RPC steps

- Work on some flaws in RPC model

- Remove unused TLS settings from Engine and Swarm options

- Add code to correctly encode data over the network

- Add client driver for RPC

- Rename server driver file

- Start to make marshal make sense

- Fix silly RPC method args and add client

- Fix some issues with RPC calls, and marshaling

- Simplify plugin main.go

- Move towards 100% plugin in CLI

- Ensure that plugin servers are cleaned up properly

- Make flag parsing for driver flags work properly

Includes some work carried from @dmp42 updating the build process and
tests to use the new method.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-16 16:34:56 -07:00
Nathan LeClaire b5927f10c4 Make libmachine usable by outside world
- Clear out some cruft tightly coupling libmachine to filestore

- Comment out drivers other than virtualbox for now

- Change way too many things

- Mostly, break out the code to be more modular.

- Destroy all traces of "provider" in its current form.  It will be
brought back as something more sensible, instead of something which
overlaps in function with both Host and Store.

- Fix mis-managed config passthru

- Remove a few instances of state stored in env vars

- This should be explicitly communicated in Go-land, not through the
shell.

- Rename "store" module to "persist"

- This is done mostly to avoid confusion about the fact that a concrete
instance of a "Store" interface is oftentimes referred to as "store" in
the code.

- Rip out repetitive antipattern for getting store

- This replaces the previous repetive idiom for getting the cert info, and
consequently the store, with a much less repetitive idiom.

- Also, some redundant methods in commands.go for accessing hosts have
either been simplified or removed entirely.

- First steps towards fixing up tests

- Test progress continues

- Replace unit tests with integration tests

- MAKE ALL UNIT TESTS PASS YAY

- Add helper test files

- Don't write to disk in libmachine/host

- Heh.. coverage check strikes again

- Fix remove code

- Move cert code around

- Continued progress: simplify Driver

- Fixups and make creation work with new model

- Move drivers module inside of libmachine

- Move ssh module inside of libmachine

- Move state module to libmachine

- Move utils module to libmachine

- Move version module to libmachine

- Move log module to libmachine

- Modify some constructor methods around

- Change Travis build dep structure

- Boring gofmt fix

- Add version module

- Move NewHost to store

- Update some boring cert path infos to make API easier to use

- Fix up some issues around the new model

- Clean up some cert path stuff

- Don't use shady functions to get store path :D

- Continue artifact work

- Fix silly machines dir bug

- Continue fixing silly path issues

- Change up output of vbm a bit

- Continue work to make example go

- Change output a little more

- Last changes needed to make create finish properly

- Fix config.go to use libmachine

- Cut down code duplication and make both methods work with libmachine

- Add pluggable logging implementation

- Return error when machine already in desired state

- Update example to show log method

- Fix file:// bug

- Fix Swarm defaults

- Remove unused TLS settings from Engine and Swarm options

- Remove spurious error

- Correct bug detecting if migration was performed

- Fix compilation errors from tests

- Fix most of remaining test issues

- Fix final silly bug in tests

- Remove extraneous debug code

- Add -race to test command

- Appease the gofmt

- Appease the generate coverage

- Making executive decision to remove Travis coverage check

In the early days I thought this would be a good idea because it would
encourage people to write tests in case they added a new module.  Well,
in fact it has just turned into a giant nuisance and made refactoring
work like this even more difficult.

- Move Get to Load
- Move HostListItem code to CLI

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 12:30:15 -07:00
Matt McNaughton a0b9d179b1 Fix Go Vet errors
This commit makes no changes to code execution, but rather resolves some
`go vet` errors, the majority of which relate to `fatal` being used
instead of `fatalf` during testing.

Signed-off-by: Matt McNaughton <mattjmcnaughton@gmail.com>
2015-09-14 22:37:16 -04:00
Rodrigo Reis 04b435c832 Amazon Ec2 - Add the option amazonec2-use-private-address
Signed-off-by: Rodrigo Reis <rodrigo@rodrigoreis.com>
2015-08-11 07:29:13 -04:00
Dave Henderson 3d002187fe Refactoring drivers to embed drivers.DefaultDriver
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-07-07 11:24:00 -04:00
Evan Hazlett f82032b28d remove provider
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-05-21 10:41:03 -04:00
Evan Hazlett cb6eb6bb77
amazonec2: instance profile env var
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-05-13 15:00:52 -04:00
zhee 8821e7e5ee [EC2] Add Monitoring flag
Signed-off-by: Koichi Shiraishi <zcheeee@gmail.com>
2015-05-01 10:41:47 +09:00
Nathan LeClaire 142ffadc2c Refactor logging to focus on simple STDOUT/STDERR
This also lays the foundation for the possibility of log drivers in the
future, if it is decided that is a direction to pursue.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-30 12:04:52 -07:00
Simon Thulbourn d0651d0273 Add --amazonec2-private-address-only
Signed-off-by: Simon Thulbourn <simon+github@thulbourn.com>
2015-04-30 16:42:44 +01:00
Vincent Bernat 44be16c49f drivers: don't let the driver wait for SSH/Docker
Waiting for SSH to start or Docker to be available is a step done
directly in the framework (in libmachine). There is no need for the
driver to do that.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-04-21 07:11:41 +02:00
Evan Hazlett 460cc02ea5
ec2: update spot instance message
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-04-14 17:03:38 -04:00
Qicong Chen 9b577aabb6 Supports #226
Signed-off-by: Qicong Chen <qicongchen92@gmail.com>

Fix logging problem

Signed-off-by: Qicong Chen <qicongchen92@gmail.com>
2015-04-14 14:48:27 -04:00
wlan0 ee941e979b make ssh username configurable for ec2
Signed-off-by: wlan0 <sidharthamn@gmail.com>
2015-04-07 18:00:06 -07:00
Guillaume Giamarchi fb1362ea05 Remove dead code
Signed-off-by: Guillaume Giamarchi <guillaume.giamarchi@gmail.com>
2015-03-27 19:25:11 +01:00
Evan Hazlett 5403171328 ec2: fix bug where ip address was not updated upon restart
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-17 11:08:20 -04:00
Evan Hazlett bc6b66c122
drivers: specify defaults if values are missing; i.e. config updates
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-11 22:59:28 -04:00
Evan Hazlett 645bf8ab90
amazonec2: add SSHUser to driver
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-11 22:04:52 -04:00
Evan Hazlett 3347d1e82f
rename HypervisorType to ProviderType
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-09 16:03:36 -04:00
Evan Hazlett c76d1a253f
revert to GetSSHHostname based on feedback from @nathanleclaire
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-09 15:55:18 -04:00
Evan Hazlett 0577f66f5d
initial work to get amazonec2 and none drivers to upgrade driver interface
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-09 12:50:40 -04:00
Evan Hazlett b8ef936e90
add AuthorizePort and DeauthorizePort
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-09 10:50:48 -04:00
Nathan LeClaire 1e983d5ff6 Introduce universal poll retries function
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-03-04 16:41:48 -08:00
Nathan LeClaire 8d0bf21c6d Fix panic when instance doesn't exist remotely
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-03-03 14:48:04 -08:00
Nathan LeClaire a7d1a70442 Fix IP address not being set correctly due to race
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-03-03 14:47:06 -08:00
Evan Hazlett 5f01d4cda5 Merge pull request #449 from sthulb/aws-assign-roles
IRC Req: EC2 IAM Instance Profile
2015-03-02 17:12:27 -05:00
Simon Thulbourn 2ce70bf5ac adds the ability to set an instance role for ec2 instances
Signed-off-by: Simon Thulbourn <simon+github@thulbourn.com>
2015-03-02 19:01:22 +00:00
Evan Hazlett f0c70ee8ed ec2: do not try to auth swarm port if exists
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-03-02 13:14:41 -05:00
Evan Hazlett 10b3d7fd9a
ec2: remove unneeded subnetid var
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-27 18:08:33 -05:00
Evan Hazlett 32ed441fbb
ec2: use filters for GetSubnets; check subnetId in PreCreate for driver
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-27 16:51:48 -05:00
Evan Hazlett 19f5b0cb54
ec2: check subnet exists in vpc
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-27 15:31:48 -05:00
Andy Watson 0d83d89dd2 PR updates
Signed-off-by: Andy Watson <andrewmoorewatson@gmail.com>
2015-02-26 23:26:23 -05:00
Andrew Watson dac96263be Fix #629 by adding PrivateIPAddress to config.json
Signed-off-by: Andrew Watson <andrew@ionicsecurity.com>
2015-02-26 14:53:36 -05:00
Evan Hazlett 54f36078f4 do not show debug for docker install by default; refactor install out of drivers
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-23 17:14:32 -05:00
Andrew Watson 9ff6dbe0b2 Fixes #576 by return the err
Signed-off-by: Andrew Watson <andrewmoorewatson@gmail.com>
2015-02-21 00:15:47 -05:00
Evan Hazlett 3a3ef6f45e add discovery to machine config; show swarm membership
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-20 13:07:21 -08:00
Evan Hazlett a949e12b6e store swarm config in driver; vendor Godeps; generate swarm token
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-20 13:07:21 -08:00
Evan Hazlett 4e95c2760f authorize swarm port when master is in ec2; fix max dns name for azure
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-20 13:07:20 -08:00
Evan Hazlett 557d03a849 tls fixes to support swarm; test updates; improved provisioning logging
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-02-20 13:07:20 -08:00