Skip to content

Commit

Permalink
Merge pull request #244 from bacpop/remove_blas
Browse files Browse the repository at this point in the history
Remove blas
  • Loading branch information
johnlees committed Nov 17, 2022
2 parents ffa11ba + 1e45844 commit 4ee07a3
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 199 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ set_target_properties("${TARGET_NAME}" PROPERTIES
)

target_link_libraries("${TARGET_NAME}" PRIVATE pybind11::module Eigen3::Eigen
z gomp openblas gfortran m dl)
z gomp gfortran m dl)
#if(OpenMP_CXX_FOUND)
# target_link_libraries("${TARGET_NAME}" PRIVATE OpenMP::OpenMP_CXX)
#endif()
6 changes: 3 additions & 3 deletions buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
steps:
- label: ":whale::python: Build"
command: docker2/build
command: docker/build

- wait

- label: ":hammer: Test image"
command: docker2/test
command: docker/test

- wait

- label: ":shipit: Push images"
command: docker2/push
command: docker/push
3 changes: 0 additions & 3 deletions docker/.dockerignore

This file was deleted.

148 changes: 47 additions & 101 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,101 +1,47 @@
# From https://github.com/kaust-vislab/python-data-science-project
FROM ubuntu:20.04

LABEL maintainer="johnlees <john@johnlees.me>"

SHELL [ "/bin/bash", "--login", "-c" ]

RUN apt-get update --fix-missing && \
apt-get install -y wget bzip2 curl git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install ssh
ENV SSH_PASSWD "root:Docker!"
ENV ROOT_PASSWD "Docker!"
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& apt-get update \
&& apt-get install -y --no-install-recommends sudo \
&& apt-get update \
&& apt-get install -y --no-install-recommends build-essential zlib1g-dev automake autoconf \
&& echo "$SSH_PASSWD" | chpasswd
COPY docker/sshd_config /etc/ssh
# Use root password for sudo access
RUN echo "Defaults rootpw" >> /etc/sudoers

# Create a non-root user
ARG username=poppunk-usr
ARG uid=1000
ARG gid=100
ENV USER $username
ENV UID $uid
ENV GID $gid
ENV HOME /home/$USER

RUN adduser --disabled-password \
--gecos "Non-root user" \
--uid $UID \
--gid $GID \
--home $HOME \
$USER
RUN usermod -aG sudo $USER

COPY environment.yml requirements.txt /tmp/
RUN chown $UID:$GID /tmp/environment.yml /tmp/requirements.txt

COPY docker/entrypoint.sh /usr/local/bin/
RUN chown $UID:$GID /usr/local/bin/entrypoint.sh && \
chmod u+x /usr/local/bin/entrypoint.sh

USER $USER

# install miniconda
ENV MINICONDA_VERSION latest
ENV CONDA_DIR $HOME/miniconda3
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-$MINICONDA_VERSION-Linux-x86_64.sh -O ~/miniconda.sh && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p $CONDA_DIR && \
rm ~/miniconda.sh

# make non-activate conda commands available
ENV PATH=$CONDA_DIR/bin:$PATH

# make conda activate command available from /bin/bash --login shells
RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile

# make conda activate command available from /bin/bash --interative shells
RUN conda init bash

# create a project directory inside user home
ENV PROJECT_DIR $HOME/app
RUN mkdir $PROJECT_DIR
# copy the code in
COPY . $PROJECT_DIR
WORKDIR $PROJECT_DIR

# build the conda environment
ENV ENV_PREFIX $PROJECT_DIR/env
RUN conda update --name base --channel defaults conda && \
conda env create --prefix $ENV_PREFIX --file /tmp/environment.yml --force && \
conda clean --all --yes
# build and install extensions
RUN conda activate $ENV_PREFIX && python setup.py install && conda deactivate

# use an entrypoint script to insure conda environment is properly activated at runtime
USER root
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

# default command will be to launch flask server for deployment
# see https://pythonspeed.com/articles/gunicorn-in-docker/
EXPOSE 8000 2222
CMD [ "gunicorn", \
"-b", "0.0.0.0:8000", \
"--worker-tmp-dir", "/dev/shm", \
"--log-file=-", \
"--timeout", "600", \
"--workers=2", "--threads=2", "--worker-class=gthread", \
"--chdir", "PopPUNK", \
"web:app" ]
FROM python:3.10

RUN apt-get update && \
apt-get install -y --no-install-recommends \
cmake \
gfortran \
libarmadillo-dev \
libeigen3-dev \
libopenblas-dev \
software-properties-common

RUN git clone https://github.com/somme89/rapidNJ.git && \
cd rapidNJ && \
make && \
mv ./bin/rapidnj /usr/bin &&\
cd .. && rm -r rapidNJ

# Special snowflake treatment for graph_tool because the maintainer
# refuses to make the package pip-installable, meaning we can't depend
# on it in a sane way. Least pain seems to be to install via apt, even
# though that might result in slightly incorrect versions (built
# around system python).
#
# The alternative would be to build it from source
# https://git.skewed.de/count0/graph-tool/-/wikis/installation-instructions#manual-compilation
# but it takes over an hour to compile apparently, so that sounds not
# ideal.
RUN add-apt-repository https://downloads.skewed.de/apt && \
apt-key adv --keyserver keyserver.ubuntu.com \
--recv-key 612DEFB798507F25 && \
apt-get update && \
apt-get install -y --no-install-recommends python3-graph-tool && \
ln -s /usr/lib/python3/dist-packages/graph_tool \
/usr/local/lib/python3.10/site-packages

RUN pip install pybind11[global]

COPY . /src
WORKDIR /src
RUN pip install .

RUN pip install cmake plotly ffmpeg

RUN git clone https://github.com/bacpop/mandrake.git && \
cd mandrake && \
python setup.py install && \
cd .. && rm -r mandrake
2 changes: 1 addition & 1 deletion docker2/build → docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HERE=$(dirname $0)

docker build --pull \
--tag $TAG_SHA \
-f docker2/Dockerfile \
-f docker/Dockerfile \
$PACKAGE_ROOT

# We always push the SHA tagged versions, for debugging if the tests
Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions docker/entrypoint.sh

This file was deleted.

File renamed without changes.
15 changes: 0 additions & 15 deletions docker/sshd_config

This file was deleted.

File renamed without changes.
47 changes: 0 additions & 47 deletions docker2/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ dependencies:
- xorg-libxfixes
- pybind11
- eigen
- openblas
- cmake >= 3.18
- libgfortran-ng
- boost-cpp
Expand Down
19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.

0 comments on commit 4ee07a3

Please sign in to comment.