-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build docker container for reporting (#197)
- Loading branch information
Showing
2 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|