diff --git a/.gitignore b/.gitignore index 47efa46f..70287e6c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ bin/ lib64 pyvenv.cfg +share/ # Distribution / packaging diff --git a/docker/cpu.Dockerfile b/docker/cpu.Dockerfile index 5c3c6c3a..4e284dd0 100644 --- a/docker/cpu.Dockerfile +++ b/docker/cpu.Dockerfile @@ -27,18 +27,6 @@ RUN npm -v WORKDIR /usr/src/app/kaggle_environments -# Conda boost interferes with gfootball -# RUN rm -r /opt/conda/lib/cmake/Boost-1.* -# RUN apt-get update -# RUN apt-get -y install libsdl2-gfx-dev libsdl2-ttf-dev libsdl2-image-dev -# RUN cd /tmp && \ -# git clone --single-branch --branch v2.8 https://github.com/google-research/football.git && \ -# cd football && \ -# sed -i 's/copy2/move/g' gfootball/env/observation_processor.py && \ -# sed -i 's/os\.remove/# os.remove/g' gfootball/env/observation_processor.py && \ -# pip3 install . && \ -# cd /tmp && rm -rf football - ADD ./setup.py ./setup.py ADD ./README.md ./README.md ADD ./MANIFEST.in ./MANIFEST.in diff --git a/docker/gpu.Dockerfile b/docker/gpu.Dockerfile index c0e3ace0..7152f22b 100644 --- a/docker/gpu.Dockerfile +++ b/docker/gpu.Dockerfile @@ -2,23 +2,30 @@ FROM gcr.io/kaggle-gpu-images/python:latest -WORKDIR /usr/src/app/kaggle_environments +# NODE + +# install node and npm from nodesource https://github.com/nodesource/distributions +# use a local mirror of the setup script to avoid `curl | bash` +ADD docker/nodesource_setup_14.x.sh node_setup.sh +RUN sh node_setup.sh +RUN apt-get install -y nodejs + +# link the newly installed versions to /opt/node so we can prioritize these versions over the versions /opt/conda has. +RUN mkdir /opt/node && \ + ln -s /usr/bin/node /opt/node/ && \ + ln -s /usr/bin/npm /opt/node/ + +# add node and npm to path so the commands are available +ENV PATH /opt/node:$PATH +ENV NODE_PATH /usr/lib/node_modules -# Conda boost interferes with gfootball -RUN rm -r /opt/conda/lib/cmake/Boost-1.* -RUN apt-get update -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get -y install libsdl2-gfx-dev libsdl2-ttf-dev libsdl2-image-dev xorg -RUN cd /tmp && \ - git clone --single-branch --branch v2.8 https://github.com/google-research/football.git && \ - cd football && \ - sed -i 's/copy2/move/g' gfootball/env/observation_processor.py && \ - sed -i 's/os\.remove/# os.remove/g' gfootball/env/observation_processor.py && \ - sed -i 's/except:/except Exception as e:/g' gfootball/env/observation_processor.py && \ - sed -i 's/logging\.error(traceback\.format_exc())/raise e/g' gfootball/env/observation_processor.py && \ - sed -i 's/logging\.info/print/g' gfootball/env/observation_processor.py && \ - pip3 install . && \ - cd /tmp && rm -rf football +# confirm installation +RUN node -v +RUN npm -v + +# END NODE + +WORKDIR /usr/src/app/kaggle_environments RUN pip install Flask