diff --git a/.github/workflows/report_container.yml b/.github/workflows/report_container.yml new file mode 100644 index 000000000..fbe9bc378 --- /dev/null +++ b/.github/workflows/report_container.yml @@ -0,0 +1,67 @@ +name: Publish Docker image for reports + +on: + # Allow manual runs + workflow_dispatch: + + # Only run for push on the main branch or for tagged version + push: + branches: + - master + tags: + - v*.*.* + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + + +permissions: + packages: write + + +# define build arguments +jobs: + build-image: + strategy: + fail-fast: false + + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Get Image Tag Name + env: + GITHUB_REF_NAME_ENV: ${{ github.ref_name }} + run: | + IMAGE_TAG="report" + + - name: Log in to the registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for the image + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=report-${{ env.IMAGE_TAG }} + + - name: Build and push the image + uses: docker/build-push-action@v3 + with: + context: . + push: true + file: docker/Dockerfile-report + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + CONFIG=standard.yaml diff --git a/docker/Dockerfile-report b/docker/Dockerfile-report new file mode 100644 index 000000000..629cade0f --- /dev/null +++ b/docker/Dockerfile-report @@ -0,0 +1,48 @@ +FROM ubuntu:22.04 + + +# Arguments +# --------- + +ARG ARCH=cuda +ENV MILABENCH_GPU_ARCH=$ARCH + +ARG CONFIG=standard.yaml +ENV MILABENCH_CONFIG_NAME=$CONFIG +ENV MILABENCH_DOCKER=1 + +# Paths +# ----- + +ENV MILABENCH_CONFIG=/milabench/milabench/config/$MILABENCH_CONFIG_NAME +ENV MILABENCH_BASE=/milabench/envs +ENV MILABENCH_OUTPUT=/milabench/results/ +ENV MILABENCH_ARGS="" + +# Copy milabench +# -------------- + +WORKDIR /milabench +COPY . /milabench/milabench/ + +# Install Dependencies +# -------------------- + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update -y &&\ + apt-get install -y python3 python-is-python3 python3-pip &&\ + apt-get update -y &&\ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* + +# Install Milabench +# ----------------- + +RUN python -m pip install -U pip &&\ + python -m pip install -U setuptools &&\ + python -m pip install -U poetry &&\ + python -m pip install -e /milabench/milabench/ &&\ + python -m pip cache purge + +CMD milabench report +