Skip to content

Commit

Permalink
Update 08.2023
Browse files Browse the repository at this point in the history
  • Loading branch information
kstawiski committed Aug 25, 2023
1 parent 6e86d9a commit 752b13b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 42 deletions.
28 changes: 16 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,30 @@ ENV DEBIAN_FRONTEND=noninteractive
# Setup Ubuntu
ENV TZ=Europe/Warsaw
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN chsh -s /bin/bash root && echo 'SHELL=/bin/bash' >> /etc/environment && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt update && apt dist-upgrade -y && apt-get install -y pciutils libkmod-dev libgsl-dev libv8-dev mc nano libglu1-mesa-dev libharfbuzz-dev libfribidi-dev libgit2-dev gdebi uuid apt-transport-https screen libfontconfig1-dev openssh-server build-essential libxml2-dev xorg ca-certificates cmake curl git libatlas-base-dev libcurl4-openssl-dev libjemalloc-dev liblapack-dev libopenblas-dev libzmq3-dev software-properties-common sudo unzip wget && add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt update && apt install -y build-essential libmagick++-dev libbz2-dev libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev fort77 xorg-dev liblzma-dev libblas-dev gfortran gcc-multilib gobjc++ libreadline-dev && apt install -y libcairo2-dev freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev libopenblas-dev liblapack-dev build-essential git gcc cmake libcairo2-dev libxml2-dev build-essential openslide-tools g++ gcc libblas-dev liblapack-dev libcurl4-gnutls-dev libxml2-dev libssl-dev awscli libsquashfuse-dev supervisor default-jdk && mkdir /www && mkdir /work
RUN chsh -s /bin/bash root && echo 'SHELL=/bin/bash' >> /etc/environment && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt update && apt dist-upgrade -y && apt-get install -y pciutils libkmod-dev libgsl-dev libv8-dev mc nano libglu1-mesa-dev libharfbuzz-dev libfribidi-dev libgit2-dev gdebi uuid apt-transport-https screen libfontconfig1-dev openssh-server build-essential libxml2-dev xorg ca-certificates cmake curl git libatlas-base-dev libcurl4-openssl-dev libjemalloc-dev liblapack-dev libopenblas-dev libzmq3-dev software-properties-common sudo unzip wget && add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt update && apt install -y build-essential libmagick++-dev libbz2-dev libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev fort77 xorg-dev liblzma-dev libblas-dev gfortran gcc-multilib gobjc++ libreadline-dev && apt install -y libcairo2-dev freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev libopenblas-dev liblapack-dev build-essential git gcc cmake openslide-tools g++ gcc libblas-dev liblapack-dev libcairo2-dev libxml2-dev build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev awscli libsquashfuse-dev supervisor default-jdk && mkdir /www && mkdir /work

# CUDA
# RUN CODENAME=$(cat /etc/*-release | grep UBUNTU_CODENAME | cut -d'=' -f 2) && wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb && dpkg -i cuda-keyring_1.0-1_all.deb && rm cuda-keyring_1.0-1_all.deb && apt update && apt -y -f install cuda


# Install Anaconda
ENV PATH /opt/conda/bin:$PATH
ENV SHELL /bin/bash
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
/bin/bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda
RUN rm Miniconda3-latest-Linux-x86_64.sh &&\
RUN rm Miniconda3-latest-Linux-x86_64.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
ENV TENSORFLOW_PYTHON /opt/conda/bin/python
ENV RETICULATE_PYTHON /opt/conda/bin/python
RUN conda config --add channels defaults && conda config --add channels bioconda && conda config --add channels conda-forge && conda config --set channel_priority strict && conda install -c conda-forge -c bioconda mamba
RUN conda config --add channels defaults && conda config --add channels bioconda && conda config --add channels conda-forge && conda config --set channel_priority strict

# Install common tools:
RUN mamba install -c bioconda -c conda-forge nextflow && apt-get -y install awscli samtools bcftools && pip3 install dbxfs && mamba init bash
RUN apt-get -y install awscli samtools bcftools && pip3 install dbxfs

# R:
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -sc)-cran40/" && apt update && apt -y dist-upgrade && apt install -y r-base-dev r-recommended build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev && Rscript -e "install.packages(c('data.table','dplyr','devtools', 'languageserver'))"
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -sc)-cran40/" && apt update && apt -y dist-upgrade && apt install -y r-base-dev r-recommended build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev && Rscript -e "install.packages(c('data.table','dplyr','devtools', 'languageserver', 'BiocManager'))"

# Google Cloud for Terra
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y && export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s` && echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && apt-get update && apt-get install gcsfuse -y
Expand All @@ -34,7 +38,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.c
RUN curl -fsSL https://get.docker.com -o get-docker.sh && sudo bash get-docker.sh && rm get-docker.sh

# Localtunnel
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && apt-get install -y npm && apt-get install -y nodejs && npm install -g localtunnel
# RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && apt-get install -y npm && apt-get install -y nodejs && npm install -g localtunnel

# Signularity - get new from https://github.com/sylabs/singularity/releases
RUN wget https://github.com/sylabs/singularity/releases/download/v3.10.3/singularity-ce_3.10.3-focal_amd64.deb && apt -y install ./singularity-ce_3.10.3-focal_amd64.deb && rm ./singularity*.deb
Expand All @@ -46,10 +50,10 @@ RUN curl https://rclone.org/install.sh | bash
RUN curl -fsSL https://code-server.dev/install.sh | sh && code-server --install-extension ms-python.python --force && code-server --install-extension REditorSupport.r --force && code-server --install-extension formulahendry.code-runner --force && code-server --install-extension GrapeCity.gc-excelviewer --force && code-server --install-extension daghostman.vs-treeview --force && code-server --install-extension broadinstitute.wdl-devtools --force && code-server --install-extension Mikhail-Arkhipov.r --force && code-server --install-extension rogalmic.bash-debug --force

# Extentions
RUN conda install -c conda-forge jupyter_contrib_nbextensions nb_conda_kernels nbresuse && pip install -U scikit-learn xgboost torch pandas numpy nbzip
RUN pip install -U scikit-learn xgboost torch pandas numpy nbzip

# RStudio server:
RUN apt-get install -y libclang-dev libssl-dev gdebi-core && wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.12.0-353-amd64.deb && gdebi -n rstudio-server-2022.12.0-353-amd64.deb && apt -f -y install && cd / && rm rstudio-server-2022.12.0-353-amd64.deb
RUN apt-get install -y libclang-dev libssl-dev gdebi-core && wget https://download2.rstudio.org/server/focal/amd64/rstudio-server-2023.06.2-561-amd64.deb -O rstudio.deb && gdebi -n rstudio.deb && apt -f -y install && rm rstudio.deb

# Build GUI
COPY www/jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
Expand All @@ -63,7 +67,7 @@ ADD www /www
COPY .htpasswd /www/.htpasswd

# R packages
RUN Rscript -e 'devtools::source_url("https://raw.githubusercontent.com/kstawiski/OmicSelector/master/vignettes/setup.R")'
# RUN Rscript -e 'devtools::source_url("https://raw.githubusercontent.com/kstawiski/OmicSelector/master/vignettes/setup.R")'

# Tailscale
RUN echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf && echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/99-tailscale.conf && sysctl -p /etc/sysctl.d/99-tailscale.conf && curl -fsSL https://tailscale.com/install.sh | sh
Expand All @@ -72,13 +76,13 @@ RUN echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf && e
RUN curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash

# Terminal
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && echo 'export NOTVISIBLE="in users profile"' >> ~/.bashrc && echo "export VISIBLE=now" >> /etc/profile && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && echo 'root:konrad' | chpasswd && npm install -g yarn && yarn global add wetty
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && echo 'export NOTVISIBLE="in users profile"' >> ~/.bashrc && echo "export VISIBLE=now" >> /etc/profile && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && echo 'root:konrad' | chpasswd

# Charliecloud
# RUN sysctl -w kernel.unprivileged_userns_clone=1 && wget https://github.com/hpc/charliecloud/releases/download/v0.29/charliecloud-0.29.tar.gz && tar xvzf charliecloud-0.29.tar.gz && rm charliecloud-0.29.tar.gz && cd charliecloud-0.29 && ./autogen.sh && ./configure && make && make install

# Squid (running only in tailscale)
RUN apt -y install squid && rm -f /etc/squid/squid.conf && wget --no-check-certificate -O /etc/squid/squid.conf https://gist.githubusercontent.com/radenvodka/d26f13fd2f7398d31635bcf17f9330b7/raw/432fbcee54c986248168851263720852a6b11005/squid.conf && iptables -I INPUT -p tcp --dport 3128 -j ACCEPT && iptables-save
# Squid
RUN apt -y install squid && rm -f /etc/squid/squid.conf && wget --no-check-certificate -O /etc/squid/squid.conf https://gist.githubusercontent.com/radenvodka/d26f13fd2f7398d31635bcf17f9330b7/raw/432fbcee54c986248168851263720852a6b11005/squid.conf

ADD Docker_init.sh /
ADD config.yaml /
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ RUN rm Miniconda3-latest-Linux-x86_64.sh && \
echo "conda activate base" >> ~/.bashrc
ENV TENSORFLOW_PYTHON /opt/conda/bin/python
ENV RETICULATE_PYTHON /opt/conda/bin/python
RUN conda config --add channels defaults && conda config --add channels bioconda && conda config --add channels conda-forge && conda config --set channel_priority strict && conda install -c conda-forge -c bioconda mamba
RUN conda config --add channels defaults && conda config --add channels bioconda && conda config --add channels conda-forge && conda config --set channel_priority strict

# Install common tools:
RUN apt-get -y install awscli samtools bcftools && pip3 install dbxfs && mamba init bash
RUN apt-get -y install awscli samtools bcftools && pip3 install dbxfs

# R:
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -sc)-cran40/" && apt update && apt -y dist-upgrade && apt install -y r-base-dev r-recommended build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev && Rscript -e "install.packages(c('data.table','dplyr','devtools', 'languageserver'))"
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -sc)-cran40/" && apt update && apt -y dist-upgrade && apt install -y r-base-dev r-recommended build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev && Rscript -e "install.packages(c('data.table','dplyr','devtools', 'languageserver', 'BiocManager'))"

# Google Cloud for Terra
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y && export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s` && echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && apt-get update && apt-get install gcsfuse -y
Expand All @@ -50,10 +50,10 @@ RUN curl https://rclone.org/install.sh | bash
RUN curl -fsSL https://code-server.dev/install.sh | sh && code-server --install-extension ms-python.python --force && code-server --install-extension REditorSupport.r --force && code-server --install-extension formulahendry.code-runner --force && code-server --install-extension GrapeCity.gc-excelviewer --force && code-server --install-extension daghostman.vs-treeview --force && code-server --install-extension broadinstitute.wdl-devtools --force && code-server --install-extension Mikhail-Arkhipov.r --force && code-server --install-extension rogalmic.bash-debug --force

# Extentions
RUN conda install -c conda-forge jupyter_contrib_nbextensions nb_conda_kernels nbresuse && pip install -U scikit-learn xgboost torch pandas numpy nbzip
RUN pip install -U scikit-learn xgboost torch pandas numpy nbzip

# RStudio server:
RUN apt-get install -y libclang-dev libssl-dev gdebi-core && wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.12.0-353-amd64.deb && gdebi -n rstudio-server-2022.12.0-353-amd64.deb && apt -f -y install && cd / && rm rstudio-server-2022.12.0-353-amd64.deb
RUN apt-get install -y libclang-dev libssl-dev gdebi-core && wget https://download2.rstudio.org/server/focal/amd64/rstudio-server-2023.06.2-561-amd64.deb -O rstudio.deb && gdebi -n rstudio.deb && apt -f -y install && rm rstudio.deb

# Build GUI
COPY www/jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
Expand All @@ -67,7 +67,7 @@ ADD www /www
COPY .htpasswd /www/.htpasswd

# R packages
RUN Rscript -e 'devtools::source_url("https://raw.githubusercontent.com/kstawiski/OmicSelector/master/vignettes/setup.R")'
# RUN Rscript -e 'devtools::source_url("https://raw.githubusercontent.com/kstawiski/OmicSelector/master/vignettes/setup.R")'

# Tailscale
RUN echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf && echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/99-tailscale.conf && sysctl -p /etc/sysctl.d/99-tailscale.conf && curl -fsSL https://tailscale.com/install.sh | sh
Expand All @@ -76,13 +76,13 @@ RUN echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf && e
RUN curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash

# Terminal
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && echo 'export NOTVISIBLE="in users profile"' >> ~/.bashrc && echo "export VISIBLE=now" >> /etc/profile && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && echo 'root:konrad' | chpasswd && npm install -g yarn && yarn global add wetty
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && echo 'export NOTVISIBLE="in users profile"' >> ~/.bashrc && echo "export VISIBLE=now" >> /etc/profile && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && echo 'root:konrad' | chpasswd

# Charliecloud
# RUN sysctl -w kernel.unprivileged_userns_clone=1 && wget https://github.com/hpc/charliecloud/releases/download/v0.29/charliecloud-0.29.tar.gz && tar xvzf charliecloud-0.29.tar.gz && rm charliecloud-0.29.tar.gz && cd charliecloud-0.29 && ./autogen.sh && ./configure && make && make install

# Squid
RUN apt -y install squid && rm -f /etc/squid/squid.conf && wget --no-check-certificate -O /etc/squid/squid.conf https://gist.githubusercontent.com/radenvodka/d26f13fd2f7398d31635bcf17f9330b7/raw/432fbcee54c986248168851263720852a6b11005/squid.conf && iptables -I INPUT -p tcp --dport 3128 -j ACCEPT && iptables-save
RUN apt -y install squid && rm -f /etc/squid/squid.conf && wget --no-check-certificate -O /etc/squid/squid.conf https://gist.githubusercontent.com/radenvodka/d26f13fd2f7398d31635bcf17f9330b7/raw/432fbcee54c986248168851263720852a6b11005/squid.conf

ADD Docker_init.sh /
ADD config.yaml /
Expand Down
Binary file added rstudio-server-2023.06.0-421-amd64.deb
Binary file not shown.
14 changes: 2 additions & 12 deletions www/default
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ server {
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
proxy_buffering off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}

rewrite ^/f$ $scheme://$http_host/f/ permanent;
Expand All @@ -59,18 +61,6 @@ server {
proxy_buffering off;
}

location ^~ /wetty {
proxy_pass http://127.0.0.1:3000/wetty;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 43200000;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}



Expand Down
10 changes: 0 additions & 10 deletions www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,7 @@
</div><p></p>

<div class="panel panel-primary"><div class="panel-body">
<p style="text-align:right"><a href="wetty/ssh/root?pass=konrad" target="_blank"><i class="fas fa-terminal"></i> New window</a></p>
<iframe src="wetty/ssh/root?pass=konrad" width="100%" height="500" frameBorder="0"></iframe>
<p style="text-align:left">Useful: <code>top -d1</code>, <code>free -h</code>, <code>df -h</code></p>
<p style="text-align:left">SSH connection for terminal & files (SCP, SFTP): <code>sshpass -p konrad ssh root@<?php echo $_SERVER['SERVER_ADDR']; ?></code></p>

<button class="accordion"><i class="fas fa-sticky-note"></i>&emsp;&emsp;Notes</button>
<div class="panelaa">
<p></p>
<iframe src="n.php" width="100%" height="500" frameBorder="0"></iframe>
</div>

</div></div>
<p></p>
<div class="col-xs-3 col-sm-3 col-lg-3" id="cpuDiv">
Expand Down

0 comments on commit 752b13b

Please sign in to comment.