generated from cyverse-vice/template-vice-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49829e1
commit e626c36
Showing
2 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
FROM lscr.io/linuxserver/code-server:4.96.4 | ||
|
||
USER root | ||
|
||
# Install a few dependencies for goCommands, text editing, and monitoring instances | ||
RUN apt update && \ | ||
apt install -y lsb-release apt-transport-https curl libfreetype6-dev pkg-config libx11-dev gcc gettext gnupg less software-properties-common apt-utils glances htop nano wget | ||
|
||
# Install GoCommands https://learning.cyverse.org/ds/gocommands/ | ||
RUN cd /usr/local/bin/ && \ | ||
GOCMD_VER=$(curl -L -s https://raw.githubusercontent.com/cyverse/gocommands/main/VERSION.txt); \ | ||
curl -L -s https://github.com/cyverse/gocommands/releases/download/${GOCMD_VER}/gocmd-${GOCMD_VER}-linux-amd64.tar.gz | tar zxvf - | ||
|
||
# Add sudo | ||
RUN apt update && \ | ||
apt install -y sudo && \ | ||
apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Create user vscode with specific UID and GID | ||
RUN groupadd -g 1000 vscode && \ | ||
useradd -m -u 1000 -g 1000 -s /bin/bash vscode && \ | ||
usermod -aG sudo vscode && \ | ||
echo "vscode ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
|
||
# Install cuda toolkit and nvidia drivers | ||
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb && \ | ||
dpkg -i cuda-keyring_1.1-1_all.deb && \ | ||
apt update && \ | ||
apt install -y cuda-toolkit-12-5 nvidia-driver-535 -y | ||
|
||
# Set ownership for home directory | ||
RUN chown -R vscode:vscode /home/vscode && \ | ||
chown -R vscode:vscode /config | ||
|
||
# Install Miniconda and Mamba | ||
RUN curl -sSLo /tmp/Miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
bash /tmp/Miniconda3.sh -b -p /opt/conda && \ | ||
rm /tmp/Miniconda3.sh && \ | ||
/opt/conda/bin/conda install -y mamba -n base -c conda-forge && \ | ||
/opt/conda/bin/conda clean -afy && \ | ||
chown -R vscode:vscode /opt/conda | ||
|
||
# Install Ollama and dependecies | ||
RUN apt install pciutils -y && \ | ||
curl https://ollama.ai/install.sh | sh | ||
|
||
#RUN ollama serve & sleep 5 && ollama run mxbai-embed-large | ||
|
||
USER vscode | ||
|
||
# install git credential manager | ||
RUN cd /home/vscode && \ | ||
wget https://github.com/git-ecosystem/git-credential-manager/releases/download/v2.5.0/gcm-linux_amd64.2.5.0.deb && \ | ||
sudo dpkg -i gcm-linux_amd64.2.5.0.deb && \ | ||
rm gcm-linux_amd64.2.5.0.deb | ||
|
||
# set the ENV for the credential type | ||
ENV GCM_CREDENTIAL_STORE=cache | ||
|
||
EXPOSE 8443 | ||
|
||
COPY entry.sh /bin | ||
|
||
# Set up environment variables for Conda | ||
ENV PATH="/opt/conda/bin:$PATH" | ||
|
||
WORKDIR /home/vscode | ||
|
||
ENTRYPOINT ["bash", "/bin/entry.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Ensure .irods directory and environment file exist | ||
mkdir -p /home/vscode/.irods | ||
cat <<EOF > /home/vscode/.irods/irods_environment.json | ||
{ | ||
"irods_host": "data.cyverse.org", | ||
"irods_port": 1247, | ||
"irods_user_name": "$IPLANT_USER", | ||
"irods_zone_name": "iplant" | ||
} | ||
EOF | ||
|
||
# Add conda to PATH | ||
# echo "export PATH=$PATH:/opt/conda/bin" >> /home/vscode/.bashrc | ||
|
||
# Copy user configurations if they exist | ||
if [ -f /data-store/iplant/home/$IPLANT_USER/.gitconfig ]; then | ||
cp /data-store/iplant/home/$IPLANT_USER/.gitconfig ~/ | ||
fi | ||
|
||
if [ -d /data-store/iplant/home/$IPLANT_USER/.ssh ]; then | ||
cp -r /data-store/iplant/home/$IPLANT_USER/.ssh ~/ | ||
fi | ||
|
||
# Start code-server | ||
exec /app/code-server/bin/code-server --host 0.0.0.0 --disable-telemetry -- |