Skip to content

install default set of OS packages in container recipes starting from scratch + allow customizing EasyBuild installation commands + 'post' commands#2907

Merged
vanzod merged 1 commit intoeasybuilders:developfrom
boegel:enhance_containers_support
Jun 4, 2019
Merged

install default set of OS packages in container recipes starting from scratch + allow customizing EasyBuild installation commands + 'post' commands#2907
vanzod merged 1 commit intoeasybuilders:developfrom
boegel:enhance_containers_support

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Jun 4, 2019

No description provided.

… scratch +allow customizing EasyBuild installation commands + 'post' commands
@boegel boegel added this to the next release (3.9.2) milestone Jun 4, 2019
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 4, 2019

Example:

$ eb -C --experimental --container-base-config bootstrap=yum,osversion=7 bzip2-1.0.6.eb

results in following recipe:

Bootstrap: yum
OSVersion: 7
MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/x86_64/
Include: yum

%post
yum install -y epel-release
yum install -y python setuptools Lmod
yum install -y bzip2 gzip tar unzip xz
yum install -y curl wget
yum install -y patch make
yum install -y file git which
yum install -y python-pip
yum install -y vim
yum install -y gcc-c++
yum install -y perl-Data-Dumper
yum install -y perl-Thread-Queue

# install EasyBuild using pip
pip install -U setuptools
pip install -U 'vsc-install<0.11.4' 'vsc-base<2.9.0'
pip install -U easybuild

# create 'easybuild' user (if missing)
id easybuild || useradd easybuild

# create /app software installation prefix + /scratch sandbox directory
if [ ! -d /app ]; then mkdir -p /app; chown easybuild:easybuild -R /app; fi
if [ ! -d /scratch ]; then mkdir -p /scratch; chown easybuild:easybuild -R /scratch; fi

# change to 'easybuild' user
su - easybuild

eb bzip2-1.0.6.eb --robot --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp

# exit from 'easybuild' user
exit

# cleanup
rm -rf /scratch/tmp/* /scratch/build /scratch/sources /scratch/ebfiles_repo

%runscript
eval "$@"

%environment
source /etc/profile
module use /app/modules/all
module load bzip2/1.0.6

While:

$ eb -C --experimental --container-base-config bootstrap=localimage,from=centos7-ncurses-6.1.sif CMake-3.12.1.eb

results in

Bootstrap: localimage
From: centos7-ncurses-6.1.sif

%post
yum --skip-broken -y install openssl-devel libssl-dev libopenssl-devel

# install EasyBuild using pip
pip install -U setuptools
pip install 'vsc-install<0.11.4' 'vsc-base<2.9.0'
pip install easybuild

# create 'easybuild' user (if missing)
id easybuild || useradd easybuild

# create /app software installation prefix + /scratch sandbox directory
if [ ! -d /app ]; then mkdir -p /app; chown easybuild:easybuild -R /app; fi
if [ ! -d /scratch ]; then mkdir -p /scratch; chown easybuild:easybuild -R /scratch; fi

# change to 'easybuild' user
su - easybuild

eb CMake-3.12.1.eb --robot --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp

# exit from 'easybuild' user
exit

# cleanup
rm -rf /scratch/tmp/* /scratch/build /scratch/sources /scratch/ebfiles_repo

%runscript
eval "$@"

%environment
source /etc/profile
module use /app/modules/all
module load CMake/3.12.1

Comment thread easybuild/tools/containers/singularity.py
@vanzod vanzod merged commit 7a03a67 into easybuilders:develop Jun 4, 2019
@boegel boegel deleted the enhance_containers_support branch June 4, 2019 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants