Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #47

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.