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

specialone

v1.3.0

Published

zero-downtime with docker

Downloads

2

Readme

Specialone

unique docker container with etcd service discovery.

Concept

kills old container with same SP_GROUP environment

Usage

npm intall

sudo npm install -g specialone

on Docker host

sudo specialone

Usage with Docker

on build

sudo docker build -t flrngel/specialone .

running daemon

sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock flrngel/specialone

environments

  • SP_INTERVAL - miliseconds interval to check containers
  • SP_NO_KILL - flag having true or false value to kill container
  • SP_KILL_WAIT - waiting seconds to kill before on docker stop
  • SP_KILL_TIMEOUT - seconds to kill after timeout on docker stop
  • SP_ETCD_HOST - etcd host ex) 127.0.0.1:4001
  • SP_ETCD_TTL - TTL for etcd keys

to group container, give docker environment as

  • SP_GROUP - specialone will kill old containers with same group name
  • SP_KILL_WAIT - overwrite waiting seconds to kill before on docker stop
  • SP_KILL_TIMEOUT - overwrite seconds to kill after timeout on docker stop

Example

$ sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock flrngel/specialone
c9c334b73d20a9b6e1ae7c99abe36a0892f38661b5c4f1d9ca3985aff2cb8a4a

$ sudo docker run -d --name old -e SP_GROUP=redis redis:2.8.10
184ccc2879abf63b0ba87ec9d43ea3e2b088449656220912d01eba2bb1e9686f

$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND                CREATED             STATUS              PORTS               NAMES
184ccc2879ab        redis:2.8.10                "/entrypoint.sh redi   3 seconds ago       Up 2 seconds        6379/tcp            old                 
c9c334b73d20        flrngel/specialone:latest   "npm start"            18 seconds ago      Up 17 seconds                           pensive_lalande     

$ sudo docker run -d --name new -e SP_GROUP=redis redis:2.8.12
bf54222669f92e167ecbacaa2f1cb0f4aa2740788d89486b0ce1c9a3ba085769

$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND                CREATED              STATUS              PORTS               NAMES
bf54222669f9        redis:2.8.12                "/entrypoint.sh redi   2 seconds ago        Up 1 seconds        6379/tcp            new                 
c9c334b73d20        flrngel/specialone:latest   "npm start"            About a minute ago   Up About a minute                       pensive_lalande     

ETCD

  • groups are in sp/ as sp/<SP_GROUP>
  • discovery container as sp/<SP_GROUP>/<HOST_IP>:<CONTAINER_PORT>

TODO

  • logging
  • haproxy for port-exposed containers