Skip to content

Commit

Permalink
Fix torch patch and add tutorials docker
Browse files Browse the repository at this point in the history
tutorials dockerfile added to the composition.
Currently uses develop, but a prod dockerfile
will eventually be added as well
  • Loading branch information
Spartee committed Jan 27, 2022
1 parent 2fa1101 commit f79392e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ ENV TZ=US/Seattle
# - add tutorials from other sections
# - add permissions to the craylabs user

RUN useradd --create-home --shell /bin/bash craylabs
RUN useradd --system --create-home --shell /bin/bash -g root -G sudo craylabs

RUN apt-get update \
&& apt-get install --no-install-recommends -y build-essential \
git gcc make git-lfs wget \
git gcc make git-lfs wget libopenmpi-dev openmpi-bin \
python3-pip python3 python3-dev cmake \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/python3 /usr/bin/python

WORKDIR /home/craylabs
USER craylabs

RUN git clone https://github.com/CrayLabs/SmartRedis.git --branch develop --depth=1 smartredis \
&& chown -R craylabs:root smartredis \
&& cd smartredis \
&& python -m pip install .


COPY . /home/craylabs/SmartSim
RUN cd SmartSim && NO_CHECKS=1 SMARTSIM_SUFFIX=dev python -m pip install .
RUN chown craylabs:root -R SmartSim
USER craylabs

RUN cd SmartSim && \
SMARTSIM_SUFFIX=dev python -m pip install .


# TODO set SmartRedis version when thats put in
#RUN git clone https://github.com/CrayLabs/SmartSim.git --branch develop --depth=1 \
Expand Down
4 changes: 3 additions & 1 deletion smartsim/_core/_install/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ def _move_torch_libs(self):

# retrieve torch shared libraries and copy to the
# smartsim/_core/lib/backends/redisai_torch/lib dir
pip_torch_path = Path(site.getsitepackages()[0]) / "torch"
# self.torch_dir should be /path/to/torch/share/cmake/Torch
# so we take the great grandparent here
pip_torch_path = Path(self.torch_dir).parent.parent.parent
pip_torch_lib_path = pip_torch_path / "lib"

self.copy_dir(pip_torch_lib_path, ss_rai_torch_lib_path, set_exe=True)
Expand Down

0 comments on commit f79392e

Please sign in to comment.