Commit Graph

1329 Commits

Author SHA1 Message Date
Wyatt Daviau
a99b403273 Sharness hardening:
Better error messages in test-lib init functions and ipfshttp
Cleanup functions are now called after every test file

License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-01-09 14:17:21 -05:00
Hector Sanjuan
bda2674c4b
Merge pull request #285 from ipfs/fix/snapshot-wait-for-index
Fix #275: Attempt to wait for updates when shutting down
2018-01-09 15:39:37 +01:00
Hector Sanjuan
89b8fe106e Fix #275: Wait for Raft updates before snapshotting on shutdown
Raft will fail to take a snapshot when applied index is
different from the last index. Therefore, we wait for
all updates to be aplied before snapshotting.

If still it doesn't work, we retry a few times.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-01-09 15:02:47 +01:00
ZenGround0
abebe498cb
Merge pull request #282 from ipfs/feat/docker-test
fix/basic-docker-tests
2018-01-05 08:13:19 -05:00
Wyatt Daviau
66606a98c9 Tweaking wait time
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-01-05 07:45:41 -05:00
Hector Sanjuan
0c395e6156
Merge branch 'master' into feat/docker-test 2018-01-05 10:39:15 +01:00
Hector Sanjuan
6d299f9848
Merge pull request #283 from ipfs/feat/migration-framework
Generalize migration process
2018-01-05 10:33:50 +01:00
Wyatt Daviau
652ba567a2 More general migration framework in place
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-01-04 23:07:52 -05:00
Wyatt Daviau
79bc8caddf Bring sleep times within reason
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-01-04 16:51:50 -05:00
Wyatt Daviau
c2c3d6c992 Adjusting timeout to see if that helps
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-01-04 16:04:06 -05:00
Wyatt Daviau
54f34ca36e make docker impl + launched from travis
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2018-01-04 15:41:16 -05:00
Hector Sanjuan
84cc12c0b7
Merge pull request #276 from ipfs/feat/state-cmds
Feat #253 state import/export/cleanup
2018-01-02 16:39:55 +01:00
Wyatt Daviau
8361b8afe4 Add and refine cli interface for cluster state
Added import, export, cleanup.
Changed state interface.
New sharness tests.

License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2017-12-28 09:06:28 -05:00
Hector Sanjuan
0f3391b015
Merge pull request #274 from ipfs/feat/201-version-subcmd
cluster-service: add version subcommand and change some startup logging
2017-12-13 16:56:42 +01:00
Hector Sanjuan
2b6dfa45cd cluster-service: add version subcommand and change some startup logging
The --version flag is default from our cli library so I left that. The
version subcommand prints only the version number + the short commit
so it's a bit more easy to parse.

I have additionally reduced the amount of output on start up by converting
some messages to debug. I wish there was a level between INFO and DEBUG
though.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-13 10:25:01 +01:00
Hector Sanjuan
5bc33d7df3
Merge pull request #272 from ipfs/docs/178-ctl-exit-codes
Fix #178: Document exit status for ipfs-cluster-ctl
2017-12-12 17:45:38 +01:00
Hector Sanjuan
8eea4baf3d Fix #178: Document exit status for ipfs-cluster-ctl
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-12 16:58:56 +01:00
Hector Sanjuan
9bdf581122
Merge pull request #270 from ipfs/feat/state-update-guide
Docs/guide: describe upgrade procedures in more detail
2017-12-12 16:33:52 +01:00
Hector Sanjuan
af3a8cfbf5 docs/guide: specify that folder is not deleted, but backed up
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-12 10:33:28 +01:00
Hector Sanjuan
10331e2678
gx publish 0.3.1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:11:28 +01:00
Hector Sanjuan
91b3763869
Release 0.3.1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:11:10 +01:00
Hector Sanjuan
620886366d release.sh: clean before releasing
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:10:16 +01:00
Hector Sanjuan
847a8a78c4 Do not leave tag annotation file around when releasing
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 14:05:26 +01:00
Hector Sanjuan
5200aadac6 Docs/guide: describe upgrade procedures in more detail
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:33:32 +01:00
Hector Sanjuan
e2e2c98eb1 ROADMAP.md: Q4 update. Better late than never.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:08:47 +01:00
Hector Sanjuan
313494a2f6 Changelog: v0.3.1
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:08:43 +01:00
Hector Sanjuan
7f06c9aed7 # This is a combination of 2 commits.
# This is the 1st commit message:

Captain.log.update

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>

# The commit message #2 will be skipped:

# Captain log
#
# License: MIT
# Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-11 13:07:12 +01:00
Hector Sanjuan
4409df681b
Merge pull request #267 from ipfs/codeclimate
Adjust some codeclimate settings
2017-12-08 21:08:53 +01:00
Hector Sanjuan
2fa54ff9d7
Merge pull request #266 from ipfs/feat/client_features
Feat/client features
2017-12-08 17:28:41 +01:00
Hector Sanjuan
d6bb5bb538 cluster-ctl: use standard error types
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 17:05:21 +01:00
Hector Sanjuan
b2651b52ea Refactor some stuff to please codeclimate
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 17:05:21 +01:00
Hector Sanjuan
763bd060a5 Increase lines of code per method in codeclimate
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 16:57:44 +01:00
Hector Sanjuan
a0025587eb Adjust some codeclimate settings
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 16:47:15 +01:00
Hector Sanjuan
b21d313547 rest/client: Return regular errors.
We had a problem happening when assigning the returned *api.Error
to default 'error' type.

Things like "if err != nil" would not work even when *api.Error is nil
I'm not sure why this happens, but this is very confusing for the user
integrating on top. It is better that we just return plain go errors.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 15:39:30 +01:00
Hector Sanjuan
62e8a011d0 rest/client: Allow passing Host and Port in the config.
This is easier in many cases and does not make the user
parse a multiaddress.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 15:38:30 +01:00
Hector Sanjuan
146e8672c4
Merge pull request #265 from ipfs/fix/api-client
Fix: client requests and multiaddresses parsing
2017-12-08 12:31:52 +01:00
Hector Sanjuan
faeaf5dc6a api: attempt to trick code climate on dup code
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:09:52 +01:00
Hector Sanjuan
6bf24ccca7 migrate.go: gofmt
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
7dc9798894 cluster_config: de-duplicate multiaddress parsing code
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
50859a8954 codeclimate: add .codeclimate.yml
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
6a243df4da api: Support /ws/ and /dns/ multiaddresses parsing. Log all errors
The multiaddresses protocols for websockets and dns are only registered
with init() function when loading the modules. ipfs-cluster-ctl
uses just the api, which did not load these modules so converting
from serialized types caused bad panics.

We have also ignored errors in the api library under the thinking that it
would only parse things serialized by us, but this has made parsing errors
to go unnoticed. From now, all errors are logged and some precautions
are taking to better handle the possibility of nil objects.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 01:05:49 +01:00
Hector Sanjuan
72928d5e3b client: do not cancel request context while reading the answer
Apparently, cancelling the request context closes the response body
prematurely, before it's being fully read.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-08 00:22:01 +01:00
Hector Sanjuan
34c815b0ee
Merge pull request #263 from ipfs/feat/260-api-client
Fix #260: Add REST API client and use it in ipfs-cluster-ctl
2017-12-07 17:08:50 +01:00
Hector Sanjuan
0c469b85e1 cluster-ctl: exit with error on errors.
As before, exit status 1 means a client application error and
exit status 2 means a server-returned error.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 12:00:28 +01:00
Hector Sanjuan
7b9ef115a2 rest/api/client: re-use the http client
This allows taking advantage of connection keep alive by having the
api client re-use the same connection. Additionally, an option
to close connections after every request is provided.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 11:27:37 +01:00
Hector Sanjuan
660b2375fd cluster-ctl: Fix json output for slice responses.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 11:27:01 +01:00
Hector Sanjuan
6d7c65aaa6 Review #260: Address comments
* Set default logging facility
* Remove old keep-alive comment in tests
* Use a port for TestPeersWithErrors which is not default

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-07 00:04:51 +01:00
Hector Sanjuan
e0e32025de cluster-service: Do not export Locker. Fix golint.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 20:12:55 +01:00
Hector Sanjuan
de41394180 Makefile: Update to latest gx and gx-go
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 20:12:55 +01:00
Hector Sanjuan
0a8edc17c9 Fix #260: Add REST API client and use it in ipfs-cluster-ctl
This adds the pakage api/rest/client which implements a go-client
for the REST API component. It also update the ipfs-cluster-ctl
tool to rely on it.

Originally, I wanted this to live it in it's own separate repository,
but the api client uses /api/types.go, which is part of cluster.

Therefore it would need to import all of cluster as a dependency.
ipfs-cluster-ctl would also need to import go-ipfs-cluster-api-client
as a dependency, creating circular gx deps which would be a mess to
maintain.

Only the splitting of cluster in multiple repositories (at least for
api, rest, ipfs-cluster-ctl, rest/client and test) would allow better
dependency management by allowing rest/client and the ctl tool
to only import what is needed, but this is something which brings
maintenance costs and can probably wait a bit until cluster is more stable.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 20:12:01 +01:00