Skip to content

toricls/everlasting-hey-yo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

everlasting-hey-yo

MIT License Hey, Yo!

Everlasting "Hey, Yo!" per second

Usage

$ docker run public.ecr.aws/toricls/everlasting-hey-yo

then, you'll see everlasting "Hey, Yo!" per second.

Hey, Yo!
Hey, Yo!
...

So, what is this?

Hey-yo container is meant to know the duration between SIGTERM and its subsequent SIGKILL, roughly.

You can use Hey-yo to make sure that your container orchestrator issues docker stop with --stop option (or, docker run with --stop-timeout option) as expected.

Hey-yo traps SIGTERM

Hey-yo container react to a SIGTERM signal but does not stop by default.

Let's try sending a SIGTERM signal to your Hey-Yo container with the following command:

$ docker stop YOUR-CONTAINER-ID

then, you'll see the following line and Hey-Yo container will keep running.

...
Hey, Yo!
Hey, Hey, Hey, Yo!!! πŸ‘ˆ Hey-Yo container reacted to the SIGTERM signal, and keep running!
Hey, Yo!
Hey, Yo!
...

Options

You can change its behavior by specifying environment variables.

1. LET_ME_DIE: Let it stop with SIGTERM

Hey-Yo container stops with a SIGTERM signal.

$ docker run -e LET_ME_DIE=1 public.ecr.aws/toricls/everlasting-hey-yo

2. GIVE_ME_PATTERN: More message patterns

$ docker run -e GIVE_ME_PATTERN=1 public.ecr.aws/toricls/everlasting-hey-yo

then you'll see randomized, but meaningless, output.

...
Hey, Yo!
A lot of Hey, Yo!
Hey, Yo!
Hey, Yo!
A lot of Hey, Yo!
A lot of Hey, Yo!
Hey, Yo!
Hey, Yo!
Hey, Yo!
...

3. TIMESTAMP: Logs with timestamp

$ docker run -e TIMESTAMP=1 public.ecr.aws/toricls/everlasting-hey-yo

then you'll see timestamp-ed log output.

...
2020-05-07T11:17:05+0000 Hey, Yo!
2020-05-07T11:17:06+0000 Hey, Yo!
2020-05-07T11:17:07+0000 Hey, Yo!
2020-05-07T11:17:08+0000 Hey, Yo!
2020-05-07T11:17:09+0000 Hey, Yo!
...

Build your own Hey-Yo container

$ docker build -t YOUR-NAME/everlasting-hey-yo .
$ docker push YOUR-NAME/everlasting-hey-yo

Use Docker Hub hosted image instead of Amazon ECR Public

You can use toricls/everlasting-hey-yo:latest instead of public.ecr.aws/toricls/everlasting-hey-yo:latest.

Contribution

  1. Fork (https://github.com/toricls/everlasting-hey-yo/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Create a new Pull Request

Licence

MIT

Author

Tori