Skip to content

Commit

Permalink
Build docker container for reporting (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
Delaunay authored Feb 26, 2024
1 parent 604ad7f commit 2dea498
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/report_container.yml
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions docker/Dockerfile-report
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2dea498

Please sign in to comment.