Skip to content

Commit

Permalink
Dockerfile for benchmark dragonfly in container selfhosted runner
Browse files Browse the repository at this point in the history
Signed-off-by: adi_holden <[email protected]>

fix benckmark dockerfile for arm64
chore: wrap install docker in the shell script
  • Loading branch information
adiholden authored and romange committed Mar 26, 2024
1 parent f052101 commit f782cc0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 33 deletions.
65 changes: 32 additions & 33 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: Docker Image CI

on:
push:
branches: [ main ]
branches: [main]
workflow_dispatch:

permissions:
packages: write

jobs:
# ===============================================================
# Building Dev Image
# ===============================================================
# ===============================================================
# Building Dev Image
# ===============================================================
build_dev:
runs-on: ubuntu-latest
strategy:
Expand All @@ -33,39 +33,38 @@ jobs:
file: centos7-dev.Dockerfile
- container: "ubuntu-dev:24"
file: u24.04-dev.Dockerfile
- container: "benchmark-dev:latest"
file: benchmark-dev.Dockerfile

steps:
- name: checkout
uses: actions/checkout@v4
- name: checkout
uses: actions/checkout@v4

# https://github.com/docker/setup-qemu-action
-
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,amd64
-
name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

-
name: Build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.actor }}/${{ matrix.container }}
file: ${{ matrix.file }}
- name: Build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.actor }}/${{ matrix.container }}
file: ${{ matrix.file }}
20 changes: 20 additions & 0 deletions benchmark-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the base image
FROM ghcr.io/romange/ubuntu-dev:20 as base

COPY ./install_docker.sh /tmp/

RUN /tmp/install_docker.sh

# Install Node.js
RUN apt-get install -y nodejs npm && \
npm install -g npm

# Install dependencies (if needed)
RUN apt-get install -y build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev git &&\
rm -rf /var/lib/apt/lists/*

# Clone memtier_benchmark repository
RUN git clone https://github.com/RedisLabs/memtier_benchmark.git

# Build memtier_benchmark
RUN cd memtier_benchmark && autoreconf -ivf && ./configure && make && make install
13 changes: 13 additions & 0 deletions install_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -ex

if [[ $(uname -m) == "aarch64" ]]; then
ARCH='arm64'
else
ARCH='amd64'
fi

apt update && apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=$ARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update && apt-get install -y docker-ce

0 comments on commit f782cc0

Please sign in to comment.