Skip to content

Commit 4451360

Browse files
authored
Merge pull request #130 from Benezivas/4.0.0-rc
Release version 4.0.0
2 parents 3807d67 + 5eb01c9 commit 4451360

File tree

189 files changed

+8976
-2491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+8976
-2491
lines changed

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
3+
{
4+
"name": "Algobattle",
5+
"build": {
6+
"context": "..",
7+
"dockerfile": "../Dockerfile.dev"
8+
},
9+
"mounts": [
10+
"source=${localWorkspaceFolder}/../algobattle-problems/algobattle_problems,target=/algobattle/problems,type=bind",
11+
"source=algobattle_input,target=/algobattle/input",
12+
"source=algobattle_output,target=/algobattle/output"
13+
],
14+
"features": {
15+
"ghcr.io/devcontainers/features/docker-outside-of-docker": {}
16+
}
17+
}

.flake8

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[flake8]
2+
count = True
3+
show_source = True
4+
statistics = True
5+
max_line_length = 120
6+
per_file_ignores =
7+
tests/*: D102, D104, D107
8+
docs/*: D100, E261
9+
docstring_convention = google
10+
ignore = D105, D401, E302, W503
11+
exclude =
12+
.git,
13+
__pycache__,
14+
ignore_decorators=inherit_docs

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI code checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main, develop ]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.11"
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install flake8 flake8-docstrings
20+
- name: Lint with flake8
21+
run: flake8 .
22+
23+
test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Set up Python
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: "3.11"
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install . --user
35+
- name: Test using unittests
36+
run: python -m unittest --failfast

.github/workflows/python-app.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
8+
jobs:
9+
pypi-publish:
10+
name: Upload release to PyPI
11+
runs-on: ubuntu-latest
12+
environment: release
13+
permissions:
14+
# IMPORTANT: this permission is mandatory for trusted publishing
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: pdm-project/setup-pdm@v3
19+
- name: Publish package distributions to PyPI
20+
run: pdm publish
21+
22+
release:
23+
name: Create Github release
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
- uses: actions/setup-python@v4
29+
with:
30+
python-version: 3.11
31+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
32+
- uses: actions/cache@v3
33+
with:
34+
key: mkdocs-material-${{ env.cache_id }}
35+
path: .cache
36+
restore-keys: |
37+
mkdocs-material-
38+
- run: pip install mkdocs-material pymdown-extensions mkdocstrings[python] mdx_include
39+
- name: Build docs
40+
run: mkdocs build -d ./site
41+
- name: zip docs
42+
run: zip -r docs.zip ./site
43+
- name: tar docs
44+
run: tar czf docs.tar.gz -C ./site .
45+
- name: Release
46+
uses: softprops/action-gh-release@v1
47+
with:
48+
generate_release_notes: true
49+
files: |
50+
docs.zip
51+
docs.tar.gz
52+
53+
deploy-docs:
54+
name: Deploy docs to github pages
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
- uses: actions/setup-python@v4
59+
with:
60+
python-version: 3.x
61+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
62+
- uses: actions/cache@v3
63+
with:
64+
key: mkdocs-material-${{ env.cache_id }}
65+
path: .cache
66+
restore-keys: |
67+
mkdocs-material-
68+
- run: pip install mkdocs-material pymdown-extensions mkdocstrings[python] mdx_include
69+
- run: mkdocs gh-deploy --force

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
**/__pycache__
2-
algobattle.egg-info/*
3-
.vscode/*
2+
algobattle.egg-info
3+
.vscode
4+
.pdm-python
5+
pdm.lock
6+
build
7+
dist
8+
site
9+
docs/src/pairsum_solver/target
10+
docs/src/pairsum_solver/Cargo.lock
11+
.results
12+
.project

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.11
2+
3+
WORKDIR /src/algobattle
4+
COPY . .
5+
RUN pip install .
6+
7+
ENTRYPOINT [ "algobattle" ]
8+
CMD ["-h"]

Dockerfile.dev

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.11
2+
3+
ENV ALGOBATTLE_IO_VOLUMES=true
4+
WORKDIR /workspaces/algobattle
5+
COPY . .
6+
RUN pip install -e . --config-settings editable_mode=compat
7+
WORKDIR /
8+
RUN rm -rf /workspaces

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,60 @@
22

33
The lab course "Algorithmic Battle" is offered by the
44
[Computer Science Theory group of RWTH Aachen University](https://tcs.rwth-aachen.de/)
5-
since 2019. This repository contains the necessary code and documentation to
6-
set up the lab course yourself.
7-
8-
The idea of the lab is to pose several, usually NP-complete problems during the
9-
semester.
10-
Groups of students then write code that generates hard-to-solve instances for
11-
these problems and solvers that solve these problems quickly. In the default
12-
setting, the groups then battle against each other, generating instances of
13-
increasing size that the other group has to solve within a time limit.
14-
Points are distributed relative to the biggest instance size for which a group
15-
was still able to solve an instance.
16-
17-
# Installation
18-
This project has been delevoped to run on Linux and may not work on other
19-
platforms. Support for other platforms may be implemented in the future.
20-
21-
`python3` in version at least `3.6` and `docker` are required.
22-
23-
We recommend installing the package as a user using `pip`
24-
```
25-
pip install . --user
26-
```
27-
28-
Adjust the parameters set in the `algobattle/configs/config.ini` file to set
29-
which hardware resources you want to assign. You can pass alternative
30-
configuration files to the script using the `--config_file` option.
31-
32-
This program requires the `curses` module which is available by default on Linux
33-
and can be manually installed on windows, e.g. with
34-
```
35-
pip install windows-curses
36-
```
37-
38-
# Usage
39-
This repository does not include any practical problems. For a selection of problems
40-
that have been posed to students in practice, have a look at the
41-
[algobattle-problems](https://github.com/Benezivas/algobattle-problems) repository.
42-
43-
To start a basic run on a problem, using the `solver` and `generator` that
44-
are part of the problem directory, use
45-
```
46-
battle path/to/concrecte/problem/folder
47-
```
48-
49-
The `battle` script offers several options, e.g. to give custom paths for
50-
solvers and generators. Run `battle --help` for all options.
51-
52-
On Windows you will need to either use a workaround such as [this one](https://stackoverflow.com/a/55619189)
53-
or invoke it with
54-
```
55-
python path\to\installed\battle\script
56-
```
57-
followed by your arguments instead of just `battle`.
58-
59-
Check the [wiki](https://github.com/Benezivas/algobattle/wiki) for further documentation.
5+
since 2019. This repository contains the necessary code and
6+
documentation to set up the lab course yourself.
7+
8+
In an Algorithmic Battle, pairs of teams compete against one another
9+
in order to solve a problem of your choice, e.g. a problem from the
10+
class NP. The teams each design a `generator`, that outputs
11+
hard-to-solve instances for a given instance size, as well as a
12+
`solver` that accepts an instance and outputs a solution to it as
13+
quickly as possible.
14+
15+
The framework is written to be completely language-agnostic regarding
16+
the code of the `generator` and the `solver`, as each is wrapped in a
17+
docker container that only needs to adhere to an I/O structure of your
18+
choice (by default, in the form of `json`-files.)
19+
20+
If you are interested in how to use the framework for a
21+
lab course of your own, please consult our
22+
[teaching concept](https://www.algobattle.org/docs/teaching_concept/english).
23+
# Installation and Usage
24+
This project is developed and tested on all major operating systems.
25+
26+
Please consult the official [documentation](https://www.algobattle.org/docs/)
27+
for detailed instructions on installation and usage.
28+
29+
# Related projects
30+
This repository only includes the core framework for executing an
31+
`Algorithmic Battle`. For a selection of concrete problems that you
32+
can use to play around with the framework, have a look at the
33+
[algobattle-problems](https://github.com/Benezivas/algobattle-problems)
34+
repository. These are problems that have been posed to students in
35+
some form over the past years.
36+
37+
While the framework provides all essential tools to host a tournament
38+
yourself, e.g. in the form of a lab course, you may be interested in
39+
the [algobattle-web](https://github.com/Benezivas/algobattle-problems)
40+
project. The `algobattle-web` project implements a webframework with
41+
which you are able to comfortably manage your students teams and their
42+
code, your problem files and their documentation as well as schedule
43+
matches to be fought between registered student teams, using the
44+
`algobattle` API.
45+
46+
# Contributing
47+
48+
We welcome any input on how to make this project accessible to as many
49+
people as possible. If you have feedback regarding the usage of the
50+
framework, the documentation or would even like to help us out with
51+
corrections, new features, or translations, feel free to open an issue
52+
or pull request. We have developed this project on the basis of
53+
practical experience inside our lab courses, thus some design elements
54+
may be unintuitive to you. Feel free to point out anything that
55+
appears odd to you.
56+
57+
# Funding
58+
The development of version `4.0.0` was funded by
59+
[`Stiftung Innovation in der Hochschullehre`](https://stiftung-hochschullehre.de/en/) (Project
60+
`FRFMM-106/2022 Algobattle`) and by the [Department of Computer Science of
61+
RWTH Aachen University](https://www.informatik.rwth-aachen.de/go/id/mxz/?lidx=1).

0 commit comments

Comments
 (0)