Service

How Push Works

How Push is built behind the scenes and how it can fit into your workflow.

There are two ways to interact with Push:

  1. Via the Push dashboard where you create your account, connect providers, create deployments, and monitor/manage existing deployments.
  2. Via the Joystick CLI to initiate deployments of your app to Push.

Once you've created a deployment on Push, on your computer, you will navigate to your app's folder via the command line and run:

> cd myapp.com
> joystick push -d <domain_name> -t <deployment_token>

Here, <domain_name> is replaced with your app's domain name (e.g., myapp.com) and <deployment_token> is replaced with your account's unique Deployment Token, provided by Push when creating your deployment and available via your Profile in the Push dashboard.

Deployment Lifecycle

Once initiated, the Joystick CLI will build your app to a tar ball, encrypt the tar ball, and upload it to version control storage. Once this process is completed, you will be prompted to head back to the Push dashboard to monitor your deployment's progress.

After your app is uploaded, one of two things will happen:

  1. If this is your first deployment, Push will begin the provisioning and bootstrapping process for your instance(s) on the provider you chose when creating the deployment. After provisioning and bootstrapping are complete, Push will signal your instance(s) to download the latest version of your app from its version control storage, install its dependencies, and start the app on your instance.
  2. If this is not your first deployment, Push will signal your instance(s) to download the latest version of your app from its version control storage, install its dependencies, and start the app on your instance.

Logs, Metrics, and Health Checks

Once your app is deployed, Push will begin to capture logs and metrics from your instance(s). Internally, Joystick detects if your app was deployed with Push. If it was, it will start relaying its log file and metrics to Push on a 10 second and 30 second interval, respectively.

Log files are managed via Winston using a plain-text, append-only file on your instance. Log files are capped at 10MB to avoid overwhelming your instance's disk. Every 10 seconds, your app will send its latest log file to Push and Push will parse that data for storage and display in the Push dashboard.

Log Files Encrypted

For enhanced security, log files are encrypted on your instance before being relayed to Push. Logs are encrypted-at-rest and are only decrypted at retrieval and display time in the Push dashboard.

Metrics for your instance are collected every 30 seconds. Joystick will "snapshot" your instance's CPU, RAM, and Disk utilization and then send it to Push. If and when any instance's utilization of a given metric is >= 80%, that instance will be flagged as degraded in the Push dashboard.

For health checks, Push "pings" your app every 30 seconds. Internally, Push uses these health checks to determine whether or not your instance(s) is available. If Push fails to ping your app for > 2 minutes, your instance will be flagged as down in the Push dashboard.