neurodocker icon indicating copy to clipboard operation
neurodocker copied to clipboard

no copying when generating a singularity def

Open Remi-Gau opened this issue 4 years ago • 1 comments

Tried the following command to generate a singularity def file for the python code from glmsingle (https://github.com/cvnlab/GLMsingle)

docker run --rm repronim/neurodocker:0.7.0 generate singularity \
  --base python:3.9.12-slim-buster \
  --pkg-manager apt \
  --install "build-essential" \
  --copy glmsingle setup.py MANIFEST.in README.md requirements.txt /home/glmsingle/ \
  --workdir /glmsingle \
  --run "pip install ." \
  --user neuro \
  --workdir /home/neuro \
  --copy examples /home/neuro/examples > glmsingle.def

the output of the " --copy command" is not added to the def file.

Is this a known bug that was fixed between version 0.7 and 0.8? Should I update?

The core of the output is (I added a main comment in there):

Bootstrap: docker
From: python:3.9.12-slim-buster

%post
su - root

export ND_ENTRYPOINT="/neurodocker/startup.sh"
apt-get update -qq
apt-get install -y -q --no-install-recommends \
   apt-utils \
   bzip2 \
   ca-certificates \
   curl \
   locales \
   unzip
apt-get clean
rm -rf /var/lib/apt/lists/*
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG="en_US.UTF-8"
chmod 777 /opt && chmod a+s /opt
mkdir -p /neurodocker
if [ ! -f "$ND_ENTRYPOINT" ]; then
 echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT"
 echo 'set -e' >> "$ND_ENTRYPOINT"
 echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT"
 echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT";
fi
chmod -R 777 /neurodocker && chmod a+s /neurodocker

apt-get update -qq
apt-get install -y -q --no-install-recommends \
   build-essential
apt-get clean
rm -rf /var/lib/apt/lists/*

################################################
### FILES SHOULD BE COPIED HERE BUT ARE NOT
################################################

cd /glmsingle

pip install .

test "$(getent passwd neuro)" || useradd --no-user-group --create-home --shell /bin/bash neuro
su - neuro

cd /home/neuro

Remi-Gau avatar Apr 28 '22 16:04 Remi-Gau

@Remi-Gau - thanks for this report. it looks like this was fixed in version 0.8.0. but there is no docker image for that version. i am creating a new issue (https://github.com/ReproNim/neurodocker/issues/448) to track that.

i have uploaded the version 0.8.0 docker image to kaczmarj/neurodocker:0.8.0. can you please try the command below? i had to change --base to --base-image.

docker run --rm kaczmarj/neurodocker:0.8.0 generate singularity \
  --base-image python:3.9.12-slim-buster \
  --pkg-manager apt \
  --install "build-essential" \
  --copy glmsingle setup.py MANIFEST.in README.md requirements.txt /home/glmsingle/ \
  --workdir /glmsingle \
  --run "pip install ." \
  --user neuro \
  --workdir /home/neuro \
  --copy examples /home/neuro/examples > glmsingle.def

kaczmarj avatar Apr 29 '22 15:04 kaczmarj

OK it seems the problem of file not being copied is still there for version 0.8.0 and 0.9.0

Remi-Gau avatar Jan 01 '23 19:01 Remi-Gau

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 08 '23 01:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 11 '23 01:11 github-actions[bot]