Skip to content

Commit 0d78ab6

Browse files
authored
Merge pull request #11 from ruivieira/binder
Add Docker and binder support
2 parents be6020b + 121b257 commit 0d78ab6

File tree

6 files changed

+68
-1
lines changed

6 files changed

+68
-1
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.log
2+
__pycache__
3+
.pytest_cache
4+
.pynb_checkpoints
5+
.Rproj.user
6+
.vscode
7+
.idea
8+
.mypy_cache
9+
build
10+
dist
11+
trustyai.egg-info
12+
*.pyc

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM openjdk:11.0.11-jdk
2+
3+
RUN apt-get update
4+
RUN apt-get install -y python3-pip cmake maven
5+
6+
COPY . .
7+
RUN pip3 install --no-cache-dir -r requirements.txt && \
8+
pip3 install --no-cache-dir -r requirements-dev.txt
9+
10+
# Install the python-trustyai bindings
11+
RUN python3 setup.py install
12+
13+
USER root
14+
15+
ENV NB_USER jovyan
16+
ENV NB_UID 1000
17+
ENV HOME /home/$NB_USER
18+
19+
RUN adduser --disabled-password \
20+
--gecos "Default user" \
21+
--uid $NB_UID \
22+
$NB_USER
23+
24+
COPY . $HOME
25+
RUN chown -R $NB_UID $HOME
26+
27+
USER $NB_USER
28+
29+
WORKDIR $HOME
30+
31+
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get \
32+
-DremoteRepositories=https://repository.sonatype.org/content/repositories/central \
33+
-Dartifact=org.kie.kogito:explainability-core:1.8.0.Final \
34+
-Dmaven.repo.local=dep -q && \
35+
wget -O ./dep/org/kie/kogito/explainability-core/1.8.0.Final/explainability-core-1.8.0.Final-tests.jar \
36+
https://repo1.maven.org/maven2/org/kie/kogito/explainability-core/1.8.0.Final/explainability-core-1.8.0.Final-tests.jar
37+
38+
# Launch the notebook server
39+
WORKDIR $HOME/examples
40+
CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Python bindings to [TrustyAI](https://kogito.kie.org/trustyai/)'s explainability
55

66
## Setup
77

8+
### Local
9+
810
The minimum dependencies can be installed with
911

1012
```shell
@@ -17,6 +19,18 @@ If running the examples or developing, also install the development dependencies
1719
pip install -r requirements-dev.txt
1820
```
1921

22+
### Docker
23+
24+
Alternatively create a container image and run it using
25+
26+
```shell
27+
$ docker build -f Dockerfile -t ruivieira/python-trustyai:latest .
28+
$ docker run --rm -it -p 8888:8888 ruivieira/python-trustyai:latest
29+
```
30+
31+
The Jupyter server will be available at `localhost:8888`.
32+
33+
2034
## Getting started
2135

2236
To initialise, import the module and specify the location of the `explainability-core` JAR.
File renamed without changes.
2.62 MB
Binary file not shown.

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
black
1+
black==21.6b0
22
joblib
3+
jupyter
34
pandas
45
scikit-learn
56
pylint

0 commit comments

Comments
 (0)