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

Add docker build as part of checks for x64/arm64 #601

Merged
merged 1 commit into from
Jul 31, 2024
Merged
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
38 changes: 38 additions & 0 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Build and Test
on:
pull_request:
workflow_dispatch:
inputs:
logLevel:
description: Log level
required: true
default: warning
type: choice
options:
- info
- warning
- debug

jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: ['linux/amd64', 'linux/arm64']
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: 'v0.9.1'
- uses: actions/checkout@v4
with:
path: 'opensearch-benchmark-git'
- name: Docker Build and Test on ${{ matrix.architecture }}
run: |
docker buildx version
cp -a opensearch-benchmark-git/* ./
echo "Disable VERSION arg to enter docker build test mode"
docker buildx build --platform ${{ matrix.architecture }} --build-arg BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` -f "docker/Dockerfile" .
42 changes: 0 additions & 42 deletions .github/workflows/docker.yml

This file was deleted.

16 changes: 12 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
###############################################################################

FROM python:3.11.2-slim
ARG VERSION
ARG VERSION=testing

ENV BENCHMARK_RUNNING_IN_DOCKER True
ENV BENCHMARK_RUNNING_IN_DOCKER=True

WORKDIR /opensearch-benchmark

RUN apt-get -y update && \
apt-get install -y curl git gcc pbzip2 pigz && \
Expand All @@ -16,9 +18,15 @@ RUN groupadd --gid 1000 opensearch-benchmark && \
useradd -d /opensearch-benchmark -m -k /dev/null -g 1000 -N -u 1000 -l -s /bin/bash benchmark

ENV PIP_ONLY_BINARY=h5py
RUN if [ -z "$VERSION" ] ; then python3 -m pip install opensearch-benchmark ; else python3 -m pip install opensearch-benchmark==$VERSION ; fi

WORKDIR /opensearch-benchmark
# Copy file for test purpose and will remove during prod publishing
COPY opensearch-benchmark-git/ ./opensearch-benchmark-git

# Currently we always have the $VERSION arg substituted during prod publishing
# Default VERSION=testing to enter test mode based on user inputs.
RUN if [ "$VERSION" = "testing" ] ; then echo Testing; cp -a opensearch-benchmark-git/* ./; ls -l; python3 -m pip install -e . ; \
else echo Production; rm -rf opensearch-benchmark-git; ls -l; python3 -m pip install opensearch-benchmark==$VERSION ; fi


RUN mkdir -p /opensearch-benchmark/.benchmark && \
chown -R 1000:0 /opensearch-benchmark/.benchmark
Expand Down
Loading