Commit Graph

80 Commits

Author SHA1 Message Date
Iago López Galeiras
5cb5c7d42e Fix shfmt issues 2017-01-18 11:51:41 +01:00
Iago López Galeiras
43d9f38c5e Fix various linter issues
Found via shellcheck.
2017-01-18 11:51:41 +01:00
Michael Schubert
c3bd60b544 scope launcher script: allow setting SCOPE{_APP,}_CONTAINER_NAME
Helpful when you want to run multiple instances of scope on your system,
e.g. for testing.

Signed-off-by: Michael Schubert <michael@kinvolk.io>
2016-12-19 11:12:28 +01:00
Simon Howe
71e04a27ba Fixes ./scope launch starting probe under d4m 2016-12-15 15:26:20 +01:00
Mike Lang
2562567de4 scope launch script: Don't try to detect if listing scope binary args worked
We can't easily do this since scope exits failure when -h is passed, so we
can't distinugish between success and failure.
2016-12-12 11:26:01 -08:00
Mike Lang
3000adfb9a scope launch script: Don't print container id
It's not useful and it's confusing.
Replaced with a generic "it worked" message.
2016-12-12 11:26:01 -08:00
Mike Lang
7333b99b89 scope launch script: Make the default port clear 2016-12-12 11:26:01 -08:00
Mike Lang
0e4e95e4fa scope launch script: Edit help text to make positional args clearer 2016-12-12 11:26:01 -08:00
Mike Lang
3a69c19d6e scope launch script: Also recongize -h, -help and --help 2016-12-12 11:26:01 -08:00
Mike Lang
90709b61aa scope launch script: Fix and consolidate usage info
Instead of different usage info for "scope help", show the same always.
Also correct it for what the script actually does,
and always display the scope binary args.
2016-12-12 11:26:01 -08:00
Mike Lang
b1a1c7d427 scope launch script: Attempt to quote args in "scope command"
As indicated by the TODO, any args passed into the command do not get escaped
when output, so for example:
	scope command "foo bar"
would output results like:
	foo bar
instead of
	"foo bar"
or
	foo\ bar

The "right" way to do this seems to be printf %q, which prints a quoted version of the string.
However this format specifier is not available in POSIX sh (though it does work in many
implementations of it, such as the ones provided by bash which make up the likely majority of
real-world usage).
This code is a compromise that uses the added functionality where available,
while still falling back to the old behaviour when it isn't.
2016-12-12 11:26:00 -08:00
Mike Lang
21431bb4b0 scope launch script: Fix shellcheck linter warnings
By far the majority of these were variables which were not quoted.
While, yes, right now we can guarentee most of these variables will never contain spaces,
this could someday change and applying quoting as a universal rule prevents future mistakes.

The ARGS="$@" -> "$*" change is purely stylistic and mainly is used to indicate the intent that
we actually wanted to concatenate all the args by spaces, not keep them seperated as "$@" would
in many situations, but not this one.

Several warnings remain, in places where we intentionally want to split a variable on whitespace,
or otherwise do what shellcheck is warning us against.

Of note is shellcheck warning SC2166, which says to prefer [ foo ] || [ bar ] over [ foo -o bar ]
as the -a and -o flags have differing behaviour on some systems.
I've opted to keep these for now, since the version check test command would need to be replaced by
a LOT of subshells to achieve the same effect, which feels dirtier.
2016-12-12 11:26:00 -08:00
Alfonso Acosta
f7c0b75eff Quote properly 2016-10-31 19:29:05 +00:00
Alfonso Acosta
5433c256c7 Fix argument escaping in Scope
By naively using echo and cat to print to serialize/deserealize arguments we were garbling
arguments with special characters and whitespaces
2016-10-25 15:35:48 +00:00
Alessandro Puccetti
5b67adc137 scope: fix stop command for OSX
Before this patch, `scope stop` was not stopping scope-app
2016-08-17 14:09:58 +02:00
Alfonso Acosta
0a1232ec3c Don't complain when stopping Scope if it wasn't running 2016-08-11 15:21:06 +00:00
Mike Lang
7aec1e172d launcher script: Fix inconsistent whitespace 2016-08-09 09:57:12 -07:00
Alfonso Acosta
9740fcca40 Merge pull request #1765 from weaveworks/release-0.16
Release 0.16.2
2016-08-05 16:38:43 +01:00
Ilya Dmitrichenko
d7c40827c8 Docker for Mac 1.12 has only one network mode (close #1755) 2016-08-05 15:06:07 +01:00
Matthias Radestock
1ffdafdf8c cosmetic: remove trailing whitespace 2016-07-27 08:27:18 +01:00
Ilya Dmitrichenko
70b3f32e9c Check if app and probe are running first (fix #1679) 2016-07-14 14:47:33 +01:00
Alfonso Acosta
5c3ac511bc Use exit instead of return 2016-07-13 16:43:58 +00:00
Alfonso Acosta
93c4e4537b Review feedback 2016-07-13 14:25:57 +00:00
Alfonso Acosta
7367b60428 Review feedback 2016-07-13 14:23:28 +00:00
Alfonso Acosta
95a45f991d Review feedback 2016-07-13 14:17:04 +00:00
Alfonso Acosta
98707c2a81 Refactor scope script 2016-07-13 14:11:20 +00:00
Ilya Dmitrichenko
901e1a474a Fix Docker for Mac issue with --service-token (close #1649) 2016-07-13 13:50:28 +01:00
Ilya Dmitrichenko
0ad6392a78 Ensure plugins dir exists (close #1649) 2016-07-11 17:52:36 +01:00
Alfonso Acosta
74e508671c Merge pull request #1606 from weaveworks/1594-no-sudo-for-launch
Don't prepend `scope launch` with sudo
2016-07-05 11:13:38 +01:00
Alfonso Acosta
59ec3b863a Review comments 2016-07-04 17:22:58 +00:00
Alfonso Acosta
5d23432a6c Check write access to unix socket 2016-07-04 17:08:49 +00:00
Tom Wilkie
8e1a6b3667 Add dry run flag to scope, so when launched we can check the args are valid. (#1609)
* Add dry run flag to scope, so when launched we can check the args are valid.

* Try and parse listen address and error early.

* Specify that -dry-run is for internal use only.
2016-06-27 10:13:55 +01:00
Ilya Dmitrichenko
25685c55f9 Fix Docker for Mac check (#1551) 2016-06-04 08:04:08 +01:00
Alfonso Acosta
a7544498cb Check HOME variable before using it (#1500) 2016-05-13 09:49:22 +01:00
Ilya Dmitrichenko
0bea9990cd Fix Docker for Mac (again!) (#1448)
* Make Scope work on Docker for Mac (#1414)

* Check if Docker for Mac is used and run app separately

* Improve `check_probe_only`

* Fix d4m detection

* Fix Docker for Mac test by checking if it is in use
2016-05-10 20:28:52 +02:00
Tom Wilkie
77be6863d4 Revert "Make Scope work on Docker for Mac" (#1439) 2016-05-06 13:28:51 +01:00
Ilya Dmitrichenko
3e7dd1abbf Make Scope work on Docker for Mac (#1414)
* Check if Docker for Mac is used and run app separately

* Improve `check_probe_only`

* Fix d4m detection
2016-05-05 18:15:58 +01:00
Tom Wilkie
cb0901e8e1 Move all the flag parsing to main.go; implement scope help 2016-04-20 15:48:43 +01:00
Paul Bellamy
7632e0b3c5 Adding support for plugins, with basic example of iowait, and ebpf
Squash of:
* Include plugins in the report
* show plugin list in the UI
* moving metric and metadata templates into the probe reports
* update js for prime -> priority
* added retry to plugin handshake
* added iowait plugin
* review feedback
* plugin documentation
2016-04-12 17:22:14 +01:00
Tom Wilkie
425013bdd9 Update go-checkpoint library and add link to README. 2016-02-29 11:15:14 +00:00
Tom Wilkie
34ca87c98e Review feedback. 2016-02-04 15:48:17 +00:00
Tom Wilkie
2e9aa9314d Periodically check for newer versions of scope. 2016-02-04 15:22:01 +00:00
Tom Wilkie
667dd0f1de Rationalise version handling 2015-12-11 12:23:01 +00:00
Tom Wilkie
045a1feba0 Update the docker version we embed into the scope image to 1.6.2 in sync with weave 1.3 changes. 2015-11-30 09:38:42 +00:00
Tom Wilkie
d779a4e5da Make sure scope can start after an upgrade. 2015-11-03 14:16:28 +00:00
Alfonso Acosta
543109a524 Make Docker version extraction more robust 2015-10-26 18:07:11 +00:00
Tom Wilkie
163af5e681 Review feedback 2015-10-19 14:33:42 +00:00
Tom Wilkie
7f21622d37 Introduce docker version check into scope script, error on <1.5.0 2015-10-19 14:33:41 +00:00
Paul Bellamy
745c94f07f Make getting the docker run command easier. 2015-10-19 12:24:10 +01:00
Tom Wilkie
88686b5c6c Review Feedback 2015-09-30 13:40:25 +00:00