From 085ebcb84fc30266583abb52c210d813f7d97a82 Mon Sep 17 00:00:00 2001 From: mm644706215 Date: Sat, 18 Jan 2025 21:42:09 +0800 Subject: [PATCH] temp save --- Dockerfile.gromacs_amber_stage | 134 ++++++++++++++--------------- Dockerfile.gromacs_amber_staget | 147 +++++++++----------------------- docker-compose_amber_stage.yml | 8 +- docker-compose_amber_staget.yml | 8 +- 4 files changed, 115 insertions(+), 182 deletions(-) diff --git a/Dockerfile.gromacs_amber_stage b/Dockerfile.gromacs_amber_stage index be7a3e2..76c38c4 100644 --- a/Dockerfile.gromacs_amber_stage +++ b/Dockerfile.gromacs_amber_stage @@ -22,26 +22,13 @@ ENV SSH_PORT=2222 WORKDIR /root SHELL ["/bin/bash", "-c"] -# Replace sources.list with Aliyun mirror -RUN < /etc/apt/sources.list -deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse -deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse -deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse -deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse -deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse -deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse -deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse -deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse -EOF -EOT - # Install base tools for compilation RUN < /etc/timezone +apt-get install -y --no-install-recommends \ build-essential \ autotools-dev \ libaio-dev \ @@ -70,29 +57,39 @@ apt update && apt install -y --no-install-recommends \ pkg-config \ cmake \ bzip2 \ + curl \ + bzip2 \ tar \ curl \ wget \ - jq + jq \ + openssh-client \ + openssh-server \ + htop jq \ + libgl1-mesa-glx bash-completion \ + iftop iotop ca-certificates pip install pipx pipx install nvitop pipx ensurepath . ~/.bashrc EOT -RUN echo "Check wget version" && wget --version - -# Install Modules for environment management -COPY ./file/modules-5.4.0.tar.gz /root +# SSH setup RUN <> /etc/profile -echo "source /opt/modules/init/profile.sh" >> ~/.bashrc +mkdir ~/.ssh +printf "Host * \n ForwardAgent yes\nHost *\n StrictHostKeyChecking no" > ~/.ssh/config +cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak +sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config +sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config +sed -i 's/^\(\s*\)GSSAPIAuthentication yes/\1GSSAPIAuthentication no/' /etc/ssh/ssh_config +sed -i "s/^#Port 22/Port ${SSH_PORT}/" /etc/ssh/sshd_config +ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N "" <<< y +cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys +chmod 600 /root/.ssh/authorized_keys +mkdir /var/run/sshd +echo "root:${ROOT_PASSWD}" | chpasswd EOT # Install FFTW @@ -192,14 +189,6 @@ make install echo "source /usr/local/gromacs-${GROMACS_VERSION}-plumed-${PLUMED_VERSION}/bin/GMXRC.bash" >> /root/.bashrc EOT -# Install AmberTools and Amber -COPY file/Amber24.tar.bz2 file/AmberTools24.tar.bz2 /root -RUN <> ~/.bashrc echo "source /opt/intel/onemkl/setvars.sh" >> ~/.bashrc EOT -# SSH setup -RUN < ~/.ssh/config -cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak -sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config -sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config -sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config -sed -i 's/^\(\s*\)GSSAPIAuthentication yes/\1GSSAPIAuthentication no/' /etc/ssh/ssh_config -sed -i "s/^#Port 22/Port ${SSH_PORT}/" /etc/ssh/sshd_config -ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N "" <<< y -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys -chmod 600 /root/.ssh/authorized_keys -mkdir /var/run/sshd -echo "root:${ROOT_PASSWD}" | chpasswd -EOT - -# Timezone setup -RUN < /etc/timezone -EOT - # Install micromamba silently WORKDIR /root ENV BIN_FOLDER=/usr/local/bin @@ -284,6 +247,16 @@ RUN <> /root/.bashrc # Initialize micromamba for bash @@ -359,5 +359,5 @@ EOF EOT # SSH setup -EXPOSE ${SSH_PORT} +# EXPOSE ${SSH_PORT} CMD ["/usr/sbin/sshd", "-D"] \ No newline at end of file diff --git a/Dockerfile.gromacs_amber_staget b/Dockerfile.gromacs_amber_staget index 07dbc05..1baa562 100644 --- a/Dockerfile.gromacs_amber_staget +++ b/Dockerfile.gromacs_amber_staget @@ -41,7 +41,10 @@ EOT # Install base tools for compilation RUN < /etc/timezone +apt-get install -y --no-install-recommends \ build-essential \ autotools-dev \ libaio-dev \ @@ -70,17 +73,40 @@ apt update && apt install -y --no-install-recommends \ pkg-config \ cmake \ bzip2 \ + curl \ + bzip2 \ tar \ curl \ wget \ - jq + jq \ + openssh-client \ + openssh-server \ + htop jq \ + libgl1-mesa-glx bash-completion \ + iftop iotop ca-certificates pip install pipx pipx install nvitop pipx ensurepath . ~/.bashrc EOT -RUN echo "Check wget version" && wget --version +# SSH setup +RUN < ~/.ssh/config +cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak +sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config +sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config +sed -i 's/^\(\s*\)GSSAPIAuthentication yes/\1GSSAPIAuthentication no/' /etc/ssh/ssh_config +sed -i "s/^#Port 22/Port ${SSH_PORT}/" /etc/ssh/sshd_config +ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N "" <<< y +cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys +chmod 600 /root/.ssh/authorized_keys +mkdir /var/run/sshd +echo "root:${ROOT_PASSWD}" | chpasswd +EOT # Install Modules for environment management COPY ./file/modules-5.4.0.tar.gz /root @@ -192,14 +218,6 @@ make install echo "source /usr/local/gromacs-${GROMACS_VERSION}-plumed-${PLUMED_VERSION}/bin/GMXRC.bash" >> /root/.bashrc EOT -# Install AmberTools and Amber -COPY file/Amber24.tar.bz2 file/AmberTools24.tar.bz2 /root -RUN <> ~/.bashrc echo "source /opt/intel/onemkl/setvars.sh" >> ~/.bashrc EOT -# SSH setup -RUN < ~/.ssh/config -cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak -sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config -sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config -sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config -sed -i 's/^\(\s*\)GSSAPIAuthentication yes/\1GSSAPIAuthentication no/' /etc/ssh/ssh_config -sed -i "s/^#Port 22/Port ${SSH_PORT}/" /etc/ssh/sshd_config -ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N "" <<< y -cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys -chmod 600 /root/.ssh/authorized_keys -mkdir /var/run/sshd -echo "root:${ROOT_PASSWD}" | chpasswd -EOT - -# Timezone setup -RUN < /etc/timezone -EOT - # Install micromamba silently WORKDIR /root ENV BIN_FOLDER=/usr/local/bin @@ -284,6 +276,16 @@ RUN <> /root/.bashrc -# # Initialize micromamba for bash -# eval "$(micromamba shell hook --shell )" -# /usr/local/bin/micromamba shell init --shell=bash --root-prefix=/opt/micromamba -# # Activate micromamba -# source /root/.bashrc -# micromamba self-update -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/ -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 -# micromamba config append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free -# micromamba config append channels https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/ -# micromamba config append channels https://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda/ -# # Activate the PyAutoFEP environment -# micromamba activate PyAutoFEP -# mkdir -p ~/.pip -# cat << EOF > ~/.pip/pip.conf -# [global] -# index-url = https://mirrors.aliyun.com/pypi/simple/ - -# [install] -# trusted-host=mirrors.aliyun.com -# EOF -# EOT - -# SSH setup -EXPOSE ${SSH_PORT} -CMD ["/usr/sbin/sshd", "-D"] \ No newline at end of file +EOT \ No newline at end of file diff --git a/docker-compose_amber_stage.yml b/docker-compose_amber_stage.yml index 09de5da..eda925b 100755 --- a/docker-compose_amber_stage.yml +++ b/docker-compose_amber_stage.yml @@ -14,8 +14,8 @@ services: BUILDKIT_INLINE_CACHE: 1 # env_file: # - .env - volumes: - - ./data:/data + # volumes: + # - ./data:/data container_name: gromacs_amber_stage pull_policy: if_not_present ulimits: @@ -33,8 +33,8 @@ services: - NVIDIA_VISIBLE_DEVICES=all - NVIDIA_DRIVER_CAPABILITIES=compute,utility - TMPDIR=/var/tmp - ports: - - "53322:2222" + # ports: + # - "53322:2222" # network_mode: host # command: ["/usr/sbin/sshd", "-D"] command: ["tail", "-f", "/dev/null"] diff --git a/docker-compose_amber_staget.yml b/docker-compose_amber_staget.yml index 1ac6301..f3fb68b 100755 --- a/docker-compose_amber_staget.yml +++ b/docker-compose_amber_staget.yml @@ -14,8 +14,8 @@ services: BUILDKIT_INLINE_CACHE: 1 # env_file: # - .env - volumes: - - ./data:/data + # volumes: + # - ./data:/data container_name: gromacs_amber_staget pull_policy: if_not_present ulimits: @@ -33,8 +33,8 @@ services: - NVIDIA_VISIBLE_DEVICES=all - NVIDIA_DRIVER_CAPABILITIES=compute,utility - TMPDIR=/var/tmp - ports: - - "53322:2222" + # ports: + # - "53322:2222" # network_mode: host # command: ["/usr/sbin/sshd", "-D"] command: ["tail", "-f", "/dev/null"]