Commit Graph

769 Commits

Author SHA1 Message Date
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
Hector Sanjuan
bde7b4e3d9
Merge pull request #264 from ipfs/feat/code_quality
Feat/code quality
2017-12-06 18:46:53 +01:00
Hector Sanjuan
9f8849fb18
Merge pull request #262 from ipfs/fix/lock-service
ipfs-cluster-service lock
2017-12-06 17:58:41 +01:00
Wyatt
ad492d20ae fix #254, execution locking:
ipfs-cluster-service now locks before running the daemon and state
upgrade commands.  Locking mechanism heavily inspired by ipfs, see
go-ipfs fsrepo.  Unlock called on exit to free up repo.  one lockfile
per repo. A very simple sharness test checks that two service
invocations cannot occur.

A longstanding sharness/ci logging issue is addressed by exporting
verbose=t into the travis environment.  Now output of commands from
within sharness test strings are displayed during travis runs.

License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
2017-12-06 11:14:53 -05:00
Hector Sanjuan
f289394985 fix gofmt: format some files with gofmt -s
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:54 +01:00
Hector Sanjuan
0693ff429e fix spelling: Fix spelling errors
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:54 +01:00
Hector Sanjuan
7cd2d3d0e1 fix inef assignments: fix some unused assignments
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:52 +01:00
Hector Sanjuan
6d3edbb4a5 feat contribution guidelines: add guidelines
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:50 +01:00
Hector Sanjuan
b0d61ab9cb feat make check: add make check to run go vet and golint
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:43 +01:00
Hector Sanjuan
9a246a237d fix go vet: address go vet warnings
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:41 +01:00
Hector Sanjuan
c0628e43ff fix golint: Address a few golint warnings
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-12-06 15:15:38 +01:00