feat(docker-compose): Add docker-compose.yml #100 (#130)

* feat(docker-compose): Add `docker-compose.yml` #100

Signed-off-by: Ryan Russell <git@ryanrussell.org>

* docs(build-from-source): Include build from source

Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
Ryan Russell 2022-06-10 08:30:05 -05:00 committed by GitHub
parent e82a378354
commit ff632b1c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 223 additions and 9 deletions

View File

@ -19,7 +19,7 @@ Dragonfly's core properties make it a cost-effective, high-performing, and easy-
## Benchmarks
<img src="doc/throughput.svg" width="80%" border="0"/>
<img src="docs/throughput.svg" width="80%" border="0"/>
Dragonfly is crossing 3.8M QPS on c6gn.16xlarge reaching x25 increase in throughput compared to Redis.
@ -47,13 +47,13 @@ In the following test, we filled Dragonfly and Redis with ~5GB of data
using `debug populate 5000000 key 1024` command. Then we started sending the update traffic with `memtier` and kicked off the snapshotting with the
"bgsave" command. The following figure demonstrates clearly how both servers behave in terms of memory efficiency.
<img src="doc/bgsave_memusage.svg" width="70%" border="0"/>
<img src="docs/bgsave_memusage.svg" width="70%" border="0"/>
Dragonfly was 30% more memory efficient than Redis at the idle state.
It also did not show any visible memory increase during the snapshot phase.
Meanwhile, Redis reached almost x3 memory increase at peak compared to Dragonfly.
Dragonfly also finished the snapshot much faster, just a few seconds after it started.
For more info about memory efficiency in Dragonfly see [dashtable doc](./doc/dashtable.md)
For more info about memory efficiency in Dragonfly see [dashtable doc](/docs/dashtable.md)
## Running the server
@ -65,10 +65,7 @@ Debian/Bullseye, Ubuntu 20.04.4 or later fit these requirements.
### With docker:
```bash
docker pull docker.dragonflydb.io/dragonflydb/dragonfly && \
docker tag docker.dragonflydb.io/dragonflydb/dragonfly dragonfly
docker run --network=host --ulimit memlock=-1 --rm dragonfly
docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly
redis-cli PING # redis-cli can be installed with "apt install -y redis-tools"
```
@ -140,7 +137,7 @@ support order of magnitude higher speeds when replicating.
After replication and failover feature we will continue with other Redis commands from
APIs 3,4 and 5.
Please see [API readiness doc](doc/api_status.md) for the current status of Dragonfly.
Please see [API readiness doc](docs/api_status.md) for the current status of Dragonfly.
### Milestone - H/A
Implement leader/follower replication (PSYNC/REPLICAOF/...).
@ -169,7 +166,7 @@ with millisecond precision (PEXPIRE/PSETEX etc) will be rounded to closest secon
Such rounding has less than 0.001% error which I hope is acceptable for large ranges.
If it breaks your use-cases - talk to me or open an issue and explain your case.
For more detailed differences between this and Redis implementations [see here](doc/differences.md).
For more detailed differences between this and Redis implementations [see here](docs/differences.md).
### Native Http console and Prometheus compatible metrics
By default Dragonfly allows http access via its main TCP port (6379). That's right, you

61
contrib/docker/README.md Normal file
View File

@ -0,0 +1,61 @@
<p align="center">
<a href="https://dragonflydb.io">
<img src="https://raw.githubusercontent.com/dragonflydb/dragonfly/main/.github/images/logo-full.svg"
width="284" border="0" alt="Dragonfly">
</a>
</p>
# Dragonfly DB with Docker Compose
This guide will have you up running DragonflyDB with `docker-compose` in just a few minutes.
| This guide assumes you have `docker` and `docker-compose` installed on your machine. If not, [Install Docker](https://docs.docker.com/get-docker/) and [Install Docker Compose](https://docs.docker.com/compose/install/) before continuing.
## Step 1
```bash
# Download Official Dragonfly DB Docker Compose File
wget https://github.com/dragonflydb/dragonfly/tree/main/contrib/docker/docker-compose.yml
# Launch the Dragonfly DB Instance
docker-compose up -d
# Confirm image is up
docker ps | grep dragonfly
# ac94b5ba30a0 docker.dragonflydb.io/dragonflydb/dragonfly "entrypoint.sh drago…" 45 seconds ago Up 31 seconds 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp docker_dragonfly_1
# Log follow the dragonfly container
docker logs -f docker_dragonfly_1
```
Dragonfly DB will answer to both `http` and `redis` requests out of the box!
You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379`
## Step 2
Connect with a redis client.
From a new terminal:
```bash
redis-cli
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> keys *
1) "hello"
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379>
```
## Step 3
Continue being great and build your app with the power of DragonflyDB!
### More Build Options
- [Docker Quick Start](/docs/quick-start/)
- [Kubernetes Deployment with Helm Chart](/contrib/charts/dragonfly/)
- [Build From Source](/docs/build-from-source.md)

View File

@ -0,0 +1,10 @@
version: '3.8'
services:
dragonfly:
image: 'docker.dragonflydb.io/dragonflydb/dragonfly'
ports:
- "6379:6379"
volumes:
- dragonflydata:/data
volumes:
dragonflydata:

33
docs/README.md Normal file
View File

@ -0,0 +1,33 @@
<p align="center">
<a href="https://dragonflydb.io">
<img src="https://raw.githubusercontent.com/dragonflydb/dragonfly/main/.github/images/logo-full.svg"
width="284" border="0" alt="Dragonfly">
</a>
</p>
# Quick Start
The easiest way to get started with Dragonfly is with Docker.
## Deployment Method
First, choose a deployment method.
If you are new to Dragonfly, we recommend the [DragonflyDB Docker Quick Start Guide](/docs/quick-start/)
Other options:
### - [Docker Compose](/contrib/docker/)
### - [Helm Chart for Kubernetes](/contrib/charts/dragonfly/)
# Learn About DragonflyDB
## [FAQ](/docs/faq.md)
## [Differences Between DragonflyDB and Redis](/docs/differences.md)
## [API Command Status](/docs/api_status.md)

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

66
docs/build-from-source.md Normal file
View File

@ -0,0 +1,66 @@
# Build DragonflyDB From Source
## Running the server
Dragonfly runs on linux. It uses relatively new linux specific [io-uring API](https://github.com/axboe/liburing)
for I/O, hence it requires `Linux verion 5.10` or later.
Debian/Bullseye, `Ubuntu 20.04.4` or later fit these requirements.
### WARNING: Building from source on older kernels WILL NOT WORK.
If your host machine does not have at least `Linux verion 5.10` or later, we suggest you choose a [Dockerized Quick Start](/docs/quick-start/).
## Step 1
```bash
git clone --recursive https://github.com/dragonflydb/dragonfly && cd dragonfly
```
## Step 2
```bash
# Install dependencies
sudo apt install ninja-build libunwind-dev libboost-fiber-dev libssl-dev \
autoconf-archive libtool cmake g++
```
## Step 3
```bash
# Configure the build
./helio/blaze.sh -release
# Build
cd build-opt && ninja dragonfly
```
## Step 4
```bash
# Run
./dragonfly --alsologtostderr
```
Dragonfly DB will answer to both `http` and `redis` requests out of the box!
You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379`
## Step 5
Connect with a redis client
```bash
redis-cli
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> keys *
1) "hello"
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379>
```
## Step 6
Continue being great and build your app with the power of DragonflyDB!

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -0,0 +1,47 @@
<p align="center">
<a href="https://dragonflydb.io">
<img src="https://raw.githubusercontent.com/dragonflydb/dragonfly/main/.github/images/logo-full.svg"
width="284" border="0" alt="Dragonfly">
</a>
</p>
# Quick Start
Starting with `docker run` is the simplest way to get up and running with DragonflyDB.
If you do not have docker on your machine, [Install Docker](https://docs.docker.com/get-docker/) before continuing.
## Step 1
```bash
docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly
```
Dragonfly DB will answer to both `http` and `redis` requests out of the box!
You can use `redis-cli` to connect to `localhost:6379` or open a browser and visit `http://localhost:6379`
## Step 2
Connect with a redis client
```bash
redis-cli
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> keys *
1) "hello"
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379>
```
## Step 3
Continue being great and build your app with the power of DragonflyDB!
### More Build Options
- [Docker Compose Deployment](/contrib/docker/)
- [Kubernetes Deployment with Helm Chart](/contrib/charts/dragonfly/)
- [Build From Source](/docs/build-from-source.md)

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB