diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 829b008..2ce1593 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -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: @@ -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 }} \ No newline at end of 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 }} diff --git a/benchmark-dev.Dockerfile b/benchmark-dev.Dockerfile new file mode 100644 index 0000000..7186a9e --- /dev/null +++ b/benchmark-dev.Dockerfile @@ -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 diff --git a/install_docker.sh b/install_docker.sh new file mode 100755 index 0000000..4706f16 --- /dev/null +++ b/install_docker.sh @@ -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