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

Build docker container for reporting #197

Merged
merged 1 commit into from
Feb 26, 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
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

Loading