Back to Blog

Rack 0.6: One-Off Processes, Visibility, and Stability

This release includes stability improvements, one-off processes, and application visibility. If you're new to Convox you can follow our Getting Started guide to get up and running in less than 10 minutes. Existing users can upgrade to the latest release with: convox update && convox rack update

One-off processes

convox run

Creates a new container and runs a one-off command.

$ convox run web 'psql $POSTGRES_URL'

Welcome to psql 9.4.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

app=>

convox exec

Runs a new process in an existing container.

$ convox ps
ID NAME RELEASE CPU MEM STARTED COMMAND
68831d3dce63 web RNJYVQUMKKU 0.00% 24.39% 5 days ago sh -c bin/web

$ convox exec 68831d3dce63 ps ax
PID USER TIME COMMAND
1 root 0:00 sh -c bin/web
7 root 0:00 {web} /bin/sh bin/web
10 root 0:01 unicorn master -c unicorn.rb
12 root 0:25 unicorn worker[0] -c unicorn.rb
15 root 0:25 unicorn worker[1] -c unicorn.rb
18 root 0:00 sh -c sh
23 root 0:00 sh
24 root 0:00 ps ax

$ convox exec 68831d3dce63 strace -p 12
Process 12 attached
select(11, [9 10], NULL, NULL, {14, 928687}) = 1 (in [9], left {13, 589336})
clock_gettime(CLOCK_REALTIME, {1444311278, 670333503}) = 0
fcntl(9, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
accept4(9, 0x7fff2f48eee8, [128], SOCK_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)

Visibility

convox ps now includes usage metrics:

$ convox ps
ID NAME RELEASE CPU MEM STARTED COMMAND
3521b98e67f5 web RRULVULRDMK 0.00% 24.74% 1 week ago sh -c bin/web
4f1c6df55bf2 worker RRULVULRDMK 4.91% 1.45% 1 week ago sh -c bin/worker

Introspect the system itself with the app name convox:

$ convox logs --app convox
registry: 127.0.0.1 - - [08/Oct/2015:13:42:13 +0000] "GET /v1/_ping HTTP/1.0" 200 2 "-"
registry: 127.0.0.1 - - [08/Oct/2015:13:42:13 +0000] "GET /v1/_ping HTTP/1.0" 200 2 "-"
web: ns=kernel at=app.list state=success elapsed=175.950
web: ns=kernel at=request state=success status=200 method="GET" path="/apps" elapsed=176.031

$ convox ps --app convox
ID NAME RELEASE CPU MEM STARTED COMMAND
56e32c7411e6 registry 20151008011228 90.23% 43.60% 1 week ago /docker-entrypoint.sh
6ea6e21bf6e5 web 20151008011228 13.31% 32.62% 1 week ago /go/bin/init bin/web

API

You can explore the API from the command line:

$ convox api get /apps
[
{
"balancer": "myapp-1749418666.us-east-1.elb.amazonaws.com",
"name": "myapp",
"release": "REXIQURVKXE",
"status": "running"
},
]

$ convox api get /apps/myapp/processes
[
{
"app": "myapp",
"command": "bin/web",
"cpu": 0.0329,
"host": "10.0.3.135",
"id": "13254981d20",
"image": "registry.internal:5000/myapp-web:BHLRYHSMXNM",
"memory": 0.2068,
"name": "web",
"ports": [
"80:3000",
"443:3001"
],
"release": "REXIQURVKXE",
"started": "2015-01-01T00:00:00Z"
}
]

New Services

Notable Changes

Discuss on Hacker News

Let your team focus on what matters.