Skip to content

Commit

Permalink
GPU Image fixes (#251)
Browse files Browse the repository at this point in the history
* add to gitignore

* update gpu image
  • Loading branch information
bovard authored Nov 29, 2023
1 parent 3a32c82 commit 8ce3c57
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
bin/
lib64
pyvenv.cfg
share/


# Distribution / packaging
Expand Down
12 changes: 0 additions & 12 deletions docker/cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 23 additions & 16 deletions docker/gpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8ce3c57

Please sign in to comment.