• Stars
    star
    943
  • Rank 48,473 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terminal User Interface for containers.

sen

Build Status

sen is a terminal user interface for containers:

  • it can interactively manage your containers and images:
  • start, stop, restart, kill, delete,...
  • there is a "dashboard" view for containers and images
  • you are able to inspect containers and images
  • sen can fetch logs of containers and even stream logs real-time
  • some buffers support searching and filtering
  • sen receives real-time updates from docker when anything changes
  • e.g. if you pull a container in another terminal, sen will pick it up
  • sen notifies you whenever something happens (and reports slow queries)
  • supports a lot of vim-like keybindings (j, k, gg, /, ...)
  • you can get interactive tree view of all images (equivalent of docker images --tree)
  • see how much space containers, images and volumes occupy (just type :df)

You can see the features yourself.

Preview of sen

Status

maintenance mode

I lost interest in working on new features for sen. I will continue providing support for sen as much as I can, but only bug fixes. Please don't expect any new features written by me. If you want some feature in sen, you need to write it yourself β€” I will gladly accept such pull request.

Installation and running sen

I strongly advise to run sen from a docker container provided on docker hub:

$ docker pull tomastomecek/sen

This repository has set up automated builds on docker hub. In case you run into some issue, try pulling latest version first before opening an issue.

This is the recommended way of running sen in a container:

$ docker run -v /var/run/docker.sock:/run/docker.sock -ti -e TERM tomastomecek/sen

Some distros have /var/run simlinked to /run, so you can do /run/docker.sock:/run/docker.sock instead.

In case you would like to try development version of sen, you can pull tomastomecek/sen:dev.

docker

You can easily build a docker image with sen inside:

$ docker build --tag=$USER/sen https://github.com/tomastomecek/sen
$ docker run -v /var/run/docker.sock:/run/docker.sock -ti -e TERM $USER/sen

PyPI

sen is using urwidtrees as a dependency. Unfortunately, the upstream maintainer doesn't maintain it on PyPI so we need to install it directly from git, before installing sen (the forked PyPI version has a bug in the installation process):

$ pip3 install git+https://github.com/pazz/urwidtrees.git@9142c59d3e41421ff6230708d08b6a134e0a8eed#egg=urwidtrees-1.0.3.dev

sen releases are available on PyPI:

$ pip3 install sen

If pip3 executable is not available on your system, you can run pip like this:

$ python3 -m pip install sen

And then start sen like this:

$ sen

git

sen is a python 3 only project. I recommend using at least python 3.4. This is how you can install sen from git:

$ git clone https://github.com/TomasTomecek/sen
$ cd sen
$ pip3 install --user -r ./requirements.txt
$ ./setup.py install
$ sen

Or even run sen straight from git:

$ git clone https://github.com/TomasTomecek/sen
$ cd sen
$ pip3 install --user -r ./requirements.txt
$ PYTHONPATH="$PWD:$PYTHONPATH" ./sen/cli.py

Prerequisite

Either:

  • The unix socket with the API for docker engine needs to be accessible. By default it's located at /run/docker.sock.

Or:

  • Have the DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH set properly.

Podman

Starting Podman v2.0, there is a Docker-compatible API provided by Podman. sen works well while talking to Podman over this API.

Connecting to Podman

Run Podman as:

$ podman system service -t 0

Let's discover the unix socket path now:

$ podman info --format={{".Host.RemoteSocket.Path"}}
/run/user/1000/podman/podman.sock

And finally tell sen to connect to it:

$ DOCKER_HOST=unix://$(podman info --format={{".Host.RemoteSocket.Path"}}) sen

Keybindings

Since I am heavy vim user, these keybindings are trying to stay close to vim.

Global

/         search (provide empty query to disable searching)
n         next search occurrence
N         previous search occurrence
f4        display only lines matching provided query (provide empty query to clear filtering)
f5        open a tree view of all images (`docker images --tree` equivalent)
ctrl o    navigate to next buffer
ctrl i    navigate to previous buffer
x         remove buffer
q         remove buffer, quit if no buffer is left
ctrl l    redraw user interface
h, ?      show help
:         open command prompt

Movement

gg, home  go to first item
G, end    go to last item
j         go one line down
k         go one line up
pg up
ctrl u    go 10 lines up
pg down
ctrl d    go 10 lines down

Listing

@         refresh listing
f4        filtering, for more info run `help filter` in sen

Image commands in listing

i         inspect image
d         remove image (irreversible!)
D         remove image forcibly (irreversible!)
enter     display detailed info about image (when layer is focused)

Container commands in listing

i         inspect container
l         display logs of container
f         follow logs of container
d         remove container (irreversible!)
D         remove container forcibly (irreversible!)
t         stop container
s         start container
r         restart container
p         pause container
u         unpause container
b         open container's mapped ports in a web-browser
X         kill container
!         toggle realtime updates of the interface (this is useful when you are removing multiple
          objects and don't want the listing change during that so you accidentally remove something)

Tree buffer

enter  display detailed info about image (opens image info buffer)

Image info buffer

enter     display detailed info about image (when an image is focused)
i         inspect image or container, whatever is focused

Container info buffer

enter     display detailed info about image (when image of the container is focued)
i         inspect image (when image of the container is focued)

Disk usage buffer

You can enter it by typing command df.

Why I started sen?

Since I started using docker, I always dreamed of having a docker TUI. Something like tig, htop or alot. Some appeared over time. Such as docker-mon or ctop. Unfortunately, those are not proper docker TUIs. They are meant for monitoring and diagnostics.

So I realized that if I want make my dream come true, I need to do it myself. That's where I started working on sen (dream in Slovak).

But! As the time went, someone else had the same idea as I did: dry.

More Repositories

1

tmux-top

Monitoring information for your tmux status line.
Go
49
star
2

pretty-git-prompt

`git status` inside your shell prompt
Rust
49
star
3

open-house-2016-demo

Open House 2016 demo: django channels example app in docker containers.
17
star
4

download-manifest-from-dockerhub

Simple pythin script to download manifest from Docker Hub.
Python
8
star
5

rust-container

Rust compiler and cargo in a container.
Python
7
star
6

intro-to-docker

This is a practical introduction to docker.
6
star
7

dotfiles

This is configuration of my system.
Python
6
star
8

dockerfile-fedora-chromium

Run chromium in docker container.
Shell
6
star
9

fed-install

install packages from different Fedora releases or directly from koji
Python
5
star
10

speaks

Collection of my talks
HTML
5
star
11

my-rpm-build-broke

What's wrong with my RPM build?
Python
5
star
12

ansible-nginx-container

Provisioning a container image using Ansible.
5
star
13

show-me

Show me my GitHub contributions!
Python
4
star
14

openalt-2014-cli

My workshop at conference OpenAlt 2014.
4
star
15

trello-reporter

Reporting from your trello boards! This is work in progress. Please, stay tuned.
Python
4
star
16

digest-of-a-manifest

code which computes digest from a docker v2 manifest
Python
3
star
17

simple-django-project

Simple django 1.7 project deployed on RHEL 7 with RHSCL
JavaScript
3
star
18

parse-dockerfile

use native parser of docker builder to parse dockerfile and output json
Go
3
star
19

rootless-podman-in-openshift

Demonstration of running rootless podman in an openshift pod.
Makefile
3
star
20

two-step-build

Building docker images: Build and install in two steps
Shell
3
star
21

taskotron-tasks

tasks for tasktron tool
Python
3
star
22

devconf-2016-atomic-workshop

Demos for our Atomic workshop at DevConf 2016
Python
2
star
23

patchwork-container

Containerized version of patchwork.
Python
1
star
24

flock2016-talk

This is my Flock 2016 talk - docker in production.
JavaScript
1
star
25

openalt-2015-oci-demo

Demo for my talk at openalt 2015 for my Open Containers talk
Python
1
star
26

hello-world-container

Minimal hello world docker image
1
star
27

MindTask

Extract tasks from mind map and push them to web-based task manager
Python
1
star
28

brno-beer-scrapers

Collection of scrapers for pubs in Brno, Czech Republic.
JavaScript
1
star
29

mastering-git-labs

Mastering git FI MUNI course: class 2 & 3 labs
1
star
30

the-real-blog

My blog backed by hugo
1
star
31

ilab-workshop

1
star