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

a6s-railway

v0.2.3

Published

K8s deployment orchestration tool.

Downloads

48

Readme

a6s-railway

K8s deployment Orchestration tool.

Dependencies

  • Node.js - LTS version
  • Kubectl
  • Helm
  • Valid credentials in ~/.kube/config file.
  • Other CLI tools you need to use in your deployment scripts.

Installation

npm i -g a6s-railway

Usage

Run rw in your terminal to get the help.

Deployment Descriptor File

Each deployment should be described via deployment descriptor file. There is only one entry point presented in file called "station".

Format:


# Deployment version
version: 1.0.0
# Base station to start the deployment from
station: 
 name: 'station.name' 

Station

# Every station should have a name of handler that processes the deployment
name: 'a6s.station'

# Each station also might require some options.
# There are 2 ways on how options can be passed:
# 1) Inline:
options:
  a: true
  # here comes the template magic of deployment descriptors
  # you can reference environment variables inside options:
  b: <%- env.TEST %>
  # or context variables produced by resolvers (read below)
  c: <%- context.test %>
  # alternativelly use `$link:<path>` syntax
  d: '$link:context.test'
# 2) Via external YAML file. External files are also handled as templates.
options_file: 'external.options.yml'

# Templates are resolved at the time deployment runs into station.
# The main limitation of template variables is that they can not contain any async processing.
# And resolvers are here to help with that. They are invoked before handler execution. Resolvers place their results into
# sharable context. Context is globally accessible, so make sure place unique name to avoid race conditions.
resolvers:
  test: 
    name: 'a6s.handler'
    # just like station handler may have its own options and be processed as a template
    options:
    options_file: 'external.handler.options.yml'

Each station in your deployment descriptor identified single action. Each station is described by name of the handler and options.

Flow control

Due to a nature of deployments they can become really complex and look more like a tree where some branches can be executed in parallel to optimize the deployment execution time.

Special handlers exist to help with deployment processing.

Sequential Execution

This is a most commonly used flow control handler. It allows to run multiple actions (stations) one by one.

name: 'a6s.sequence'
  options:
    - name: 'a6s.handler.1'
      options: 
    - name: 'a6s.handler.2'
      options:    

In the example above a6s.handler.2 will only be executed after a6s.handler.1.

Parallel Execution

Sometimes it makes zero sense to wait before one handler finishes to start another one. E.g. You need to make installation of 5 services that have no dependencies among each other.

To help with that parallel handler exists:

name: 'a6s.parallel'
options:
 - name: 'a6s.handler.1'
   options: 
 - name: 'a6s.handler.2'
   options:    

In the example above a6s.handler.2 will be executed in parallel with a6s.handler.1.

Complex Execution Example

name: 'a6s.sequence'
options:
 - name: 'a6s.parallel'
   options:
    - name: 'a6s.handler.1'
      options: 
    - name: 'a6s.handler.2'
      options:  
 
 - name: 'a6s.handler.3'
   options:    

In this example a6s.handler.1 and a6s.handler.2 will be executed in parallel and a6s.handler.3 will only be started when a6s.parallel is completed. So 3rd handler will wait for first 2 to be completed.

External Descriptors

When working on production grade deployment number of services that needs to be deployed will grow dramatically and managing all of them inside single deployment descriptor file will become a pain.

Split it! Created isolated deployment descriptors for submodules/services you need to deal with.

name: 'a6s.external'
options:
  # provide a relative or absolute path to the descriptor
  file: 'elasticsearch.station.yml'

"If" Control

Run over station only when condition occurs.

name: 'a6s.if'
options:
  # test value
  value: 'test'
  # against  
  equals: 'test2'
  # and run station if passes
  station:
    name: 'a6s.some.station' 

In the example above test will not match test2 and station a6s.some.station will not be triggered.

"Switch" Control

Run over station that matches value.

name: 'a6s.switch'
options:
  # test value
  value: 'test'
  # against keys  
  equals:     
    test:
      name: 'a6s.some.station1' 
    test2:
      name: 'a6s.some.station2'      

In the example above a6s.some.station1 will be triggered.