npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fleetctl-ssh

v0.2.1

Published

A Node.js workalike module for CoreOS' fleetctl that that runs remotely over SSH, allowing you to use it from inside a Docker container. Inspired by @opendeis' scheduler.

Downloads

29

Readme

fleet-ssh

A Node.js API for CoreOS's fleetctl tool, implemented by simply remotely executing fleetctl over SSH. This means it will work within a Docker container on CoreOS, providing you have a host and key for your host machine, or any other node in the CoreOS cluster.

Inspired by the CoreOS scheduler in the Deis platform.

All commands in fleetctrl 0.5.0 are implemented with the exception of 'ssh', 'version' and 'help', and each command name maps directly to a method name in the API. Commands that have a hyphen are camel-cased (e.g. debug-info -> debugInfo).

All commands return a Node.js ChildProcess object, so you can easily pipe the results somewhere.

If you pass a callback it will buffer the stdout and return it in the first non-error argument. If you don't pass a callback to each API call, it will return the child process object so you can stream the I/O yourself.

Usage

To run against a CoreOS Vagrant cluster on your local machine:

var FleetAPI = require('fleet-ssh');
var fleet = new FleetAPI('127.0.0.1', {
  key: '/Users/lbond/.vagrant.d/insecure_private_key',
  port: 2222
};
fleet.cat('my-service').stdout.pipe(process.stdout);

fleetctl-ssh now supports the debug module. To get some debug output set the envvar DEBUG to fleetctl when you run your program that uses this module.

API

.cat(unitName)
Output the contents of a submitted unit.

.debugInfo()
Print out debug information.

.destroy(unitName)
Destroy one or more units in the cluster.

.journal(unitName, options)
Print the journal of a unit in the cluster to stdout.
Options:

  • follow Continuously print new entries as they are appended to the journal.
  • lines Number of recent log lines to return

.listMachines()
Enumerate the current hosts in the cluster.

.listUnits()
Enumerate units loaded in the cluster.

.load(unitName, options)
Schedule one or more units in the cluster, first submitting them if necessary. You must supply either one of the unitFile or unitFileData options, below.
Options:

  • unitFile The path to the unit file to load.
  • unitFileData The contents of the unit file itself, base64-encoded.
  • blockAttempts Wait until the jobs are loaded, performing up to N attempts before giving up. A value of 0 indicates no limit.
  • noBlock Do not wait until the jobs have been loaded before exiting.
  • sign Sign unit file signatures and verify submitted units using local SSH identities.

.start(unitName, options)
Instruct systemd to start one or more units in the cluster, first submitting and loading if necessary. You must supply either one of the unitFile or unitFileData options, below.
Options:

  • unitFile The path to the unit file to start.
  • unitFileData The contents of the unit file itself, base64-encoded.
  • blockAttempts Wait until the jobs are launched, performing up to N attempts before giving up. A value of 0 indicates no limit.
  • noBlock Do not wait until the jobs have been launched before exiting.
  • sign Sign unit file signatures using local SSH identities.

.status(unitFile)
Output the status of one or more units in the cluster

.stop(unitFile)
Instruct systemd to stop one or more units in the cluster.
Options:

  • blockAttempts Wait until the jobs are stopped, performing up to N attempts before giving up. A value of 0 indicates no limit.
  • noBlock Do not wait until the jobs have stopped before exiting.

.submit(unitFile, options)
Upload one or more units to the cluster without starting them. You must supply either one of the unitFile or unitFileData options, below.
Options:

  • unitFile The path to the unit file to submit.
  • unitFileData The contents of the unit file itself, base64-encoded.
  • sign Sign unit files units using local SSH identities

.unload(unitFile, options)
Unschedule one or more units in the cluster.
Options:

  • blockAttempts Wait until the jobs are inactive, performing up to N attempts before giving up. A value of 0 indicates no limit.
  • noBlock Do not wait until the jobs have become inactive before exiting.

.verify(unitFile)
Verify unit file signatures using local SSH identities.

Licence

MIT