diff --git a/Dockerfile b/Dockerfile index 5623e5a..6d40e8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,16 @@ ARG BASE_IMAGE=ubuntu:noble FROM ${BASE_IMAGE} AS build ARG CYCLE=release ARG NAME= -RUN useradd -ms /bin/bash biocbuild && apt update -qq && apt install sudo systemd -y && usermod -aG sudo biocbuild && echo "biocbuild ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +RUN useradd -m -s /bin/bash -u 1007 biocbuild && apt update -qq && apt install sudo systemd -y && usermod -aG sudo biocbuild && echo "biocbuild ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers USER biocbuild COPY . /home/biocbuild/bioconductor_salt WORKDIR /home/biocbuild -RUN DEBIAN_FRONTEND="noninteractive" bash bioconductor_salt/startup_bbs_standalone_${CYCLE}.sh ${NAME} +RUN DEBIAN_FRONTEND="noninteractive" bash bioconductor_salt/startup_bbs_standalone.sh ${CYCLE} ${NAME} FROM ${BASE_IMAGE} AS final COPY --from=build / / +USER biocbuild +WORKDIR /home/biocbuild ENTRYPOINT ["/bin/bash", "-c"] CMD ["/bbs_r_start"] diff --git a/saltstack/pillar/common/linux.sls b/saltstack/pillar/common/linux.sls index 11d4a74..0d37344 100644 --- a/saltstack/pillar/common/linux.sls +++ b/saltstack/pillar/common/linux.sls @@ -1,6 +1,7 @@ build: types: - bioc {# always required #} + - bioc-gpu - bioc-longtests - books - data-annotation diff --git a/saltstack/salt/common/linux.sls b/saltstack/salt/common/linux.sls index e07f1b6..aed822a 100644 --- a/saltstack/salt/common/linux.sls +++ b/saltstack/salt/common/linux.sls @@ -101,6 +101,7 @@ install_pkgs_for_gpu: - texlive-fonts-extra - libthrust-dev - libcub-dev + - rsync {% else %} install_apt_pkgs: cmd.run: diff --git a/startup_bbs_standalone_devel.sh b/startup_bbs_standalone.sh similarity index 85% rename from startup_bbs_standalone_devel.sh rename to startup_bbs_standalone.sh index aa034c9..e73638a 100644 --- a/startup_bbs_standalone_devel.sh +++ b/startup_bbs_standalone.sh @@ -26,13 +26,19 @@ sudo cp -r bioconductor_salt/saltstack/salt /srv sudo cp -r bioconductor_salt/saltstack/pillar /srv sudo cp bioconductor_salt/saltstack/minion.d/minion.conf /etc/salt/minion -if [ "${1}" = "nvidia-noble" ]; then +if [ "${1}" = "devel" ]; then + cycle="devel" +else + cycle="release" +fi + +if [ "${2}" = "nvidia-noble" ]; then opt="_gpu" else opt="" fi -sudo mv /srv/pillar/custom/devel_standalone${opt}.sls /srv/pillar/custom/init.sls +sudo mv /srv/pillar/custom/${cycle}_standalone${opt}.sls /srv/pillar/custom/init.sls sudo salt-call --local state.highstate || true @@ -47,6 +53,9 @@ sudo echo "export PATH='$PATH:$RPATH'" | sudo tee -a /etc/bash.bashrc sudo echo "#!/bin/bash" | sudo tee /bbs_r_start sudo echo "$RPATH/R \"\$@\"" | sudo tee -a /bbs_r_start +# Change permissions for volumes +sudo echo "sudo chown -R biocbuild:biocbuild /home/biocbuild" | sudo tee -a /bbs_r_start + sudo chown biocbuild /bbs_r_start sudo chmod +x /bbs_r_start diff --git a/startup_bbs_standalone_release.sh b/startup_bbs_standalone_release.sh deleted file mode 100644 index ce7ea3f..0000000 --- a/startup_bbs_standalone_release.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -# Basic deps -sudo apt update -qq -sudo apt -y install curl git build-essential python3 python3-pip locales wget - -# Set up saltstack - -#https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/linux-deb.html - -mkdir -p /etc/apt/keyrings -curl -fsSL https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public | sudo tee /etc/apt/keyrings/salt-archive-keyring.pgp -curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources | sudo tee /etc/apt/sources.list.d/salt.sources - -sudo apt-get -y update -sudo apt-get -y install salt-minion -sudo service salt-minion stop -sudo systemctl disable salt-minion - -# Assumes the repository has already been cloned to the working directory -# cd ~ -# git clone -b standalone https://github.com/Bioconductor/bioconductor_salt - -# Set up bioconductor's saltstack -sudo cp -r bioconductor_salt/saltstack/salt /srv -sudo cp -r bioconductor_salt/saltstack/pillar /srv -sudo cp bioconductor_salt/saltstack/minion.d/minion.conf /etc/salt/minion - -if [ "${1}" = "nvidia-noble" ]; then - opt="_gpu" -else - opt="" -fi - -sudo mv /srv/pillar/custom/release_standalone${opt}.sls /srv/pillar/custom/init.sls - -sudo salt-call --local state.highstate || true - -# Find R path and check that it works -if ! /home/biocbuild/bbs-*/R/bin/R --version > /tmp/rver; then exit 1; fi - -RPATH="$(echo /home/biocbuild/bbs-*/R/bin)" - -echo "export PATH='$PATH:$RPATH'" | sudo tee -a /etc/profile -echo "export PATH='$PATH:$RPATH'" | sudo tee -a /etc/bash.bashrc - -echo "#!/bin/bash" | sudo tee /bbs_r_start -echo "$RPATH/R \"\$@\"" | sudo tee -a /bbs_r_start - -sudo chown biocbuild /bbs_r_start -sudo chmod +x /bbs_r_start - -sudo ln -s /home/biocbuild/bbs-*-bioc/R/bin/R /usr/bin/R -sudo ln -s /home/biocbuild/bbs-*-bioc/R/bin/Rscript /usr/bin/Rscript - -# Cleanup -# rm -rf /srv /etc/salt -# sudo apt-get -y purge salt-minion - -