Skip to content

Commit

Permalink
Merge pull request #497 from EpistasisLab/docker_updates
Browse files Browse the repository at this point in the history
Docker updates
  • Loading branch information
jay-m-dev authored Dec 22, 2022
2 parents 15c85f2 + 5ba8b4a commit 4894484
Show file tree
Hide file tree
Showing 20 changed files with 99 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/sh
# Docker production build environment
# ARCH refers to the architecture of the development machine.
# If you are on arm64, set this to arm64, otherwise use x64
TAG=0.20.a0
ARCH=x64
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ MANIFEST

.xz
.exe
run*Test.sh
2 changes: 2 additions & 0 deletions docker-compose-int-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:
build:
context: .
dockerfile: docker/lab/Dockerfile
args:
- ARCH=${ARCH}
tty: true
stdin_open: true
volumes:
Expand Down
57 changes: 57 additions & 0 deletions docker-compose-multiarch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: '3'

services:
lab:
build:
context: .
dockerfile: docker/lab/Dockerfile
x-bake:
platforms:
- linux/arm64
tty: true
stdin_open: true
volumes:
- "./:/appsrc"
- "/appsrc/lab/webapp/node_modules"
- "/appsrc/lab/node_modules"
ports:
- "5080:5080"
env_file:
- ./config/common.env
- ./config/ai.env
depends_on:
- dbmongo

machine:
build:
context: .
dockerfile: docker/machine/Dockerfile
x-bake:
platforms:
- linux/arm64
tty: true
stdin_open: true
volumes:
- "./:/appsrc"
- "/appsrc/machine/node_modules"
ports:
- "5081:5081"
env_file: ./config/common.env
environment:
- MACHINE_PORT=5081
depends_on:
- lab
- dbmongo

dbmongo:
build:
context: .
dockerfile: docker/dbmongo/Dockerfile
x-bake:
platforms:
- linux/arm64
tty: true
stdin_open: true
ports:
- "27017:27017"
env_file: ./config/common.env
2 changes: 2 additions & 0 deletions docker-compose-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
build:
context: .
dockerfile: tests/unit/Dockerfile
args:
- ARCH=${ARCH}
working_dir: /appsrc
command: bash -c "dos2unix tests/unit/unit_test_runner.sh && export PENNAI_UNIT_TESTS_JS_ONLY=$PENNAI_UNIT_TESTS_JS_ONLY && export PENNAI_UNIT_TESTS_PY_ONLY=$PENNAI_UNIT_TESTS_PY_ONLY && sh tests/unit/unit_test_runner.sh"
tty: true
Expand Down
11 changes: 2 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ services:
build:
context: .
dockerfile: docker/lab/Dockerfile
x-bake:
platforms:
- linux/arm64
args:
- ARCH=${ARCH}
tty: true
stdin_open: true
volumes:
Expand All @@ -26,9 +25,6 @@ services:
build:
context: .
dockerfile: docker/machine/Dockerfile
x-bake:
platforms:
- linux/arm64
tty: true
stdin_open: true
volumes:
Expand All @@ -47,9 +43,6 @@ services:
build:
context: .
dockerfile: docker/dbmongo/Dockerfile
x-bake:
platforms:
- linux/arm64
tty: true
stdin_open: true
ports:
Expand Down
15 changes: 8 additions & 7 deletions docker/lab/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# FROM python:3.7.11-stretch
FROM python:3.7.16-slim-buster

#nodejs
# RUN wget --quiet https://nodejs.org/dist/v12.22.9/node-v12.22.9-linux-x64.tar.xz -O ~/node.tar.xz && \
# tar -xvf ~/node.tar.xz -C /opt/ && \
# rm ~/node.tar.xz
# ENV PATH /opt/node-v12.22.9-linux-x64/bin:$PATH
ARG ARCH
ARG wheel_directory=docker/pywheels

RUN apt-get update --fix-missing && \
apt-get install -y wget xz-utils git \
Expand Down Expand Up @@ -48,8 +44,13 @@ ARG docker_filepath=docker/lab/files
# rm -rf /var/lib/apt/lists/*

# setup python environment
RUN mkdir /root/wheel
COPY ${wheel_directory}/*.whl /root/wheel/
COPY ${docker_filepath}/requirements.txt /root/
RUN pip install --no-cache-dir -r /root/requirements.txt
COPY ${docker_filepath}/requirements-surprise-${ARCH}.txt /root/
RUN pip install --no-cache-dir --find-links=/root/wheel -r /root/requirements.txt
RUN pip install --no-cache-dir --find-links=/root/wheel -r /root/requirements-surprise-${ARCH}.txt
RUN rm -rf /root/wheel

## Webserver

Expand Down
1 change: 1 addition & 0 deletions docker/lab/files/requirements-surprise-arm64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scikit-surprise==1.0.8.2
1 change: 1 addition & 0 deletions docker/lab/files/requirements-surprise-x64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e git+https://github.com/lacava/surprise.git@1.1.1.1#egg=scikit-surprise
3 changes: 1 addition & 2 deletions docker/lab/files/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ cython==0.29.32
xgboost==1.6.2
simplejson==3.17.2
requests==2.25.1
joblib==1.2.0
-e git+https://github.com/lacava/surprise.git@1.1.1.1#egg=scikit-surprise
joblib==1.2.0
16 changes: 5 additions & 11 deletions docker/machine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# FROM python:3.7.11-stretch
FROM python:3.7.16-slim-buster

#nodejs
# RUN wget --quiet https://nodejs.org/dist/v12.22.9/node-v12.22.9-linux-x64.tar.xz -O ~/node.tar.xz && \
# tar -xvf ~/node.tar.xz -C /opt/ && \
# rm ~/node.tar.xz
# ENV PATH /opt/node-v12.22.9-linux-x64/bin:$PATH

ARG wheel_directory=docker/pywheels
ARG docker_filepath=docker/machine/files

RUN apt-get update --fix-missing && apt-get install -y \
Expand Down Expand Up @@ -36,11 +30,11 @@ RUN apt-get update --fix-missing && apt-get install -y \
apt-get clean

# setup python environment
RUN mkdir /root/wheel
COPY ${wheel_directory}/*.whl /root/wheel/
COPY ${docker_filepath}/requirements.txt /root/
RUN pip install --no-cache-dir -r /root/requirements.txt
COPY ${docker_filepath}/requirements_shap.txt /root/
RUN pip install --no-cache-dir -r /root/requirements_shap.txt

RUN pip install --no-cache-dir --find-links=/root/wheel -r /root/requirements.txt
RUN rm -rf /root/wheel

# setup node environment
RUN npm install -g pm2 --silent --progress=false
Expand Down
3 changes: 2 additions & 1 deletion docker/machine/files/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mlxtend==0.16.0
pydot==1.4.2
requests==2.25.1
xgboost==1.6.2
joblib==1.2.0
joblib==1.2.0
shap==0.37.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 1 addition & 6 deletions docs/guides/userGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ We have built a custom Raspberry Pi OS Image containing Aliro (configured to be
7. Insert the MicroSD Card into your Raspberry Pi 400 and start it up.
8. When the Operating System has finished starting up, double-click the Aliro-Ed Icon on the Destop or launch the Web Browser.

Now that Aliro is up and running, you are ready to run experiments, Aliro Ed comes preloaded with the following datasets:
- [BNGBreastTumor.tsv](https://github.com/EpistasisLab/pmlb/tree/master/datasets/1201_BNG_breastTumor)
- [ESL.tsv](https://github.com/EpistasisLab/pmlb/tree/master/datasets/1027_ESL)
- [Iris.tsv](https://github.com/EpistasisLab/pmlb/tree/master/datasets/iris)
- [Titanic.tsv](https://github.com/EpistasisLab/pmlb/tree/master/datasets/titanic)
- Other datasets can be downloaded from the [Penn Machine Learning Benchmarks](https://github.com/EpistasisLab/pmlb)
Now that Aliro is up and running, you are ready to run experiments, Aliro Ed comes preloaded with some data sets for you to experiment with. Other datasets can be downloaded from the [Penn Machine Learning Benchmarks](https://github.com/EpistasisLab/pmlb)

You may also load your own datasets, please see the following sections below for further instructions:
- [Adding Data Sets](#adding-datasets)
Expand Down
2 changes: 1 addition & 1 deletion runIntTest.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash

docker system prune -a -f --volumes
docker-compose -f docker-compose-int-test.yml up --abort-on-container-exit -V
docker compose -f docker-compose-int-test.yml up --abort-on-container-exit -V
2 changes: 1 addition & 1 deletion runUnitTest.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash

docker system prune -a -f --volumes
docker-compose -f docker-compose-unit-test.yml up --abort-on-container-exit -V
docker compose -f docker-compose-unit-test.yml up --abort-on-container-exit -V
15 changes: 11 additions & 4 deletions tests/unit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM python:3.7.16-buster

ARG ARCH
ARG wheel_directory=docker/pywheels

#nodejs
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
Expand Down Expand Up @@ -36,13 +39,17 @@ COPY /tests/unit/requirements.txt /root/test_requirements.txt
RUN pip install --no-cache-dir -r /root/test_requirements.txt

## machine and lab container
COPY ${wheel_directory}/*.whl /root/wheel/
COPY /docker/lab/files/requirements.txt /root/lab_requirements.txt
RUN pip install --no-cache-dir -r /root/lab_requirements.txt
RUN pip install --no-cache-dir --find-links=/root/wheel -r /root/lab_requirements.txt
COPY /docker/lab/files/requirements-surprise-${ARCH}.txt /root/surprise_requirements.txt
RUN pip install --no-cache-dir --find-links=/root/wheel -r /root/surprise_requirements.txt

COPY /docker/machine/files/requirements.txt /root/mach_requirements.txt
RUN pip install --no-cache-dir -r /root/mach_requirements.txt
COPY /docker/machine/files/requirements_shap.txt /root/mach_requirements_shap.txt
RUN pip install --no-cache-dir -r /root/mach_requirements_shap.txt
RUN pip install --no-cache-dir --find-links=/root/wheel -r /root/mach_requirements.txt
# COPY /docker/machine/files/requirements_shap.txt /root/mach_requirements_shap.txt
# RUN pip install --no-cache-dir -r /root/mach_requirements_shap.txt
RUN rm -rf /root/wheel

# install lab/node_modules to an anon volume
WORKDIR /appsrc/lab
Expand Down

0 comments on commit 4894484

Please sign in to comment.