Skip to content

Commit

Permalink
Merge pull request #47 from nbrg-ppcu/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
obalasz authored Feb 15, 2024
2 parents d30fb43 + f243d9a commit 24bcbec
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
45 changes: 45 additions & 0 deletions envs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM nvidia/cuda:12.1.1-base-ubuntu22.04
LABEL maintainer="Balázs Ligeti <obbalasz@gmail.com>"

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
unzip \
lbzip2 \
mc \
libgtextutils-dev \
sudo \
curl \
gpg \
git \
&& rm -rf /var/lib/apt/lists/*

# Create and switch to the 'prokbert' user before installing Miniconda
RUN useradd -m -s /bin/bash prokbert
USER prokbert
WORKDIR /home/prokbert

# Install Miniconda as 'prokbert'
RUN mkdir -p /home/prokbert/bin && \
cd /home/prokbert/bin && \
wget https://repo.anaconda.com/miniconda/Miniconda3-py311_23.10.0-1-Linux-x86_64.sh && \
chmod +x Miniconda3-py311_23.10.0-1-Linux-x86_64.sh && \
./Miniconda3-py311_23.10.0-1-Linux-x86_64.sh -b -p /home/prokbert/miniconda3 && \
/home/prokbert/miniconda3/bin/conda init bash && \
echo "source /home/prokbert/miniconda3/etc/profile.d/conda.sh" >> /home/prokbert/.bashrc

# Set PATH to include the user's conda and potentially other user-specific binaries
ENV PATH /home/prokbert/miniconda3/bin:$PATH


# Use pip to install prokbert and other dependencies
RUN pip install prokbert seaborn umap-learn jupyterlab

# Set up a work directory for prokbert stuff
RUN git clone https://github.com/nbrg-ppcu/prokbert.git
USER prokbert

CMD ["/bin/bash"]
48 changes: 48 additions & 0 deletions envs/prokbert.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Bootstrap: docker
From: nvidia/cuda:12.1.1-base-ubuntu22.04

%labels
MAINTAINER Balázs Ligeti <obbalasz@gmail.com>

%environment
DEBIAN_FRONTEND=noninteractive
PATH=/opt/miniconda3/bin:$PATH

%post
# Install necessary packages
apt-get update && apt-get install -y --no-install-recommends \
wget \
unzip \
lbzip2 \
mc \
libgtextutils-dev \
sudo \
curl \
gpg \
git \
&& rm -rf /var/lib/apt/lists/*

# Check if Miniconda is already installed; if not, install it
if [ ! -d "/opt/miniconda3" ]; then
echo "Installing Miniconda..."
wget https://repo.anaconda.com/miniconda/Miniconda3-py311_23.10.0-1-Linux-x86_64.sh -O /tmp/miniconda.sh
bash /tmp/miniconda.sh -b -p /opt/miniconda3
rm /tmp/miniconda.sh
else
echo "/opt/miniconda3 exists. Skipping Miniconda installation."
fi

echo "source /opt/miniconda3/etc/profile.d/conda.sh" >> $SINGULARITY_ENVIRONMENT

# Install Python packages
/opt/miniconda3/bin/pip install prokbert seaborn umap-learn jupyterlab

# Clone the prokbert repository
git clone https://github.com/nbrg-ppcu/prokbert.git /opt/prokbert

%runscript
# Define what happens when the container is run without specifying a command
exec /opt/miniconda3/bin/python "$@"

%help
This container includes the prokbert environment with Miniconda and additional Python packages.

0 comments on commit 24bcbec

Please sign in to comment.