diff --git a/Makefile b/Makefile index f470bad82..6a2fa6a47 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ test-all: # By default compiles will use all cpu cores, use BUILD_JOBS to control number # of parallel builds: `BUILD_JOBS=2 make plugins` # -# Build only snapd/snapctl +# Build only snapteld/snaptel snap: bash -c "./scripts/build_snap.sh" # Build only plugins diff --git a/README.md b/README.md index bce1a1101..e2c5d357e 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ The key features of Snap are: Some additionally important notes about how Snap works: -* Multiple management modules including: [CLI](docs/SNAPCTL.md) (snapctl) and [REST API](docs/REST_API.md) (each of which can be turned on or off) +* Multiple management modules including: [CLI](docs/SNAPTEL.md) (snaptel) and [REST API](docs/REST_API.md) (each of which can be turned on or off) * Secure validation occurs via plugin signing, SSL encryption for APIs and payload encryption for communication between components * CLI control from Linux or MacOS @@ -121,24 +121,20 @@ Tarball (choose the appropriate version and platform): ``` $ curl -sfLO https://github.com/intelsdi-x/snap/releases/download/0.18.0/snap-0.18.0-linux-amd64.tar.gz $ tar xf snap-0.18.0-linux-amd64.tar.gz -$ cp snapd /usr/local/bin -$ cp snapctl /usr/local/bin +$ cp snapteld /usr/local/sbin +$ cp snaptel /usr/local/bin ``` -Ubuntu 16.04.1 [snapd package version 2.13+](https://launchpad.net/ubuntu/+source/snapd) installs snapd/snapctl binary in /usr/bin. These executables are not related to snap-telemetry. Running `snapctl` from snapd package will result in the following error message: +NOTE: snap-telemetry packages prior to 0.19.0 installed `/usr/local/bin/{snapctl|snapd}` and these binaries have been renamed to `snaptel` and `snapteld`. snap-telemetry packages prior to 0.18.0 symlinked `/usr/bin/{snapctl|snapd}` to `/opt/snap/bin/{snapctl|snapd}` and may cause conflicts with [Ubuntu's `snapd` package](http://packages.ubuntu.com/xenial-updates/snapd). Ubuntu 16.04.1 [snapteld package version 2.13+](https://launchpad.net/ubuntu/+source/snapd) installs snapd/snapctl binary in /usr/bin. These executables are not related to snap-telemetry. Running `snapctl` from snapd package will result in the following error message: ``` $ snapctl error: snapctl requires SNAP_CONTEXT environment variable ``` -If you installed snap-telemetry package, please make sure `/usr/local/bin` is part of your $PATH and has higher priority than `/usr/bin`, or invoke the snap-telemetry snapd/snapctl binary using fully qualified path. - -NOTE: snap-telemetry packages prior to 0.18.0 symlinked `/usr/bin/{snapctl|snapd}` to `/opt/snap/bin/{snapctl|snapd}` and may cause conflicts with [Ubuntu's `snapd` package](http://packages.ubuntu.com/xenial-updates/snapd). - NOTE: If you prefer to build from source, follow the steps in the [build documentation](docs/BUILD_AND_TEST.md). The _alpha_ binaries containing the latest master branch are available here for bleeding edge testing purposes: -* snapd: [linux](http://snap.ci.snap-telemetry.io/snap/latest_build/linux/x86_64/snapd) | [darwin](http://snap.ci.snap-telemetry.io/snap/latest_build/darwin/x86_64/snapd) -* snapctl: [linux](http://snap.ci.snap-telemetry.io/snap/latest_build/linux/x86_64/snapctl) | [darwin](http://snap.ci.snap-telemetry.io/snap/latest_build/darwin/x86_64/snapctl) +* snapteld: [linux](http://snap.ci.snap-telemetry.io/snap/latest_build/linux/x86_64/snapteld) | [darwin](http://snap.ci.snap-telemetry.io/snap/latest_build/darwin/x86_64/snapteld) +* snaptel: [linux](http://snap.ci.snap-telemetry.io/snap/latest_build/linux/x86_64/snaptel) | [darwin](http://snap.ci.snap-telemetry.io/snap/latest_build/darwin/x86_64/snaptel) ### Running Snap @@ -157,16 +153,15 @@ $ systemctl start snap-telemetry If you installed Snap from binary, you can start Snap daemon via the command: ``` $ sudo mkdir -p /var/log/snap -$ sudo snapd --plugin-trust 0 --log-level 1 -o /var/log/snap & +$ sudo snapteld --plugin-trust 0 --log-level 1 --log-path /var/log/snap & ``` To view the service logs: ``` -$ tail -f /var/log/snap/snapd.log +$ tail -f /var/log/snap/snapteld.log ``` -By default, Snap daemon will be running in standalone mode and listening on port 8181. To enable gossip mode, checkout the [tribe documentation](docs/TRIBE.md). For additional configuration options such as plugin signing and port configuration see [snapd documentation](docs/SNAPD.md). - +By default, Snap daemon will be running in standalone mode and listening on port 8181. To enable gossip mode, checkout the [tribe documentation](docs/TRIBE.md). For additional configuration options such as plugin signing and port configuration see [snapteld documentation](docs/SNAPTELD.md). ### Load Plugins @@ -181,9 +176,9 @@ $ curl -sfL "https://github.com/intelsdi-x/snap-plugin-publisher-file/releases/d $ curl -sfL "https://github.com/intelsdi-x/snap-plugin-collector-psutil/releases/download/8/snap-plugin-collector-psutil_${OS}_${ARCH}" -o snap-plugin-collector-psutil ``` -Next load the plugins into Snap daemon using `snapctl`: +Next load the plugins into Snap daemon using `snaptel`: ``` -$ snapctl plugin load snap-plugin-publisher-file +$ snaptel plugin load snap-plugin-publisher-file Plugin loaded Name: file Version: 2 @@ -191,7 +186,7 @@ Type: publisher Signed: false Loaded Time: Fri, 14 Oct 2016 10:53:59 PDT -$ snapctl plugin load snap-plugin-collector-psutil +$ snaptel plugin load snap-plugin-collector-psutil Plugin loaded Name: psutil Version: 8 @@ -202,7 +197,7 @@ Loaded Time: Fri, 14 Oct 2016 10:54:07 PDT Verify plugins are loaded: ``` -$ snapctl plugin list +$ snaptel plugin list NAME VERSION TYPE SIGNED STATUS LOADED TIME file 2 publisher false loaded Fri, 14 Oct 2016 10:55:20 PDT psutil 8 collector false loaded Fri, 14 Oct 2016 10:55:29 PDT @@ -210,7 +205,7 @@ psutil 8 collector false loaded Fri, 14 Oct 2016 10:55:29 See which metrics are available: ``` -$ snapctl metric list +$ snaptel metric list NAMESPACE VERSIONS /intel/psutil/cpu/cpu-total/guest 8 /intel/psutil/cpu/cpu-total/guest_nice 8 @@ -238,7 +233,7 @@ To collect data, you need to create a task by loading a `Task Manifest`. The Tas Now, download and load the [psutil example](examples/tasks/psutil-file.yaml): ``` $ curl https://raw.githubusercontent.com/intelsdi-x/snap/master/examples/tasks/psutil-file.yaml -o /tmp/psutil-file.yaml -$ snapctl task create -t /tmp/psutil-file.yaml +$ snaptel task create -t /tmp/psutil-file.yaml Using task manifest to create task Task created ID: 8b9babad-b3bc-4a16-9e06-1f35664a7679 @@ -253,9 +248,9 @@ This starts a task collecting metrics via psutil, then publishes the data to a f $ tail -f /tmp/psutil_metrics.log ``` -Or directly tap into the data stream that Snap is collecting using `snapctl task watch `: +Or directly tap into the data stream that Snap is collecting using `snaptel task watch `: ``` -$ snapctl task watch 8b9babad-b3bc-4a16-9e06-1f35664a7679 +$ snaptel task watch 8b9babad-b3bc-4a16-9e06-1f35664a7679 NAMESPACE DATA TIMESTAMP /intel/psutil/cpu/cpu-total/idle 451176.5 2016-10-14 11:01:44.666137773 -0700 PDT /intel/psutil/cpu/cpu-total/system 33749.2734375 2016-10-14 11:01:44.666139698 -0700 PDT @@ -269,7 +264,7 @@ Nice work - you're all done with this example. Depending on how you started `sna * init.d service: `service snap-telemetry stop` * systemd service: `systemctl stop snap-telemetry` -* ran `snapd` manually: `sudo pkill snapd` +* ran `snapteld` manually: `sudo pkill snapteld` When you're ready to move on, walk through other uses of Snap available in the [Examples folder](examples/). @@ -284,9 +279,9 @@ If you would like to write your own, read through [Author a Plugin](#author-a-pl ## Documentation Documentation for Snap will be kept in this repository for now with an emphasis of filling out the `docs/` directory. We would also like to link to external how-to blog posts as people write them. [Read about contributing to the project](#contributing) for more details. -* [snapd (Snap agent)](docs/SNAPD.md) -* [configuring snapd](docs/SNAPD_CONFIGURATION.md) -* [snapctl (Snap CLI)](docs/SNAPCTL.md) +* [snapteld (Snap agent)](docs/SNAPTELD.md) +* [configuring snapteld](docs/SNAPTELD_CONFIGURATION.md) +* [snaptel (Snap CLI)](docs/SNAPTEL.md) * [build and test](docs/BUILD_AND_TEST.md) * [REST API](docs/REST_API.md) * [tasks](docs/TASKS.md) diff --git a/cmd/snaptel/main.go b/cmd/snaptel/main.go index 01560b442..440803ae3 100644 --- a/cmd/snaptel/main.go +++ b/cmd/snaptel/main.go @@ -92,7 +92,7 @@ func beforeAction(ctx *cli.Context) error { } // Checks if a tribe command was issued when tribe mode was not -// enabled on the specified snapd instance. +// enabled on the specified snapteld instance. func checkTribeCommand(ctx *cli.Context) error { tribe := false for _, a := range os.Args { @@ -114,7 +114,7 @@ func checkTribeCommand(ctx *cli.Context) error { if resp.Err.Error() == "Invalid credentials" { return resp.Err } - return fmt.Errorf("Tribe mode must be enabled in snapd to use tribe command") + return fmt.Errorf("Tribe mode must be enabled in snapteld to use tribe command") } return nil } diff --git a/control/config.go b/control/config.go index 76e888881..96fff1b04 100644 --- a/control/config.go +++ b/control/config.go @@ -131,7 +131,7 @@ const ( ` ) -// get the default snapd configuration +// get the default snapteld configuration func GetDefaultConfig() *Config { return &Config{ ListenAddr: defaultListenAddr, diff --git a/control/config_test.go b/control/config_test.go index f24323dad..9d011a071 100644 --- a/control/config_test.go +++ b/control/config_test.go @@ -35,7 +35,7 @@ import ( const ( MOCK_CONSTRAINTS = `{ "$schema": "http://json-schema.org/draft-04/schema#", - "title": "snapd global config schema", + "title": "snapteld global config schema", "type": ["object", "null"], "properties": { "control": { "$ref": "#/definitions/control" }, diff --git a/control/plugin/execution.go b/control/plugin/execution.go index 858465c73..652d783f5 100644 --- a/control/plugin/execution.go +++ b/control/plugin/execution.go @@ -123,7 +123,7 @@ func (e *ExecutablePlugin) Run(timeout time.Duration) (Response, error) { for stdOutScanner.Scan() { // The first chunk from the scanner is the plugin's response to the // handshake. Once we've received that, we can begin to forward - // logs on to snapd's log. + // logs on to snapteld's log. if !respReceived { respBytes := stdOutScanner.Bytes() err = json.Unmarshal(respBytes, &resp) diff --git a/control/strategy/pool.go b/control/strategy/pool.go index ec7ee4b4d..01174a41e 100644 --- a/control/strategy/pool.go +++ b/control/strategy/pool.go @@ -106,7 +106,7 @@ type pool struct { // The plugins in the pool. // the primary key is an increasing --> uint from - // snapd epoch (`service snapd start`). + // snapteld epoch (`service snapteld start`). plugins MapAvailablePlugin pidCounter uint32 diff --git a/docs/BUILD_AND_TEST.md b/docs/BUILD_AND_TEST.md index 30d53d840..52c556d7c 100644 --- a/docs/BUILD_AND_TEST.md +++ b/docs/BUILD_AND_TEST.md @@ -50,12 +50,12 @@ By default `make` runs `make deps`, `make snap`, and `make plugins` commands for * `deps`: fetches all dependencies using glide * `test-(legacy|small|medium|large)`: runs test suite -* `all`: builds snapd, snapctl, and test plugins for all platforms (MacOS and Linux) -* `snap` builds snapd and snapctl for local operating system +* `all`: builds snapteld, snaptel, and test plugins for all platforms (MacOS and Linux) +* `snap` builds snapteld and snaptel for local operating system * `plugins` builds test plugins for local operating system -* `install`: installs snapd and snapctl binaries in /usr/local/bin +* `install`: installs snapteld and snaptel binaries in /usr/local/bin -To see how to use Snap, look at [getting started](../README.md#getting-started), [SNAPD.md](SNAPD.md), and [SNAPCTL.md](SNAPCTL.md). +To see how to use Snap, look at [getting started](../README.md#getting-started), [SNAPTELD.md](SNAPTELD.md), and [SNAPTEL.md](SNAPTEL.md). ## Test ### Creating Tests diff --git a/docs/METRICS.md b/docs/METRICS.md index d7e67f561..6fc766836 100644 --- a/docs/METRICS.md +++ b/docs/METRICS.md @@ -22,7 +22,7 @@ A metric in Snap has the following fields. * The framework currently adds the following standard tag to all metrics * `plugin_running_on` describing on which host the plugin is running. This value is updated every hour due to a TTL set internally. * May be added by a task manifests as described [here](https://github.com/intelsdi-x/snap/pull/941) - * May be added by the snapd config as described [here](https://github.com/intelsdi-x/snap/issues/827) + * May be added by the snapteld config as described [here](https://github.com/intelsdi-x/snap/issues/827) * Unit `string` * Describes the magnitude being measured * Can be an empty string for unitless data diff --git a/docs/PLUGIN_LIFECYCLE.md b/docs/PLUGIN_LIFECYCLE.md index fff241f0d..ff8106110 100644 --- a/docs/PLUGIN_LIFECYCLE.md +++ b/docs/PLUGIN_LIFECYCLE.md @@ -21,17 +21,17 @@ limitations under the License. A Snap plugin can be in a `Loaded` or `Running` state. A plugin can be loaded in the following two ways. -1. `snapd` was started with an auto discover path `snapd -a /etc/snapd/plugins` -2. A user loads a plugin through the REST API or using the snapctl +1. `snapteld` was started with an auto discover path `snapteld -a /opt/snap/plugins` +2. A user loads a plugin through the REST API or using the snaptel * `curl -F file=@snap-plugin-publisher-file http://localhost:9191/v1/plugins` - * `snapctl plugin load snap-plugin-publisher-file` + * `snaptel plugin load snap-plugin-publisher-file` A plugin transitions to a `running` state when a task is started that uses the plugin. This is also called a plugin subscription. ## What happens when a plugin is loaded -When a plugin is loaded snapd takes the following steps. +When a plugin is loaded snapteld takes the following steps. 1. Handshakes with the plugin by reading it's stdout 2. Updates the metric catalog by calling the plugin over RPC @@ -44,7 +44,7 @@ as soon as the metric catalog has been updated. ## What happens when a plugin is unloaded -When a plugin is unloaded snapd removes it from the metric catalog and running +When a plugin is unloaded snapteld removes it from the metric catalog and running instances of the plugin are stopped. ## What happens when a task is started @@ -53,12 +53,12 @@ When a task is started the plugins that the task references are started and subscribed to. The following steps are taken when a task is created and started. -1. On **task creation** the task is validated (`snapctl task create -t mytask.yml +1. On **task creation** the task is validated (`snaptel task create -t mytask.yml --no-start`) * The schedule is validated * The config provided for the metrics (collectors), processors and publishers are validated -2. On **task starting** the plugins are started (`snapctl task start `) +2. On **task starting** the plugins are started (`snaptel task start `) 3. Subscriptions for each plugin referenced by the task are incremented ## Diving deeper diff --git a/docs/PLUGIN_PACKAGING.md b/docs/PLUGIN_PACKAGING.md index 1901116de..fd08f8c55 100644 --- a/docs/PLUGIN_PACKAGING.md +++ b/docs/PLUGIN_PACKAGING.md @@ -6,7 +6,7 @@ Image) format defined in the plugin. When Snap loads a plugin it detects the plugins type. If the plugin is a binary -the plugin is run by snapd which handshakes with the plugin via reading its +the plugin is run by snapteld which handshakes with the plugin via reading its standard output. If the plugin is packaged as an ACI image it is extracted and Snap executes the program referenced by the `exec` field. diff --git a/docs/PLUGIN_SIGNING.md b/docs/PLUGIN_SIGNING.md index 68383b3a7..35e5cb459 100644 --- a/docs/PLUGIN_SIGNING.md +++ b/docs/PLUGIN_SIGNING.md @@ -1,7 +1,7 @@ Plugin Signing ============== # Security -By default, the Snap daemon (snapd) has plugin signing verification enabled. To disable it or turn it to warning, the flag `--plugin-trust, -t` can be set to 0 or 2 respectively. +By default, the Snap daemon (snapteld) has plugin signing verification enabled. To disable it or turn it to warning, the flag `--plugin-trust, -t` can be set to 0 or 2 respectively. ##How it works ![How it works](https://cloud.githubusercontent.com/assets/14298289/19846788/de129a2a-9f4a-11e6-8275-fdd5fac63c82.png) @@ -14,52 +14,52 @@ openpgp.CheckArmoredDetachedSignature(keyring, signed, signature) ##Usage ``` -snapd +snapteld --plugin-trust, -t '1' 0-2 (Disabled, Enabled, Warning) [$SNAP_TRUST_LEVEL] --keyring-paths, -k Keyring files for signing verification separated by colons [$SNAP_KEYRING_FILES] ``` One keyring (-t flag is not needed for signing enabled) ``` -$ $SNAP_PATH/bin/snapd -k -$ $SNAP_PATH/bin/snapd -t -k -$ $SNAP_PATH/bin/snapd -t -k someDirectory/someFile.gpg -$ $SNAP_PATH/bin/snapd -t -k someDirectory/ +$ $SNAP_PATH/bin/snapteld -k +$ $SNAP_PATH/bin/snapteld -t -k +$ $SNAP_PATH/bin/snapteld -t -k someDirectory/someFile.gpg +$ $SNAP_PATH/bin/snapteld -t -k someDirectory/ ``` Multiple keyrings (may need full path, not ~) ``` -$ $SNAP_PATH/bin/snapd -t -k : +$ $SNAP_PATH/bin/snapteld -t -k : ``` By default, plugin-trust is 1 (enabled), so the flag is only needed for 0 (disabled) and 2 (warning) You can make an export to avoid needing the `-k` flag: ``` $ export SNAP_KEYRING_FILE= -$ $SNAP_PATH/bin/snapd -t +$ $SNAP_PATH/bin/snapteld -t ``` -Loading a single plugin using $SNAP_PATH/bin/snapctl +Loading a single plugin using $SNAP_PATH/bin/snaptel ``` -$ $SNAP_PATH/bin/snapctl plugin load -a .asc +$ $SNAP_PATH/bin/snaptel plugin load -a .asc ``` ####Examples #####No keyring, trust enabled/warning ``` -$ $SNAP_PATH/bin/snapd -l 1 +$ $SNAP_PATH/bin/snapteld -l 1 INFO[0000] setting plugin trust level to: enabled -FATA[0000] need keyring file when trust is on (--keyring-file or -k) _module=snapd block=main +FATA[0000] need keyring file when trust is on (--keyring-file or -k) _module=snapteld block=main ``` #####Invalid Keyring Keyring doesn't exist ``` -$ $SNAP_PATH/bin/snapd -l 1 -k /Users/tiffany/.gnupg/pubring.gpg:/Users/tiffany/.gnupg/stuff.gpg +$ $SNAP_PATH/bin/snapteld -l 1 -k /Users/tiffany/.gnupg/pubring.gpg:/Users/tiffany/.gnupg/stuff.gpg INFO[0000] adding keyring file /Users/tiffany/.gnupg/pubring.gpg -FATA[0000] bad keyring file _module=snapd block=main error=stat /Users/tiffany/.gnupg/stuff.gpg: no such file or directory keyringPath=/Users/tiffany/.gnupg/stuff.gpg +FATA[0000] bad keyring file _module=snapteld block=main error=stat /Users/tiffany/.gnupg/stuff.gpg: no such file or directory keyringPath=/Users/tiffany/.gnupg/stuff.gpg ``` #####Correct Keyring, trust enabled Valid signature ``` -$ $SNAP_PATH/bin/snapd -l 1 -k /Users/tiffany/.gnupg/ +$ $SNAP_PATH/bin/snapteld -l 1 -k /Users/tiffany/.gnupg/ INFO[0000] setting plugin trust level to: enabled INFO[0000] Adding keyrings from: /Users/tiffany/.gnupg @@ -71,7 +71,7 @@ INFO[0000] adding keyring file: /Users/tiffany/.gnupg/secring.gpg INFO[0000] adding keyring file: /Users/tiffany/.gnupg/trustdb.gpg ``` ``` -$ $SNAP_PATH/bin/snapctl plugin load build/plugin/snap-plugin-collector-mock1 -a build/plugin/snap-plugin-collector-mock1.asc +$ $SNAP_PATH/bin/snaptel plugin load build/plugin/snap-plugin-collector-mock1 -a build/plugin/snap-plugin-collector-mock1.asc Plugin loaded Name: mock Version: 1 @@ -89,7 +89,7 @@ Good signature from Tiffany Jernigan (Main signing key) ``` No signature ``` -$ $SNAP_PATH/bin/snapctl plugin load build/plugin/snap-plugin-collector-mock2 +$ $SNAP_PATH/bin/snaptel plugin load build/plugin/snap-plugin-collector-mock2 Error loading plugin: Signature file (.asc) not found: open : no such file or directory @@ -103,7 +103,7 @@ DEBU[0033] Removing file (/var/folders/kh/v2qy5_zx3zlgbc0gll7fzjnm0000gp/T/18054 ``` Invalid signature ``` -$SNAP_PATH/bin/snapctl plugin load build/plugin/snap-plugin-collector-mock2 -a build/plugin/snap-plugin-collector-mock1.asc +$SNAP_PATH/bin/snaptel plugin load build/plugin/snap-plugin-collector-mock2 -a build/plugin/snap-plugin-collector-mock1.asc Error loading plugin: Error checking signature openpgp: invalid signature: hash tag doesn't match @@ -119,7 +119,7 @@ DEBU[0003] Removing file (/var/folders/kh/v2qy5_zx3zlgbc0gll7fzjnm0000gp/T/70050 ``` Wrong keyring ``` -$ $SNAP_PATH/bin/snapctl plugin load build/plugin/snap-plugin-collector-mock1 -a build/plugin/snap-plugin-collector-mock1.asc +$ $SNAP_PATH/bin/snaptel plugin load build/plugin/snap-plugin-collector-mock1 -a build/plugin/snap-plugin-collector-mock1.asc Error loading plugin: Error checking signature openpgp: signature made by unknown entity @@ -132,12 +132,12 @@ openpgp: signature made by unknown entity _module=_mgmt-rest ``` #####Correct keyring, trust warning ``` -$ $SNAP_PATH/bin/snapd -l 1 -k ~/.gnupg/pubring.gpg -t 2 +$ $SNAP_PATH/bin/snapteld -l 1 -k ~/.gnupg/pubring.gpg -t 2 INFO[0000] setting plugin trust level to: warning INFO[0000] adding keyring file /Users/tiffany/.gnupg/pubring.gpg ``` ``` -$ $SNAP_PATH/bin/snapctl plugin load build/plugin/snap-plugin-collector-mock1 -a build/plugin/snap-plugin-collector-mock1.asc +$ $SNAP_PATH/bin/snaptel plugin load build/plugin/snap-plugin-collector-mock1 -a build/plugin/snap-plugin-collector-mock1.asc Plugin loaded Name: mock @@ -146,7 +146,7 @@ Type: collector Signed: true Loaded Time: Thu, 12 Nov 2015 14:08:32 PST -$ $SNAP_PATH/bin/snapctl plugin load build/plugin/snap-plugin-collector-mock2 +$ $SNAP_PATH/bin/snaptel plugin load build/plugin/snap-plugin-collector-mock2 Plugin loaded Name: mock diff --git a/docs/PROFILING.md b/docs/PROFILING.md index 660d1463b..86e3fe3e3 100644 --- a/docs/PROFILING.md +++ b/docs/PROFILING.md @@ -57,10 +57,10 @@ go get github.com/uber/go-torch ``` ## Generating a profile -### Run snapd -Start snapd with the `--pprof` flag: +### Run snapteld +Start snapteld with the `--pprof` flag: ```bash -snapd -t 0 --pprof +snapteld -t 0 --pprof ``` Just doing that will create endpoints on the port used by Snap API. If you use the default port like in the example above, you should be able to access this url from your web browser: http://127.0.0.1:8181/debug/pprof @@ -85,26 +85,26 @@ From your terminal, you can now generate the flame graphs: ### Without Docker ```bash -go-torch --binaryinput cpu.pprof --binaryname `which snapd` +go-torch --binaryinput cpu.pprof --binaryname `which snapteld` ``` ### For Docker user ```bash -cp `which snapd` . -docker run -v `pwd`:/tmp uber/go-torch --binaryinput /tmp/cpu.pprof --binaryname /tmp/snapd -p > torch.svg +cp `which snapteld` . +docker run -v `pwd`:/tmp uber/go-torch --binaryinput /tmp/cpu.pprof --binaryname /tmp/snapteld -p > torch.svg ``` ### Pprof tool Once again, I highly encourage you to read about pprof in [this blog post](https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs). (requires [Go](https://golang.org/doc/install)) ```bash -go tool pprof `which snapd` cpu.pprof +go tool pprof `which snapteld` cpu.pprof ``` ## BONUS: using pprof tools for plugin Plugins that use the [new Go library](https://github.com/intelsdi-x/snap-plugin-lib-go/tree/master/v1/plugin) will have their own endpoint. ```bash -$ snapctl plugin list --running +$ snaptel plugin list --running NAME HIT COUNT LAST HIT TYPE PPROF PORT mock-grpc 54 Tue, 08 Nov 2016 13:08:38 PST collector 62143 statistics 266 Tue, 08 Nov 2016 13:08:38 PST processor 62148 diff --git a/docs/REST_API.md b/docs/REST_API.md index 02ba2730b..f0c323b06 100644 --- a/docs/REST_API.md +++ b/docs/REST_API.md @@ -26,7 +26,7 @@ Snap exposes a list of RESTful APIs to perform various actions. All of Snap's AP * [Tribe APIs and Examples](#tribe-apis-and-examples) ### Authentication -Enabled in snapd +Enabled in snapteld ``` curl -L http://localhost:8181/v1/plugins ``` diff --git a/docs/SNAPCTL.md b/docs/SNAPTEL.md similarity index 83% rename from docs/SNAPCTL.md rename to docs/SNAPTEL.md index 5b7352a78..7b528e155 100644 --- a/docs/SNAPCTL.md +++ b/docs/SNAPTEL.md @@ -17,12 +17,12 @@ See the License for the specific language governing permissions and limitations under the License. --> -# snapctl +# snaptel A powerful telemetry framework ## Usage ``` -$ $SNAP_PATH/bin/snapctl [global options] command [command options] [arguments...] +$ $SNAP_PATH/bin/snaptel [global options] command [command options] [arguments...] ``` ### Global Options ``` @@ -30,7 +30,7 @@ $ $SNAP_PATH/bin/snapctl [global options] command [command options] [arguments.. --insecure Ignore certificate errors when Snap's API is running HTTPS --api-version, -a 'v1' The Snap API version --password, -p Password for REST API authentication ---config, -c Path to a config file [$SNAPCTL_CONFIG_PATH] +--config, -c Path to a config file [$SNAPTEL_CONFIG_PATH] --help, -h show help --version, -v print the version ``` @@ -44,7 +44,7 @@ help, h Shows a list of commands or help for one command ### Command Options #### task ``` -$ $SNAP_PATH/bin/snapctl task command [command options] [arguments...] +$ $SNAP_PATH/bin/snaptel task command [command options] [arguments...] ``` ``` create There are two ways to create a task. @@ -74,7 +74,7 @@ help, h Shows a list of commands or help for one command ``` #### plugin ``` -$ $SNAP_PATH/bin/snapctl plugin command [command options] [arguments...] +$ $SNAP_PATH/bin/snaptel plugin command [command options] [arguments...] ``` ``` load load @@ -88,7 +88,7 @@ help, h Shows a list of commands or help for one command ``` #### metric ``` -$ $SNAP_PATH/bin/snapctl metric command [command options] [arguments...] +$ $SNAP_PATH/bin/snaptel metric command [command options] [arguments...] ``` ``` list list @@ -101,9 +101,9 @@ Example Usage ### Load and unload plugins, create and start a task -In one terminal window, run snapd (log level is set to 1 and signing is turned off for this example): +In one terminal window, run snapteld (log level is set to 1 and signing is turned off for this example): ``` -$ $SNAP_PATH/bin/snapd -l 1 -t 0 +$ $SNAP_PATH/bin/snapteld -l 1 -t 0 ``` prepare a task manifest file, for example, task.json with following content: @@ -184,14 +184,14 @@ and then: 8. unload the plugins ``` -$ $SNAP_PATH/bin/snapctl plugin load $SNAP_PATH/plugin/snap-plugin-collector-mock1 -$ $SNAP_PATH/bin/snapctl plugin load $SNAP_PATH/plugin/snap-plugin-processor-passthru -$ $SNAP_PATH/bin/snapctl plugin load $SNAP_PATH/plugin/snap-plugin-publisher-mock-file -$ $SNAP_PATH/bin/snapctl plugin list -$ $SNAP_PATH/bin/snapctl task create -t mock-file.json -$ $SNAP_PATH/bin/snapctl task create -w workflow.json -i 1s -d 10s -$ $SNAP_PATH/bin/snapctl task list -$ $SNAP_PATH/bin/snapctl plugin unload -t collector -n mock -v -$ $SNAP_PATH/bin/snapctl plugin unload -t processor -n passthru -v -$ $SNAP_PATH/bin/snapctl plugin unload -t publisher -n publisher -v +$ $SNAP_PATH/bin/snaptel plugin load $SNAP_PATH/plugin/snap-plugin-collector-mock1 +$ $SNAP_PATH/bin/snaptel plugin load $SNAP_PATH/plugin/snap-plugin-processor-passthru +$ $SNAP_PATH/bin/snaptel plugin load $SNAP_PATH/plugin/snap-plugin-publisher-mock-file +$ $SNAP_PATH/bin/snaptel plugin list +$ $SNAP_PATH/bin/snaptel task create -t mock-file.json +$ $SNAP_PATH/bin/snaptel task create -w workflow.json -i 1s -d 10s +$ $SNAP_PATH/bin/snaptel task list +$ $SNAP_PATH/bin/snaptel plugin unload -t collector -n mock -v +$ $SNAP_PATH/bin/snaptel plugin unload -t processor -n passthru -v +$ $SNAP_PATH/bin/snaptel plugin unload -t publisher -n publisher -v ``` diff --git a/docs/SNAPD.md b/docs/SNAPTELD.md similarity index 79% rename from docs/SNAPD.md rename to docs/SNAPTELD.md index 33b7e967b..56587cb6f 100644 --- a/docs/SNAPD.md +++ b/docs/SNAPTELD.md @@ -17,12 +17,12 @@ See the License for the specific language governing permissions and limitations under the License. --> -# snapd -The Snap daemon/agent (snapd) is a modular application that consists of a control module, a scheduler module, and a REST API. The control module is responsible for loading and unloading plugins, managing loaded plugins, and maintaining an available pool of running plugins for running tasks. The scheduler module is responsible for running the workflows in created tasks per the schedule stated. The REST API provides an interface for loading and unloading plugins, creating and removing tasks, starting and stopping tasks, and listing metrics available for collection. +# snapteld +The Snap daemon/agent (snapteld) is a modular application that consists of a control module, a scheduler module, and a REST API. The control module is responsible for loading and unloading plugins, managing loaded plugins, and maintaining an available pool of running plugins for running tasks. The scheduler module is responsible for running the workflows in created tasks per the schedule stated. The REST API provides an interface for loading and unloading plugins, creating and removing tasks, starting and stopping tasks, and listing metrics available for collection. ## Usage ``` -$ $SNAP_PATH/bin/snapd [global options] command [command options] [arguments...] +$ $SNAP_PATH/bin/snapteld [global options] command [command options] [arguments...] ``` ### Options @@ -59,24 +59,24 @@ $ $SNAP_PATH/bin/snapd [global options] command [command options] [arguments...] ## Examples ### Commands ``` -$SNAP_PATH/bin/snapd -$SNAP_PATH/bin/snapd -log-level 4 -$SNAP_PATH/bin/snapd -l 1 -t 2 -k -$SNAP_PATH/bin/snapd -a $SNAP_PATH/plugins/ -$SNAP_PATH/bin/snapd --version +$SNAP_PATH/bin/snapteld +$SNAP_PATH/bin/snapteld -log-level 4 +$SNAP_PATH/bin/snapteld -l 1 -t 2 -k +$SNAP_PATH/bin/snapteld -a $SNAP_PATH/plugins/ +$SNAP_PATH/bin/snapteld --version ``` ### Output ``` -$ $SNAP_PATH/bin/snapd -l 1 -t 0 --rest-auth +$ $SNAP_PATH/bin/snapteld -l 1 -t 0 --rest-auth ``` ``` -INFO[0000] Starting snapd (version: unknown) +INFO[0000] Starting snapteld (version: unknown) INFO[0000] setting GOMAXPROCS to: 1 core(s) INFO[0000] control started _block=start _module=control -INFO[0000] module started _module=snapd block=main snap-module=control +INFO[0000] module started _module=snapteld block=main snap-module=control INFO[0000] scheduler started _block=start-scheduler _module=scheduler -INFO[0000] module started _module=snapd block=main snap-module=scheduler +INFO[0000] module started _module=snapteld block=main snap-module=scheduler INFO[0000] setting plugin trust level to: disabled INFO[0000] auto discover path is disabled INFO[0000] Configuring REST API with HTTPS set to: false _module=_mgmt-rest @@ -86,11 +86,11 @@ Password: INFO[0111] REST API authentication password is set INFO[0111] Starting REST API on :8181 _module=_mgmt-rest INFO[0111] REST API is enabled -INFO[0111] snapd started _module=snapd block=main +INFO[0111] snapteld started _module=snapteld block=main INFO[0111] setting log level to: debug ``` ## More information -* [SNAPD_CONFIGURATION.md](SNAPD_CONFIGURATION.md) +* [SNAPTELD_CONFIGURATION.md](SNAPTELD_CONFIGURATION.md) * [REST_API.md](REST_API.md) * [PLUGIN_SIGNING.md](PLUGIN_SIGNING.md) * [TRIBE.md](TRIBE.md) diff --git a/docs/SNAPD_CONFIGURATION.md b/docs/SNAPTELD_CONFIGURATION.md similarity index 67% rename from docs/SNAPD_CONFIGURATION.md rename to docs/SNAPTELD_CONFIGURATION.md index 5a210910e..c4d26415a 100644 --- a/docs/SNAPD_CONFIGURATION.md +++ b/docs/SNAPTELD_CONFIGURATION.md @@ -17,11 +17,11 @@ See the License for the specific language governing permissions and limitations under the License. --> -# snapd Configuration File +# snapteld Configuration File -snapd supports being configured through a configuration file located at a default location of `/etc/snap/snapd.conf` on Linux systems or by passing a configuration file in through the `--config` command line flag when starting snapd. YAML and JSON are currently supported for configuration file types. +snapteld supports being configured through a configuration file located at a default location of `/etc/snap/snapteld.conf` on Linux systems or by passing a configuration file in through the `--config` command line flag when starting snapteld. YAML and JSON are currently supported for configuration file types. -snapd runs without a configuration file provided and will use the default values defined inside the daemon (shown below). There is an order of precedence when it comes to default values, configuration files, and flags when snapd starts. Any value defined in the default configuration file located at `/etc/snap/snapd.conf` will take precedence over default values. Any value defined in a configuration file passed via the `--config` flag will be used in place of any default configuration file on the system and override default values. Any flags passed in on the command line during the start up of snapd will override any values defined in configuration files and default values. +snapteld runs without a configuration file provided and will use the default values defined inside the daemon (shown below). There is an order of precedence when it comes to default values, configuration files, and flags when snapteld starts. Any value defined in the default configuration file located at `/etc/snap/snapteld.conf` will take precedence over default values. Any value defined in a configuration file passed via the `--config` flag will be used in place of any default configuration file on the system and override default values. Any flags passed in on the command line during the start up of snapteld will override any values defined in configuration files and default values. In order of precedence (from greatest to least): - Command-line flags @@ -35,7 +35,7 @@ The configuration file is comprised of different sections for each module that t ## YAML Example When defining a configuration in YAML format, options or sections can be commented out if the value provided will not be different from the default value configured by the system. -### snapd configuration +### snapteld configuration This section comprises of configuration settings that are specific for the Snap daemon. ```yaml @@ -46,8 +46,8 @@ This section comprises of configuration settings that are specific for the Snap log_level: 3 # log_path sets the path for logs for the Snap daemon. By -# default snapd prints all logs to stdout. Any provided -# path will send snapd logs to a file called snapd.log in +# default snapteld prints all logs to stdout. Any provided +# path will send snapteld logs to a file called snapteld.log in # the provided directory. log_path: /var/log/snap @@ -62,11 +62,11 @@ log_truncate: false log_colors: true # Gomaxprocs sets the number of cores to use on the system -# for snapd to use. Default for gomaxprocs is 1 +# for snapteld to use. Default for gomaxprocs is 1 gomaxprocs: 1 ``` -### snapd control configurations +### snapteld control configurations The control section contains settings for configuring the Control module within the Snap daemon. These configuration settings are specific for the running of plugins and the plugins section under control allows for passing of plugin specific configuration items to the plugins during a task run. ```yaml @@ -91,9 +91,9 @@ control: # plugins. This can be a comma separated list of directories keyring_paths: /opt/snap/plugins/keyrings - # plugin_trust_level sets the plugin trust level for snapd. The default state + # plugin_trust_level sets the plugin trust level for snapteld. The default state # for plugin trust level is enabled (1). When enabled, only signed plugins that can - # be verified will be loaded into snapd. Signatures are verified from + # be verified will be loaded into snapteld. Signatures are verified from # keyring files specified in keyring_path. Plugin trust can be disabled (0) which # will allow loading of all plugins whether signed or not. The warning state allows # for loading of signed and unsigned plugins. Warning messages will be displayed if @@ -136,26 +136,26 @@ control: password: new password ``` -### snapd scheduler configurations +### snapteld scheduler configurations The scheduler section of the configuration file configures settings for the Scheduler module inside the Snap daemon. ```yaml scheduler: - # work_manager_queue_size sets the size of the worker queue inside snapd scheduler. + # work_manager_queue_size sets the size of the worker queue inside snapteld scheduler. # Default value is 25. work_manager_queue_size: 25 - # work_manager_pool_size sets the size of the worker pool inside snapd scheduler. + # work_manager_pool_size sets the size of the worker pool inside snapteld scheduler. # Default value is 4. work_manager_pool_size: 4 ``` -### snapd REST API configurations -The restapi section of the configuration file configures settings for enabling and running the REST API as part of the Snap daemon. The snapctl command line tool uses the REST API to manage snapd on a host. +### snapteld REST API configurations +The restapi section of the configuration file configures settings for enabling and running the REST API as part of the Snap daemon. The snaptel command line tool uses the REST API to manage snapteld on a host. ```yaml restapi: - # enable controls enabling or disabling the REST API for snapd. Default value is enabled. + # enable controls enabling or disabling the REST API for snapteld. Default value is enabled. enable: true # https enables HTTPS for the REST API. If no default certificate and key are provided, then @@ -181,11 +181,11 @@ restapi: port: 8181 ``` -### snapd tribe configurations +### snapteld tribe configurations The tribe section of the configuration file configures settings for enabling and running tribe as part of the Snap daemon. ```yaml tribe: - # enable controls enabling tribe for the snapd instance. Default value is false. + # enable controls enabling tribe for the snapteld instance. Default value is false. enable: false # bind_addr sets the IP address for tribe to bind. @@ -194,11 +194,11 @@ tribe: # bind_port sets the port for tribe to listen on. Default value is 6000 bind_port: 6000 - # name sets the name to use for this snapd instance in the tribe + # name sets the name to use for this snapteld instance in the tribe # membership. Default value defaults to the local hostname of the system. name: snaphost-01 - # seed sets the snapd instance to use as the seed for tribe communications + # seed sets the snapteld instance to use as the seed for tribe communications seed: 192.168.1.2:6000 ``` @@ -220,19 +220,19 @@ The same configuration settings above can also be provided in a JSON formatted c } ``` -## Restarting snapd to pick up configuration changes -If changes are made to the configuration file, `snapd` must be restarted to pick up those changes. Fortunately, this is a simple matter of sending a `SIGHUP` signal to the `snapd` process. For example, the following command will restart the `snapd` process on the local system: +## Restarting snapteld to pick up configuration changes +If changes are made to the configuration file, `snapteld` must be restarted to pick up those changes. Fortunately, this is a simple matter of sending a `SIGHUP` signal to the `snapteld` process. For example, the following command will restart the `snapteld` process on the local system: ```bash -$ kill -HUP `pidof snapd` +$ kill -HUP `pidof snapteld` ``` -Note that in this example, we are using the `pidof` command to retrieve the process ID of the `snapd` process. If the `pidof` command is not available on your system you might have to use a `ps aux` command and pipe the output of that command to a `grep snapd` command in order to obtain the process ID of the `snapd` process. Once the `snapd` process receives that signal it will restart and pick up any changes that have been made to the configuration file that was originally used to Âstart the `snapd` process. +Note that in this example, we are using the `pidof` command to retrieve the process ID of the `snapteld` process. If the `pidof` command is not available on your system you might have to use a `ps aux` command and pipe the output of that command to a `grep snapteld` command in order to obtain the process ID of the `snapteld` process. Once the `snapteld` process receives that signal it will restart and pick up any changes that have been made to the configuration file that was originally used to Âstart the `snapteld` process. -Do keep in mind that this signal will trigger a **restart** of the `snapd` process. This means that any running tasks will be shut down and any loaded plugins will be unloaded. In reality, this means that when the `snapd` process restarts any plugins not in the `auto_discover_path` will need to be loaded manually once the `snapd` process restarts (and any tasks not in that same `auto_discover_path` will need to be restarted). However, any plugins in the `auto_discover_path` will be automatically reloaded and any tasks in that same `auto_discover_path` will be automatically restarted when the when the `snapd` process restarts in response to a `SIGHUP` signal. +Do keep in mind that this signal will trigger a **restart** of the `snapteld` process. This means that any running tasks will be shut down and any loaded plugins will be unloaded. In reality, this means that when the `snapteld` process restarts any plugins not in the `auto_discover_path` will need to be loaded manually once the `snapteld` process restarts (and any tasks not in that same `auto_discover_path` will need to be restarted). However, any plugins in the `auto_discover_path` will be automatically reloaded and any tasks in that same `auto_discover_path` will be automatically restarted when the when the `snapteld` process restarts in response to a `SIGHUP` signal. ## More information -* [SNAPD.md](SNAPD.md) +* [SNAPTELD.md](SNAPTELD.md) * [REST_API.md](REST_API.md) * [PLUGIN_SIGNING.md](PLUGIN_SIGNING.md) * [TRIBE.md](TRIBE.md) diff --git a/docs/TASKS.md b/docs/TASKS.md index 9208bb0e3..aed96b963 100644 --- a/docs/TASKS.md +++ b/docs/TASKS.md @@ -19,14 +19,14 @@ A task can be in the following states: How To | Command ----------------------------------------|------------------------ - Create task | snapctl task create _[command options] [arguments...]_
Find more details [here](https://github.com/intelsdi-x/snap/blob/master/docs/SNAPCTL.md#task) - List | snapctl task list - Start task | snapctl task start _\_ - Stop task | snapctl task stop _\_ - Remove task | snapctl task remove _\_ - Export task | snapctl task export _\_ - Watch task | snapctl task watch _\_ - Enable task | snapctl task enable _\_ + Create task | snaptel task create _[command options] [arguments...]_
Find more details [here](https://github.com/intelsdi-x/snap/blob/master/docs/SNAPTEL.md#task) + List | snaptel task list + Start task | snaptel task start _\_ + Stop task | snaptel task stop _\_ + Remove task | snaptel task remove _\_ + Export task | snaptel task export _\_ + Watch task | snaptel task watch _\_ + Enable task | snaptel task enable _\_ ## Task Manifest @@ -90,7 +90,7 @@ can be changed by specifying the number of failures value in the task header. I not disable a task with consecutive failure. Instead, Snap will sleep for 1 second for every 10 consecutive failures and retry again. -For more on tasks, visit [`SNAPCTL.md`](SNAPCTL.md). +For more on tasks, visit [`SNAPTEL.md`](SNAPTEL.md). ### The Workflow @@ -155,7 +155,7 @@ Process and Publish nodes in the workflow can also target remote Snap nodes via ``` -If a target is specified for a step in the workflow, that step will be executed on the remote instance specified by the ip:port target. Each node in the workflow is evaluated independently so a workflow can have any, all, or none of its steps being done remotely (if `target` key is omitted, that step defaults to local). The ip and port target are the ip and port that has a running control-grpc server. These can be specified to snapd via the `control-listen-addr` and `control-listen-port` flags. The default is the same ip as the Snap rest-api and port 8082. +If a target is specified for a step in the workflow, that step will be executed on the remote instance specified by the ip:port target. Each node in the workflow is evaluated independently so a workflow can have any, all, or none of its steps being done remotely (if `target` key is omitted, that step defaults to local). The ip and port target are the ip and port that has a running control-grpc server. These can be specified to snapteld via the `control-listen-addr` and `control-listen-port` flags. The default is the same ip as the Snap rest-api and port 8082. An example json task that uses remote targets: ```json @@ -211,7 +211,7 @@ Metrics can be enumerated using: a) **concrete _namespace_** -Declaring a metric's name exactly as it appears in the metric catalog (see `snapctl metric list`). +Declaring a metric's name exactly as it appears in the metric catalog (see `snaptel metric list`). Metrics requested in task manifest | Collected metrics --------------------------------------------|------------------------ @@ -396,5 +396,5 @@ Below is a complete example task. #### footnotes -1. YAML is only supported via the snapctl CLI. Only JSON is accepted via the REST API. +1. YAML is only supported via the snaptel CLI. Only JSON is accepted via the REST API. 2. The wildcard must be supported by the target plugin. diff --git a/docs/TRIBE.md b/docs/TRIBE.md index dd68d26b6..13dd3dae5 100644 --- a/docs/TRIBE.md +++ b/docs/TRIBE.md @@ -25,52 +25,52 @@ limitations under the License. # Tribe -Tribe is the name of the clustering feature in Snap. When it is enabled, snapd instances can join to one another through an `agreement`. When an action is taken by one snapd instance that is a member of an agreement, that action will be carried out by all other members of the agreement. When a new snapd joins an existing agreement it will retrieve plugins and tasks from the members of the agreement. +Tribe is the name of the clustering feature in Snap. When it is enabled, snapteld instances can join to one another through an `agreement`. When an action is taken by one snapteld instance that is a member of an agreement, that action will be carried out by all other members of the agreement. When a new snapteld joins an existing agreement it will retrieve plugins and tasks from the members of the agreement. ## Usage This walkthrough assumes you have downloaded a Snap release as described in [Getting Started](../README.md#getting-started). -### Starting the first snapd in tribe mode +### Starting the first snapteld in tribe mode Start the first node: ``` -$ snapd --tribe -t 0 +$ snapteld --tribe -t 0 ``` Only `--tribe` and some trust level (`-t 0`) is required to start tribe. This will result in defaults for all other parameters: * Default `tribe-node-name` will be the same as your hostname * Default `tribe-seed` is port 6000 -* Default `tribe-addr` and `tribe-port` are the same as `snapd` and `tribe-seed` (ex. 127.0.0.1:6000) +* Default `tribe-addr` and `tribe-port` are the same as `snapteld` and `tribe-seed` (ex. 127.0.0.1:6000) -See `snapd -h` for all the possible flags. +See `snapteld -h` for all the possible flags. ### Creating an initial agreement Members of a tribe only share configuration once they join an agreement. To create your first agreement: ``` -$ snapctl agreement create all-nodes +$ snaptel agreement create all-nodes Name Number of Members plugins tasks all-nodes 0 0 0 ``` -Join our running snapd into this agreement: +Join our running snapteld into this agreement: ``` -$ snapctl agreement join all-nodes `hostname` +$ snaptel agreement join all-nodes `hostname` Name Number of Members plugins tasks all-nodes 1 0 0 ``` -### Joining other snapd into an existing tribe +### Joining other snapteld into an existing tribe Since tribe is implemented on top of a gossip based protocol there is no "master." All other nodes who join a tribe by communicating with any existing member. -Start another instance of snapd to join to our existing tribe. The local IP address is 192.168.136.176 in our example. Note that we need a few more parameters to avoid conflicting ports on a single system: +Start another instance of snapteld to join to our existing tribe. The local IP address is 192.168.136.176 in our example. Note that we need a few more parameters to avoid conflicting ports on a single system: ``` -$ snapd --tribe -t 0 --tribe-port 6001 --api-port 8182 --tribe-node-name secondnodename --tribe-seed 192.168.136.176:6000 --control-listen-port 8083 +$ snapteld --tribe -t 0 --tribe-port 6001 --api-port 8182 --tribe-node-name secondnodename --tribe-seed 192.168.136.176:6000 --control-listen-port 8083 ``` -Both snapd instances will see each other in their member list: +Both snapteld instances will see each other in their member list: ``` -$ snapctl member list +$ snaptel member list Name secondnodename firstnode @@ -78,7 +78,7 @@ firstnode This member needs to join the agreement: ``` -$ snapctl agreement join all-nodes secondnodename +$ snaptel agreement join all-nodes secondnodename Name Number of Members plugins tasks all-nodes 2 0 0 ``` diff --git a/examples/README.md b/examples/README.md index a7f7c3b68..0b15fe64e 100644 --- a/examples/README.md +++ b/examples/README.md @@ -19,7 +19,7 @@ limitations under the License. This directory contains examples for Snap: -* [configs](./configs) folder contains examples of [the global configuration file](../docs/SNAPD_CONFIGURATION.md#snapd-configuration-file) that powers your plugins. +* [configs](./configs) folder contains examples of [the global configuration file](../docs/SNAPTELD_CONFIGURATION.md#snapteld-configuration-file) that powers your plugins. * [tasks](./tasks) folder contains examples of [Snap tasks](../docs/TASKS.md). For additional examples of using Snap, checkout the examples in these repositories: diff --git a/examples/configs/snap-config-sample.yaml b/examples/configs/snap-config-sample.yaml index 024444fed..0ba6f300e 100644 --- a/examples/configs/snap-config-sample.yaml +++ b/examples/configs/snap-config-sample.yaml @@ -5,8 +5,8 @@ log_level: 2 # log_path sets the path for logs for the snap daemon. By -# default snapd prints all logs to stdout. Any provided -# path will send snapd logs to a file called snapd.log in +# default snapteld prints all logs to stdout. Any provided +# path will send snapteld logs to a file called snapteld.log in # the provided directory. log_path: /some/log/dir @@ -21,11 +21,11 @@ log_truncate: false log_colors: true # Gomaxprocs sets the number of cores to use on the system -# for snapd to use. Default for gomaxprocs is 1 +# for snapteld to use. Default for gomaxprocs is 1 gomaxprocs: 2 # Control sections for configuration settings for the plugin -# control module of snapd. +# control module of snapteld. control: # auto_discover_path sets a directory to auto load plugins on the start # of the snap daemon @@ -55,9 +55,9 @@ control: # plugins. This can be a comma separated list of directories keyring_paths: /some/path/with/keyring/files - # plugin_trust_level sets the plugin trust level for snapd. The default state + # plugin_trust_level sets the plugin trust level for snapteld. The default state # for plugin trust level is enabled (1). When enabled, only signed plugins that can - # be verified will be loaded into snapd. Signatures are verifed from + # be verified will be loaded into snapteld. Signatures are verifed from # keyring files specided in keyring_path. Plugin trust can be disabled (0) which # will allow loading of all plugins whether signed or not. The warning state allows # for loading of signed and unsigned plugins. Warning messages will be displayed if @@ -102,17 +102,17 @@ control: # scheduler configuration settings contains all settings for scheduler # module scheduler: - # work_manager_queue_size sets the size of the worker queue inside snapd scheduler. + # work_manager_queue_size sets the size of the worker queue inside snapteld scheduler. # Default value is 25. work_manager_queue_size: 10 - # work_manager_pool_size sets the size of the worker pool inside snapd scheduler. + # work_manager_pool_size sets the size of the worker pool inside snapteld scheduler. # Default value is 4. work_manager_pool_size: 2 # rest sections contains all the configuration items for the REST API server. restapi: - # enable controls enabling or disabling the REST API for snapd. Default value is enabled. + # enable controls enabling or disabling the REST API for snapteld. Default value is enabled. enable: true # https enables HTTPS for the REST API. If no default certificate and key are provided, then @@ -142,7 +142,7 @@ restapi: # tribe section contains all configuration items for the tribe module tribe: - # enable controls enabling tribe for the snapd instance. Default value is false. + # enable controls enabling tribe for the snapteld instance. Default value is false. enable: true # bind_addr sets the IP address for tribe to bind. @@ -151,9 +151,9 @@ tribe: # bind_port sets the port for tribe to listen on. Default value is 6000 bind_port: 16000 - # name sets the name to use for this snapd instance in the tribe + # name sets the name to use for this snapteld instance in the tribe # membership. Default value defaults to local hostname of the system. name: localhost - # seed sets the snapd instance to use as the seed for tribe communications + # seed sets the snapteld instance to use as the seed for tribe communications seed: 1.1.1.1:16000 diff --git a/mgmt/rest/config_test.go b/mgmt/rest/config_test.go index 706b67105..8e40d6ab2 100644 --- a/mgmt/rest/config_test.go +++ b/mgmt/rest/config_test.go @@ -26,7 +26,7 @@ import ( ) // Since we do not have a global snap package that could be imported -// we create a mock config struct to mock what is in snapd.go +// we create a mock config struct to mock what is in snapteld.go type mockConfig struct { LogLevel int `json:"-"yaml:"-"` diff --git a/mgmt/rest/flags.go b/mgmt/rest/flags.go index 6e7fa9a8d..a7f88b196 100644 --- a/mgmt/rest/flags.go +++ b/mgmt/rest/flags.go @@ -61,6 +61,6 @@ var ( Usage: "Enables profiling tools", } - // Flags consumed by snapd + // Flags consumed by snapteld Flags = []cli.Flag{flAPIDisabled, flAPIAddr, flAPIPort, flRestHTTPS, flRestCert, flRestKey, flRestAuth, flPProf} ) diff --git a/mgmt/rest/rest_func_test.go b/mgmt/rest/rest_func_test.go index f6f095aed..06dc8a04f 100644 --- a/mgmt/rest/rest_func_test.go +++ b/mgmt/rest/rest_func_test.go @@ -70,7 +70,7 @@ var ( const ( MOCK_CONSTRAINTS = `{ "$schema": "http://json-schema.org/draft-04/schema#", - "title": "snapd global config schema", + "title": "snapteld global config schema", "type": ["object", "null"], "properties": { "control": { "$ref": "#/definitions/control" }, diff --git a/mgmt/rest/server.go b/mgmt/rest/server.go index 56030e31c..12ba2ede2 100644 --- a/mgmt/rest/server.go +++ b/mgmt/rest/server.go @@ -194,7 +194,7 @@ type Server struct { // New creates a REST API server with a given config func New(cfg *Config) (*Server, error) { - // pull a few parameters from the configuration passed in by snapd + // pull a few parameters from the configuration passed in by snapteld https := cfg.HTTPS cpath := cfg.RestCertificate kpath := cfg.RestKey @@ -226,7 +226,7 @@ func New(cfg *Config) (*Server, error) { return s, nil } -// GetDefaultConfig gets the default snapd configuration +// GetDefaultConfig gets the default snapteld configuration func GetDefaultConfig() *Config { return &Config{ Enable: defaultEnable, @@ -311,7 +311,7 @@ func (s *Server) SetAPIAuth(auth bool) { s.auth = auth } -// SetAPIAuthPwd sets the API authentication password from snapd +// SetAPIAuthPwd sets the API authentication password from snapteld func (s *Server) SetAPIAuthPwd(pwd string) { s.authpwd = pwd } @@ -323,7 +323,7 @@ func (s *Server) authMiddleware(rw http.ResponseWriter, r *http.Request, next ht _, password, ok := r.BasicAuth() // If we have valid password or going to tribe/agreements endpoint // go to next. tribe/agreements endpoint used for populating - // snapctl help page when tribe mode is turned on. + // snaptel help page when tribe mode is turned on. if ok && password == s.authpwd { next(rw, r) } else { diff --git a/mgmt/rest/task.go b/mgmt/rest/task.go index 221c96af5..9f5ba590d 100644 --- a/mgmt/rest/task.go +++ b/mgmt/rest/task.go @@ -177,7 +177,7 @@ func (s *Server) watchTask(w http.ResponseWriter, r *http.Request, p httprouter. case <-s.killChan: logger.WithFields(log.Fields{ "task-id": id, - }).Debug("snapd exiting; disconnecting client") + }).Debug("snapteld exiting; disconnecting client") // Flush since we are sending nothing new flusher.Flush() // Close out watcher removing it from the scheduler diff --git a/mgmt/tribe/config.go b/mgmt/tribe/config.go index 32f842e40..667e48e4e 100644 --- a/mgmt/tribe/config.go +++ b/mgmt/tribe/config.go @@ -87,7 +87,7 @@ const ( ` ) -// get the default snapd configuration +// get the default snapteld configuration func GetDefaultConfig() *Config { mlCfg := memberlist.DefaultLANConfig() mlCfg.PushPullInterval = defaultPushPullInterval diff --git a/mgmt/tribe/config_test.go b/mgmt/tribe/config_test.go index 75830677c..58ad09f1a 100644 --- a/mgmt/tribe/config_test.go +++ b/mgmt/tribe/config_test.go @@ -33,7 +33,7 @@ import ( const ( MOCK_CONSTRAINTS = `{ "$schema": "http://json-schema.org/draft-04/schema#", - "title": "snapd global config schema", + "title": "snapteld global config schema", "type": ["object", "null"], "properties": { "control": { "$ref": "#/definitions/control" }, diff --git a/mgmt/tribe/flags.go b/mgmt/tribe/flags.go index 384c69b86..af84f55de 100644 --- a/mgmt/tribe/flags.go +++ b/mgmt/tribe/flags.go @@ -56,6 +56,6 @@ var ( EnvVar: "SNAP_TRIBE_ADDR", } - // Flags consumed by snapd + // Flags consumed by snapteld Flags = []cli.Flag{flTribeNodeName, flTribe, flTribeSeed, flTribeAdvertiseAddr, flTribeAdvertisePort} ) diff --git a/scheduler/config.go b/scheduler/config.go index 5e568b754..5a1f25f19 100644 --- a/scheduler/config.go +++ b/scheduler/config.go @@ -58,7 +58,7 @@ const ( ` ) -// get the default snapd configuration +// get the default snapteld configuration func GetDefaultConfig() *Config { return &Config{ WorkManagerQueueSize: defaultWorkManagerQueueSize, diff --git a/scheduler/config_test.go b/scheduler/config_test.go index a5a355505..0c07d05a3 100644 --- a/scheduler/config_test.go +++ b/scheduler/config_test.go @@ -31,7 +31,7 @@ import ( const ( MOCK_CONSTRAINTS = `{ "$schema": "http://json-schema.org/draft-04/schema#", - "title": "snapd global config schema", + "title": "snapteld global config schema", "type": ["object", "null"], "properties": { "control": { "$ref": "#/definitions/control" }, diff --git a/scheduler/flags.go b/scheduler/flags.go index 5d39cb2fd..cb894d931 100644 --- a/scheduler/flags.go +++ b/scheduler/flags.go @@ -38,6 +38,6 @@ var ( EnvVar: "WORK_MANAGER_POOL_SIZE", } - // Flags consumed by snapd + // Flags consumed by snapteld Flags = []cli.Flag{flSchedulerQueueSize, flSchedulerPoolSize} )