Skip to content

Commit 73135ac

Browse files
committed
added docker image for 0.3.0; rearranged list of images
1 parent 3b75871 commit 73135ac

File tree

4 files changed

+163
-44
lines changed

4 files changed

+163
-44
lines changed

docker/0.3.0_cpu/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ubuntu:22.04
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
RUN apt-get update && \
5+
apt-get install -y libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx git wget && \
6+
apt-get install -y build-essential python3-dev python3-venv python3-pip && \
7+
apt-get install -y graphviz libgraphviz-dev && \
8+
apt-get install -y openjdk-11-jdk && \
9+
apt-get clean && \
10+
rm -rf /var/lib/apt/lists/*
11+
12+
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
13+
RUN pip3 --no-cache-dir install setuptools wheel && \
14+
pip3 --no-cache-dir install python-weka-wrapper3==0.3.0
15+
16+
COPY bash.bashrc /etc/bash.bashrc
17+
18+
ENV WEKA_HOME=/workspace/wekafiles
19+
WORKDIR /workspace
20+
RUN chmod 777 /workspace

docker/0.3.0_cpu/README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# python-weka-wrapper3 Docker (CPU)
2+
3+
## Docker
4+
5+
### Build local image
6+
7+
* Build the image from Docker file (from within `docker/0.3.0_cpu`)
8+
9+
```bash
10+
docker build -t pww3_cpu .
11+
```
12+
13+
* Run the container
14+
15+
```bash
16+
docker run -v /local/dir:/container/dir -it pww3_cpu
17+
```
18+
`/local/dir:/container/dir` maps a local disk directory into a directory inside the container
19+
20+
## Pre-built images
21+
22+
* Build
23+
24+
```bash
25+
docker build -t pww3:0.3.0_cpu .
26+
```
27+
28+
* Tag
29+
30+
```bash
31+
docker tag \
32+
pww3:0.3.0_cpu \
33+
fracpete/pww3:0.3.0_cpu
34+
```
35+
36+
* Push
37+
38+
```bash
39+
docker push fracpete/pww3:0.3.0_cpu
40+
```
41+
42+
### Special directories
43+
44+
* `/workspace/wekafiles` - the directory that `WEKA_HOME` is pointing to (packages, props files, etc)
45+
46+
47+
## Usage
48+
49+
### Basic
50+
51+
For using the image interactively, you can run the following command:
52+
53+
```bash
54+
docker run -u $(id -u):$(id -g) \
55+
-it fracpete/pww3:0.3.0_cpu
56+
```
57+
58+
**NB:** Use `-v localdir:containerdir` to map directories from your host into the container.
59+
60+
### With local packages
61+
62+
Instead of having to reinstall your packages each time you start up the container,
63+
you can map your local Weka packages into the container as follows:
64+
65+
```bash
66+
docker run -u $(id -u):$(id -g) \
67+
-v $HOME/wekafiles/:/workspace/wekafiles \
68+
-it fracpete/pww3:0.3.0_cpu
69+
```
70+
71+
**NB:** That way, you can separate various package installations on your host system
72+
in different directories.

docker/0.3.0_cpu/bash.bashrc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2+
# Copyright 2020 University of Waikato, Hamilton, NZ. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# ==============================================================================
17+
18+
export PS1="\[\e[31m\]docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
19+
export TERM=xterm-256color
20+
alias grep="grep --color=auto"
21+
alias ls="ls --color=auto"
22+
23+
echo -e "\e[1;31m"
24+
cat<<DBG
25+
_____
26+
_ ____ ____ _|___ /
27+
| '_ \\ \\ /\\ / /\\ \\ /\\ / / |_ \\
28+
| |_) \\ V V / \\ V V / ___) |
29+
| .__/ \\_/\\_/ \\_/\\_/ |____/
30+
|_|
31+
32+
0.3.0, OpenJDK 11, Python 3.10
33+
34+
DBG
35+
echo -e "\e[0;33m"
36+
37+
if [[ $EUID -eq 0 ]]; then
38+
cat <<WARN
39+
WARNING: You are running this container as root, which can cause new files in
40+
mounted volumes to be created as the root user on your host machine.
41+
42+
To avoid this, run the container by specifying your user's userid:
43+
44+
$ docker run -u \$(id -u):\$(id -g) args...
45+
WARN
46+
else
47+
cat <<EXPL
48+
You are running this container as user with ID $(id -u) and group $(id -g),
49+
which should map to the ID and group for your user on the Docker host. Great!
50+
EXPL
51+
fi
52+
53+
# Turn off colors
54+
echo -e "\e[m"

docker/README.md

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,23 @@
11
# Docker
22

33
In order to make installation reproducible, the following Docker images
4-
(which can be used interactively) are maintained:
5-
6-
* 0.2.16
7-
8-
* [CPU only](0.2.16_cpu)
9-
10-
* 0.2.15
11-
12-
* [CPU only](0.2.15_cpu)
13-
14-
* 0.2.14
15-
16-
* [CPU only](0.2.14_cpu)
17-
* [CUDA 10.2](0.2.14_cuda10.2)
18-
19-
* 0.2.13
20-
21-
* [CPU only](0.2.13_cpu)
22-
* [CUDA 10.2](0.2.13_cuda10.2)
23-
24-
* 0.2.12
25-
26-
* [CPU only](0.2.12_cpu)
27-
* [CUDA 10.2](0.2.12_cuda10.2)
28-
29-
* 0.2.11
30-
31-
* [CPU only](0.2.11_cpu)
32-
* [CUDA 10.2](0.2.11_cuda10.2)
33-
34-
* 0.2.10
35-
36-
* [CPU only](0.2.10_cpu)
37-
* [CUDA 10.2](0.2.10_cuda10.2)
38-
39-
* 0.2.9
40-
41-
* [CPU only](0.2.9_cpu)
42-
* [CUDA 10.2](0.2.9_cuda10.2)
43-
44-
* 0.2.8
45-
46-
* [CPU only](0.2.8_cpu)
47-
* [CUDA 10.2](0.2.8_cuda10.2)
4+
(which can be used interactively) are maintained.
5+
6+
jpype-based:
7+
8+
* 0.3.0 ([CPU only](0.3.0_cpu))
9+
10+
javabridge-based:
11+
12+
* 0.2.16 ([CPU only](0.2.16_cpu))
13+
* 0.2.15 ([CPU only](0.2.15_cpu))
14+
* 0.2.14 ([CPU only](0.2.14_cpu), [CUDA 10.2](0.2.14_cuda10.2))
15+
* 0.2.13 ([CPU only](0.2.13_cpu), [CUDA 10.2](0.2.13_cuda10.2))
16+
* 0.2.12 ([CPU only](0.2.12_cpu), [CUDA 10.2](0.2.12_cuda10.2))
17+
* 0.2.11 ([CPU only](0.2.11_cpu), [CUDA 10.2](0.2.11_cuda10.2))
18+
* 0.2.10 ([CPU only](0.2.10_cpu), [CUDA 10.2](0.2.10_cuda10.2))
19+
* 0.2.9 ([CPU only](0.2.9_cpu), [CUDA 10.2](0.2.9_cuda10.2))
20+
* 0.2.8 ([CPU only](0.2.8_cpu), [CUDA 10.2](0.2.8_cuda10.2))
4821

4922
The images themselves are available through Docker hub:
5023

0 commit comments

Comments
 (0)