Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teaching the beetle to fly 💸 #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions projects/fly-beetle/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ghcr.io/tigerbeetle/tigerbeetle:latest

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 5000
28 changes: 28 additions & 0 deletions projects/fly-beetle/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# fly-beetle

Teaching the tigerbeetle to fly.

Prerequisites:
- [fly.io cli](https://fly.io/docs/hands-on/install-flyctl/)
- An account at fly.io

```bash
# Init a new application (But don't deploy it yet)
fly launch --no-deploy

# Need to allocate a static ip for the beetle
fly ip allocate-v4

# Ensure that the volume is at least 2GB
fly volumes extend --size 2

# The beetle is a hungry hippo
fly scale memory 4608
fly scale vm shared-cpu-4x

# Deploy the beetle
fly deploy

# Connect to the beetle
./tigerbeetle client --cluster=0 --addresses=[insert ip here]:5000
```
8 changes: 8 additions & 0 deletions projects/fly-beetle/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -eu
rm /data/tigerbeetle

if ! [ -e /data/tigerbeetle ]; then
/tigerbeetle format --cluster=0 --replica=0 --replica-count=1 /data/tigerbeetle
fi
exec /tigerbeetle start --cache-grid=512mb --addresses=0.0.0.0:5000 /data/tigerbeetle

19 changes: 19 additions & 0 deletions projects/fly-beetle/fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# fly.toml app configuration file generated for beetle on 2023-11-08T15:02:48-06:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "beetle"
primary_region = "qro"

[build]

[[mounts]]
source = "myapp_data"
destination = "/data"

[[services]]
internal_port = 5000
protocol = "tcp"
[[services.ports]]
port = "5000"