46 lines
1.4 KiB
Docker
46 lines
1.4 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM nvidia/cuda:11.7.1-devel-ubuntu22.04
|
|
|
|
ARG DEBIAN_FRONTEND="noninteractive"
|
|
ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND}
|
|
|
|
COPY src/requirements.txt /root/
|
|
ENV MAMBA_ROOT_PREFIX=~/micromamba
|
|
WORKDIR /root
|
|
SHELL ["/bin/bash", "-c"]
|
|
|
|
RUN <<EOT
|
|
#!/bin/bash
|
|
# 更新软件源
|
|
apt-get update
|
|
apt-get install -y wget curl git jq vim bash libaio-dev build-essential openssh-server
|
|
# Configure SSH for password and public key authentication
|
|
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
|
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
|
echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config
|
|
echo "Port 22" >> /etc/ssh/sshd_config
|
|
mkdir /var/run/sshd
|
|
echo 'root:C2024D513C' | chpasswd
|
|
# Install Micromamba
|
|
echo 1 | bash <(curl -s https://cdn.jsdelivr.net/gh/hotwa/MicroMamba_Installer@main/install.sh)
|
|
micromamba shell init -s bash -p ~/micromamba
|
|
micromamba create -n finetune -c conda-forge python=3.10 cudatoolkit=11.7 -y
|
|
# Configure Python and install packages
|
|
mkdir -p ~/.pip
|
|
echo "
|
|
[global]
|
|
index-url = https://mirrors.aliyun.com/pypi/simple/
|
|
|
|
[install]
|
|
trusted-host=mirrors.aliyun.com
|
|
" >> ~/.pip/pip.conf
|
|
micromamba run -n finetune pip install protobuf ipython torch==1.13.1 transformers deepspeed tqdm requests peft matplotlib sentencepiece torchvision torchaudio ninja triton
|
|
echo "micromamba activate finetune" >> ~/.bashrc
|
|
EOT
|
|
|
|
# Expose SSH port
|
|
EXPOSE 3222
|
|
|
|
# Keep the container running
|
|
CMD ["/usr/sbin/sshd", "-D"]
|