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 GitHub workflow for docker image #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
38 changes: 38 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Docker image
on:
push:
branches:
- master
jobs:
docker:
name: Push to GitHub Container Registry
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: "ghcr.io/${{ github.repository }}"
tags: |
type=sha
type=ref,event=branch
flavor: |
latest=true
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to registry
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM debian:12 AS builder
RUN apt-get update && apt-get install -y build-essential git cmake

WORKDIR /build
COPY . /build

RUN \
mkdir build && \
cd build && \
cmake .. && \
make GroupAssignment

FROM debian:12
RUN apt-get update && apt-get install -y \
nano \
mc \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /build/build/GroupAssignment /usr/local/bin/GroupAssignment

# copy source repo into container for easier experimentation
COPY . /source

COPY welcome.sh /etc/profile.d/welcome.sh
RUN echo "source /etc/profile.d/welcome.sh" >> /etc/bash.bashrc
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Docker Support
Es gibt auch ein Docker Image, welches genutzt werden kann, um ohne viel Aufwand den Zuteilungsalgorithmus zu testen.
```bash
docker run --rm -it ghcr.io/fsmi/gruppenzuteilung_o-phase:master
```

Der Quellcode des Projekts befindet sich zusätzlich in `/source`, so dass eigene Testläufe durchgeführt werden können.
Des weiteren hat [Chrisliebär](https://github.com/chrisliebaer) Beispieldaten bereitgestellt, mit denen die neue Mindestgröße von Gruppen getestet werden kann.
Diese haben keinen offiziellen Charakter, sondern dienen nur als Einstiegspunkt für eigene Tests.

-----------

<h1>O-Phase - Algorithmus zur Gruppeneinteilung</h1>

Implementiert einen Algorithmus zur Zuteilung von Erstis zu O-Phasen-Gruppen, wobei jeder Ersti die Gruppen bewerten kann.
Expand Down
16 changes: 16 additions & 0 deletions config/config_2022_min
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# input / output format
rating-input-type = mapping
output-per-team = true
input-per-team = true
allow-default-ratings = true
max-team-size = 5

# algorithm parameters
disabled-groups-per-step = 3
capacity-buffer = 1.05
use-min-group-sizes = true
#allow-min-group-size-default = true
min-group-size-effect = 2

# we don't want anyone below top 5 ratings
type-specific-assignment-treshold = 4
Loading