Skip to content

Commit

Permalink
wip: allow easy access to contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
BerndCzech committed Oct 9, 2024
1 parent 4284119 commit 863f9f0
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 54 deletions.
15 changes: 0 additions & 15 deletions .dockerignore

This file was deleted.

6 changes: 0 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
EOS_VERSION=latest
EOS_PORT=8503

MARIADB_VERSION=11.1.6
PYTHON_VERSION=3.12.6

MARIADB_ROOT_PASSWORD=ruth
MARIADB_DATABASE=eos
MARIADB_USER=eos
MARIADB_PASSWORD=eos
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ data/
!.vscode/extensions.json
!.vscode/*.code-snippets

# dont
.idea

# Local History for Visual Studio Code
.history/

Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ There are just too many possibilities and the project would drown in tickets oth

## Code Contributions

We welcome code contributions and bug fixes via [Pull Requests](https://github.com/Akkudoktor-EOS/EOS/pulls).
To make collaboration easier, we require pull requests to pass code style and unit tests.
We welcome code contributions and bug fixes via [Pull Requests](https://github.com/Akkudoktor-EOS/EOS/pulls). We use
forks [see](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
for details. To make collaboration easier, we require pull requests to pass code style and unit tests.

### Code Style

Our code style checks use [`pre-commit`](https://pre-commit.com).

```bash
pip install -r requirements.txt
pip install -r requirements.txt requirements-dev.txt
```

To run formatting automatically before every commit:
Expand Down
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ EXPOSE 5000

WORKDIR /opt/eos

COPY . .

ARG APT_OPTS="--yes --auto-remove --no-install-recommends --no-install-suggests"
COPY src src
COPY pyproject.toml pyproject.toml
COPY requirements.txt requirements.txt

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install ${APT_OPTS} gcc libhdf5-dev libmariadb-dev pkg-config mariadb-common libmariadb3 \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir build \
&& pip install --no-cache-dir -e . \
&& apt remove ${APT_OPTS} gcc libhdf5-dev libmariadb-dev pkg-config
&& pip install --no-cache-dir -e .

ENTRYPOINT []

CMD ["python", "-m", "akkudoktoreos.flask_server"]
CMD ["python", "-m", "akkudoktoreosserver.flask_server"]
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ all: help
# Target to display help information
help:
@echo "Available targets:"
@echo " venv - Set up a Python 3 virtual environment."
@echo " pip - Install dependencies from requirements.txt."
@echo " pip-dev - Install dependencies from requirements-dev.txt."
@echo " install - Install EOS in editable form (development mode) into virtual environment."
@echo " docker-run - Run entire setup on docker
@echo " docs - Generate HTML documentation using pdoc."
@echo " run - Run flask_server in the virtual environment (needs install before)."
@echo " dist - Create distribution (in dist/)."
@echo " clean - Remove generated documentation, distribution and virtual environment."
@echo " venv - Set up a Python 3 virtual environment."
@echo " pip - Install dependencies from requirements.txt."
@echo " pip-dev - Install dependencies from requirements-dev.txt."
@echo " install - Install EOS in editable form (development mode) into virtual environment."
@echo " docker-run - Run entire setup on docker
@echo " docker-rebuild - Run entire setup on docker
@echo " docs - Generate HTML documentation using pdoc."
@echo " run - Run flask_server in the virtual environment (needs install before)."
@echo " dist - Create distribution (in dist/)."
@echo " clean - Remove generated documentation, distribution and virtual environment."

# Target to set up a Python 3 virtual environment
venv:
Expand Down Expand Up @@ -69,6 +70,12 @@ test:
@echo "Running tests..."
.venv/bin/pytest

# Run entire setup on docker
docker-rebuild:
@docker compose down
@docker compose build --no-cache
@docker compose up -d

# Run entire setup on docker
docker-run:
@docker compose up
13 changes: 0 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,10 @@ services:
dockerfile: 'Dockerfile'
args:
PYTHON_VERSION: '${PYTHON_VERSION}'
depends_on:
- 'mariadb'
init: true
environment:
FLASK_RUN_PORT: '${EOS_PORT}'
networks:
- 'eos'
ports:
- '${EOS_PORT}:${EOS_PORT}'
mariadb:
image: 'mariadb:${MARIADB_VERSION}-jammy'
environment:
MARIADB_ROOT_PASSWORD: '${MARIADB_ROOT_PASSWORD}'
MARIADB_DATABASE: '${MARIADB_DATABASE}'
MARIADB_USER: '${MARIADB_USER}'
MARIADB_PASSWORD: '${MARIADB_PASSWORD}'
networks:
- 'eos'
volumes:
- ./data/mariadb:/var/lib/mysql
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
numpy==2.1.2
mariadb==1.1.10
matplotlib==3.9.2
flask==3.0.3
scikit-learn==1.5.2
Expand Down

0 comments on commit 863f9f0

Please sign in to comment.