From 280ce351a87fb2af1dc5373b62f8dfa62997fd75 Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Wed, 11 May 2022 20:37:25 +0300 Subject: [PATCH] Fix CI after moving the repo --- .github/workflows/ci.yml | 8 +++--- .github/workflows/docker-release.yml | 23 +++++++++++------ README.md | 37 ++++++++++++++-------------- tools/docker/Dockerfile.ubuntu-prod | 7 ++++++ 4 files changed, 46 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6e04ff..a17817f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,10 @@ jobs: container: ["ubuntu-dev:20", "alpine-dev:latest"] timeout-minutes: 30 container: - image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }} - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + image: ghcr.io/romange/${{ matrix.container }} + # credentials: + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index d852a93..1e1675e 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -3,6 +3,10 @@ name: docker release on: workflow_dispatch: +permissions: + packages: write + contents: read + jobs: # =============================================================== # Building Dev Images @@ -26,7 +30,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} @@ -39,7 +43,7 @@ jobs: # platforms: linux/amd64,linux/arm64 # push: ${{ github.event_name != 'pull_request' }} # tags: | - # ghcr.io/${{ github.repository }}/dragonfly:alpine + # ghcr.io/${{ github.repository }}:alpine # file: tools/docker/Dockerfile.alpine-prod - name: Build dragonfly ubuntu @@ -47,11 +51,16 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 + + # Define QEMU settings inside the builder build-args: | - QEMU_CPU='help' + QEMU_CPU=max,pauth-impdef=on + push: ${{ github.event_name != 'pull_request' }} tags: | - ghcr.io/${{ github.repository }}/dragonfly:ubuntu - ghcr.io/${{ github.repository }}/dragonfly:latest - dragonfly - file: tools/docker/Dockerfile.ubuntu-prod \ No newline at end of file + ghcr.io/${{ github.repository }}:ubuntu + ghcr.io/${{ github.repository }}:latest + + file: tools/docker/Dockerfile.ubuntu-prod + cache-from: type=registry,ref=${{ github.repository }}:latest + cache-to: type=inline \ No newline at end of file diff --git a/README.md b/README.md index 4a1222b..809f9ee 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,17 @@ Ubuntu 20.04.4 or 22.04 fit these requirements. If built locally just run: -``` +```bash + ./dragonfly --logtostderr + ``` or with docker: -``` -docker pull ghcr.io/dragonflydb/dragonfly-ubuntu:latest && \ -docker tag ghcr.io/dragonflydb/dragonfly-ubuntu:latest dragonfly +```bash +docker pull ghcr.io/dragonflydb/dragonfly:latest && \ +docker tag ghcr.io/dragonflydb/dragonfly:latest dragonfly docker run --network=host --rm dragonfly ``` @@ -38,16 +40,16 @@ We support redis command arguments where applicable. For example, you can run: `docker run --network=host --rm dragonfly --requirepass=foo --bind localhost`. dragonfly currently supports the following commandline options: - * port - * bind - * requirepass - * maxmemory - * memcache_port - to enable memcached compatible API on this port. Disabled by default. - * dir - by default, dragonfly docker uses `/data` folder for snapshotting. You can use `-v` docker option to map it to your host folder. - * dbfilename - * dbnum - maximum number of supported databases for `select`. - * keys_output_limit - maximum number of returned keys in `keys` command. Default is 8192. - We truncate the output to avoid blowup in memory. + * `port` + * `bind` + * `requirepass` + * `maxmemory` + * `memcache_port` - to enable memcached compatible API on this port. Disabled by default. + * `dir` - by default, dragonfly docker uses `/data` folder for snapshotting. You can use `-v` docker option to map it to your host folder. + * `dbfilename` + * `dbnum` - maximum number of supported databases for `select`. + * `keys_output_limit` - maximum number of returned keys in `keys` command. Default is 8192. + We truncate the output to avoid blowup in memory when fetching too many keys. for more options like logs management or tls support, run `dragonfly --help`. @@ -56,7 +58,7 @@ for more options like logs management or tls support, run `dragonfly --help`. I've tested the build on Ubuntu 20.04+. Requires: CMake, Ninja, boost, libunwind8-dev -``` +```bash # to install dependencies sudo apt install ninja-build libunwind-dev libboost-fiber-dev libssl-dev @@ -75,11 +77,10 @@ cd build-opt && ninja dragonfly # build We are planning to implement most of the APIs 1.x and 2.8 (except the replication) before we release the project to source availability on github. In addition, we will support efficient expiry (TTL) and cache eviction algorithms. -The next milestone afterwards will be implementing `Redis->Dragonfly` and +The next milestone afterwards will be implementing `redis -> dragonfly` and `dragonfly<->dragonfly` replication. -For dragonfly-native replication we will design a distributed log format that will support -order of magnitude higher speeds when replicating. +For dragonfly-native replication we are planning to design a distributed log format that will support order of magnitude higher speeds when replicating. Commands that I wish to implement after releasing the initial code: - PUNSUBSCRIBE diff --git a/tools/docker/Dockerfile.ubuntu-prod b/tools/docker/Dockerfile.ubuntu-prod index a63a952..7d3425f 100644 --- a/tools/docker/Dockerfile.ubuntu-prod +++ b/tools/docker/Dockerfile.ubuntu-prod @@ -1,6 +1,10 @@ # syntax=docker/dockerfile:1 from ghcr.io/romange/ubuntu-dev:20 as builder +# Serves as environment variable during the build +# QEMU_CPU tunes how qemu emulator runs. +ARG QEMU_CPU + WORKDIR /build COPY src/ ./src/ COPY helio/ ./helio/ @@ -15,7 +19,10 @@ RUN curl -O https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c && # Now prod image FROM ubuntu:20.04 + +ARG QEMU_CPU ARG ORG_NAME=dragonflydb + LABEL org.opencontainers.image.title Dragonfly LABEL org.opencontainers.image.source https://github.com/${ORG_NAME}/dragonfly ENV DEBIAN_FRONTEND=noninteractive