Commit
·
77bffd4
unverified
·
0
Parent(s):
Initial commit
Browse files- .github/dependabot.yml +6 -0
- .github/workflows/container-build.yml +17 -0
- .github/workflows/dependa-auto-merge.yml +23 -0
- .gitignore +2 -0
- Dockerfile +19 -0
- Justfile +19 -0
- README.md +31 -0
- docker-compose.yml +11 -0
- requirements.txt +12 -0
.github/dependabot.yml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: 2
|
2 |
+
updates:
|
3 |
+
- package-ecosystem: "pip"
|
4 |
+
directory: "/"
|
5 |
+
schedule:
|
6 |
+
interval: "weekly"
|
.github/workflows/container-build.yml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Container Build
|
2 |
+
on:
|
3 |
+
- pull_request
|
4 |
+
- push
|
5 |
+
|
6 |
+
jobs:
|
7 |
+
docker:
|
8 |
+
runs-on: ubuntu-latest
|
9 |
+
steps:
|
10 |
+
- name: Checkout
|
11 |
+
uses: actions/checkout@v4
|
12 |
+
|
13 |
+
- name: Builds Docker Image
|
14 |
+
run: docker compose build notebook
|
15 |
+
|
16 |
+
- name: Stops Containers
|
17 |
+
run: docker compose down
|
.github/workflows/dependa-auto-merge.yml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Dependabot auto-merge
|
2 |
+
on: pull_request
|
3 |
+
|
4 |
+
permissions:
|
5 |
+
contents: write
|
6 |
+
pull-requests: write
|
7 |
+
|
8 |
+
jobs:
|
9 |
+
dependabot:
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
if: ${{ github.actor == 'dependabot[bot]' }}
|
12 |
+
steps:
|
13 |
+
- name: Dependabot metadata
|
14 |
+
id: metadata
|
15 |
+
uses: dependabot/fetch-metadata@v1
|
16 |
+
with:
|
17 |
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
18 |
+
- name: Enable auto-merge for Dependabot PRs
|
19 |
+
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
|
20 |
+
run: gh pr merge --auto --merge "$PR_URL"
|
21 |
+
env:
|
22 |
+
PR_URL: ${{github.event.pull_request.html_url}}
|
23 |
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
.ipynb_checkpoints
|
Dockerfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim-buster
|
2 |
+
|
3 |
+
RUN mkdir /app
|
4 |
+
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
RUN apt-get update \
|
8 |
+
&& apt-get install --yes --no-install-recommends \
|
9 |
+
build-essential
|
10 |
+
|
11 |
+
COPY requirements.txt .
|
12 |
+
|
13 |
+
RUN pip install -r requirements.txt
|
14 |
+
|
15 |
+
COPY . .
|
16 |
+
|
17 |
+
EXPOSE 8888
|
18 |
+
|
19 |
+
ENTRYPOINT ["jupyter", "notebook", "--ip=0.0.0.0", "--no-browser", "--allow-root"]
|
Justfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Prints available recipes
|
2 |
+
default:
|
3 |
+
just --list
|
4 |
+
|
5 |
+
# Starts the Environment using Docker
|
6 |
+
dev:
|
7 |
+
docker compose up notebook
|
8 |
+
|
9 |
+
# Builds Docker Environment
|
10 |
+
build:
|
11 |
+
docker compose build notebook
|
12 |
+
|
13 |
+
# Stops the Docker Environment
|
14 |
+
undev:
|
15 |
+
docker compose down
|
16 |
+
|
17 |
+
# SSH into the Docker Container
|
18 |
+
bash:
|
19 |
+
docker exec -it <CONTAINER ID> bash
|
README.md
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div>
|
2 |
+
<h1 align="center">Docker Machine Learning</h1>
|
3 |
+
<h4 align="center">A template for Machine Learning projects with Docker</h4>
|
4 |
+
</div>
|
5 |
+
|
6 |
+
## Motivation
|
7 |
+
|
8 |
+
Spin up Machine Learning projects with ease, avoiding a virtual environment
|
9 |
+
setup by using Docker, extending compatibility for collaboration by having
|
10 |
+
a operative system agnostic environment.
|
11 |
+
|
12 |
+
## Run Locally
|
13 |
+
|
14 |
+
Build an run containers using `docker compose`
|
15 |
+
|
16 |
+
```bash
|
17 |
+
docker compose up --build notebook
|
18 |
+
```
|
19 |
+
|
20 |
+
> Using `Justfile` this is a matter of running `just build` and from
|
21 |
+
> there on `just dev`
|
22 |
+
|
23 |
+
After working you can release resources using:
|
24 |
+
|
25 |
+
```bash
|
26 |
+
docker compose down
|
27 |
+
```
|
28 |
+
|
29 |
+
> A [Justfile][1] is included!
|
30 |
+
|
31 |
+
[1]: https://just.systems
|
docker-compose.yml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3'
|
2 |
+
|
3 |
+
services:
|
4 |
+
notebook:
|
5 |
+
build:
|
6 |
+
context: .
|
7 |
+
dockerfile: Dockerfile
|
8 |
+
volumes:
|
9 |
+
- .:/app
|
10 |
+
ports:
|
11 |
+
- 8888:8888
|
requirements.txt
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
h5py == 3.10.0
|
2 |
+
jupyter == 1.0.0
|
3 |
+
keras == 3.1.1
|
4 |
+
matplotlib == 3.8.4
|
5 |
+
notebook == 7.1.2
|
6 |
+
numpy == 1.26.4
|
7 |
+
pandas == 2.2.1
|
8 |
+
pillow == 10.3.0
|
9 |
+
scikit-learn == 1.4.0
|
10 |
+
seaborn == 0.13.2
|
11 |
+
spacy == 3.7.4
|
12 |
+
tensorflow == 2.16.1
|