A simple HTTP server that everlasting says "Hey, Yo!" every second in the background.
Note
This application is heavily inspired by toricls/everlasting-hey-yo.
everlasting-hey-yo
was created to test signal reception from an ECS Task.everlasting-hey-yo-http
was created to test signal reception from a Cloud Run Service.
docker run ghcr.io/umatare5/everlasting-hey-yo-http
then, you'll see everlasting "Hey, Yo!" every second.
Hey, Yo!
Hey, Yo!
...
Tip
The application is also available the binaries. Please download them from release page.
- The application works on
linux_amd64
,linux_arm64
,darwin_amd64
,darwin_arm64
andwindows_amd64
.
Run the application with the following command.
./hey-yo-http
The application traps a SIGTERM
and a SIGKILL
.
-
When receive a
SIGTERM
, the application repeats "Hey" 3 times as follows.... Hey, Yo! Hey, Hey, Hey, Yo!!! # << Send "SIGTERM" Hey, Yo! ...
-
When receive a
SIGKILL
, the application will be stopped.... Hey, Yo! Hey, Yo! 'hey-yo-http' terminated by signal SIGKILL (Forced quit) # << Send "SIGKILL"
The application supports the following environment variables:
Name | Description |
---|---|
BE_QUIET |
If set to any value, the application silences "Hey, Yo!" every second. |
GIVE_ME_PATTERN |
If set to any value, the application says "Check It Out! Yo!" with 50% of the time. |
Note
To launch a docker container with user-defined environment variables, run the following command:
$ docker run -e GIVE_ME_PATTERN=1 ghcr.io/umatare5/everlasting-hey-yo-http
Starting HTTP server on port 8080
Check It Out! Yo!
Hey, Yo!
Hey, Yo!
Hey, Yo!
Hey, Yo!
Check It Out! Yo!
Hey, Yo!
Check It Out! Yo!
Cloud Run automatically restarts the instance by SIGKILL
10 seconds after sending a SIGTERM
.
I needed to measure the differences by each region and the resources assigned to it, using an application that continues to batch process.
Command | |
---|---|
make build |
Build the application in the ./dist/ directory. |
make docker-image |
Build a container image within the application. |
Please use ./scripts/deploy_to_cloud_run.sh.
- This script deploys a service to the active project in gcloud.
- The service will be launched in both
asia-northeast1
andasia-northeast2
. - 10 services per region will be set up with a minimum resource allocation.
- 1 service per region will be set up with 4 CPU cores and 16GB of memory.
As a result, the services are created as follows:
I'm manually releasing the application.
-
Set and push a tag.
git tag vX.Y.Z && git push --tags
-
Run the release workflow.
- Fork (https://github.com/umatare5/everlasting-hey-yo-http/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Create a new Pull Request