-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
300 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && \ | ||
apt-get install -y libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx git wget && \ | ||
apt-get install -y build-essential python3-dev python3-venv python3-pip && \ | ||
apt-get install -y graphviz libgraphviz-dev && \ | ||
apt-get install -y openjdk-8-jdk && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 --no-cache-dir install numpy matplotlib pygraphviz && \ | ||
pip3 --no-cache-dir install python-javabridge && \ | ||
pip3 --no-cache-dir install python-weka-wrapper3==0.2.11 | ||
|
||
COPY bash.bashrc /etc/bash.bashrc | ||
|
||
ENV WEKA_HOME=/workspace/wekafiles | ||
WORKDIR /workspace | ||
RUN chmod 777 /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# python-weka-wrapper3 Docker (CPU) | ||
|
||
## Docker | ||
|
||
### Build local image | ||
|
||
* Build the image from Docker file (from within `docker/0.2.11_cpu`) | ||
|
||
```commandline | ||
docker build -t pww3_cpu . | ||
``` | ||
|
||
* Run the container | ||
|
||
```commandline | ||
docker run -v /local/dir:/container/dir -it pww3_cpu | ||
``` | ||
`/local/dir:/container/dir` maps a local disk directory into a directory inside the container | ||
|
||
## Pre-built images | ||
|
||
* Build | ||
|
||
```commandline | ||
docker build -t pww3:0.2.11_cpu . | ||
``` | ||
|
||
* Tag | ||
|
||
```commandline | ||
docker tag \ | ||
pww3:0.2.11_cpu \ | ||
fracpete/pww3:0.2.11_cpu | ||
``` | ||
|
||
* Push | ||
|
||
```commandline | ||
docker push fracpete/pww3:0.2.11_cpu | ||
``` | ||
|
||
### Special directories | ||
|
||
* `/workspace/wekafiles` - the directory that `WEKA_HOME` is pointing to (packages, props files, etc) | ||
|
||
|
||
## Usage | ||
|
||
### Basic | ||
|
||
For using the image interactively, you can run the following command: | ||
|
||
```bash | ||
docker run -u $(id -u):$(id -g) \ | ||
-it fracpete/pww3:0.2.11_cpu | ||
``` | ||
|
||
**NB:** Use `-v localdir:containerdir` to map directories from your host into the container. | ||
|
||
### With local packages | ||
|
||
Instead of having to reinstall your packages each time you start up the container, | ||
you can map your local Weka packages into the container as follows: | ||
|
||
```bash | ||
docker run -u $(id -u):$(id -g) \ | ||
-v $HOME/wekafiles/:/workspace/wekafiles \ | ||
-it fracpete/pww3:0.2.11_cpu | ||
``` | ||
|
||
**NB:** That way, you can separate various package installations on your host system | ||
in different directories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. | ||
# Copyright 2020 University of Waikato, Hamilton, NZ. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# ============================================================================== | ||
|
||
export PS1="\[\e[31m\]docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > " | ||
export TERM=xterm-256color | ||
alias grep="grep --color=auto" | ||
alias ls="ls --color=auto" | ||
|
||
echo -e "\e[1;31m" | ||
cat<<DBG | ||
_____ | ||
_ ____ ____ _|___ / | ||
| '_ \\ \\ /\\ / /\\ \\ /\\ / / |_ \\ | ||
| |_) \\ V V / \\ V V / ___) | | ||
| .__/ \\_/\\_/ \\_/\\_/ |____/ | ||
|_| | ||
|
||
0.2.11, OpenJDK 8, Python 3.8 | ||
|
||
DBG | ||
echo -e "\e[0;33m" | ||
|
||
if [[ $EUID -eq 0 ]]; then | ||
cat <<WARN | ||
WARNING: You are running this container as root, which can cause new files in | ||
mounted volumes to be created as the root user on your host machine. | ||
|
||
To avoid this, run the container by specifying your user's userid: | ||
|
||
$ docker run -u \$(id -u):\$(id -g) args... | ||
WARN | ||
else | ||
cat <<EXPL | ||
You are running this container as user with ID $(id -u) and group $(id -g), | ||
which should map to the ID and group for your user on the Docker host. Great! | ||
EXPL | ||
fi | ||
|
||
# Turn off colors | ||
echo -e "\e[m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM nvidia/cuda:10.2-devel-ubuntu18.04 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && \ | ||
apt-get install -y libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx git wget && \ | ||
apt-get install -y build-essential python3.8-dev python3.8-venv python3.8-distutils && \ | ||
apt-get install -y graphviz libgraphviz-dev && \ | ||
apt-get install -y openjdk-8-jdk && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py && \ | ||
python3.8 /tmp/get-pip.py | ||
RUN python3.8 -m pip --no-cache-dir install numpy matplotlib pygraphviz && \ | ||
python3.8 -m pip --no-cache-dir install python-javabridge && \ | ||
python3.8 -m pip --no-cache-dir install python-weka-wrapper3==0.2.11 | ||
|
||
COPY bash.bashrc /etc/bash.bashrc | ||
|
||
ENV WEKA_HOME=/workspace/wekafiles | ||
WORKDIR /workspace | ||
RUN chmod 777 /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# python-weka-wrapper3 Docker (CUDA 10.2) | ||
|
||
## Docker | ||
|
||
### Build local image | ||
|
||
* Build the image from Docker file (from within `docker/0.2.11_cuda10.2`) | ||
|
||
```commandline | ||
docker build -t pww3_cuda10.2 . | ||
``` | ||
|
||
* Run the container | ||
|
||
```commandline | ||
docker run --gpus=all -v /local/dir:/container/dir -it pww3_cuda10.2 | ||
``` | ||
`/local/dir:/container/dir` maps a local disk directory into a directory inside the container | ||
|
||
## Pre-built images | ||
|
||
* Build | ||
|
||
```commandline | ||
docker build -t pww3:0.2.11_cuda10.2 . | ||
``` | ||
|
||
* Tag | ||
|
||
```commandline | ||
docker tag \ | ||
pww3:0.2.11_cuda10.2 \ | ||
fracpete/pww3:0.2.11_cuda10.2 | ||
``` | ||
|
||
* Push | ||
|
||
```commandline | ||
docker push fracpete/pww3:0.2.11_cuda10.2 | ||
``` | ||
|
||
### Special directories | ||
|
||
* `/workspace/wekafiles` - the directory that `WEKA_HOME` is pointing to (packages, props files, etc) | ||
|
||
|
||
## Usage | ||
|
||
### Basic | ||
|
||
For using the image interactively, you can run the following command: | ||
|
||
```bash | ||
docker run --gpus=all -u $(id -u):$(id -g) \ | ||
-it fracpete/pww3:0.2.11_cuda10.2 | ||
``` | ||
|
||
**NB:** Use `-v localdir:containerdir` to map directories from your host into the container. | ||
|
||
### With local packages | ||
|
||
Instead of having to reinstall your packages each time you start up the container, | ||
you can map your local Weka packages into the container as follows: | ||
|
||
```bash | ||
docker run --gpus=all -u $(id -u):$(id -g) \ | ||
-v $HOME/wekafiles/:/workspace/wekafiles \ | ||
-it fracpete/pww3:0.2.11_cuda10.2 | ||
``` | ||
|
||
**NB:** That way, you can separate various package installations on your host system | ||
in different directories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. | ||
# Copyright 2020 University of Waikato, Hamilton, NZ. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# ============================================================================== | ||
|
||
export PS1="\[\e[31m\]docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > " | ||
export TERM=xterm-256color | ||
alias grep="grep --color=auto" | ||
alias ls="ls --color=auto" | ||
|
||
echo -e "\e[1;31m" | ||
cat<<DBG | ||
_____ | ||
_ ____ ____ _|___ / | ||
| '_ \\ \\ /\\ / /\\ \\ /\\ / / |_ \\ | ||
| |_) \\ V V / \\ V V / ___) | | ||
| .__/ \\_/\\_/ \\_/\\_/ |____/ | ||
|_| | ||
|
||
0.2.11, OpenJDK 8, Python 3.8, CUDA 10.2 | ||
|
||
DBG | ||
echo -e "\e[0;33m" | ||
|
||
if [[ $EUID -eq 0 ]]; then | ||
cat <<WARN | ||
WARNING: You are running this container as root, which can cause new files in | ||
mounted volumes to be created as the root user on your host machine. | ||
|
||
To avoid this, run the container by specifying your user's userid: | ||
|
||
$ docker run -u \$(id -u):\$(id -g) args... | ||
WARN | ||
else | ||
cat <<EXPL | ||
You are running this container as user with ID $(id -u) and group $(id -g), | ||
which should map to the ID and group for your user on the Docker host. Great! | ||
EXPL | ||
fi | ||
|
||
# Turn off colors | ||
echo -e "\e[m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ def _read(f): | |
"weka": ["lib/*.jar"], | ||
}, | ||
include_package_data=True, | ||
version="0.2.10", | ||
version="0.2.11", | ||
author='Peter "fracpete" Reutemann', | ||
author_email='[email protected]', | ||
install_requires=[ | ||
|