Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building binutils from eb inside singularity. Initial work #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

building binutils from eb inside singularity. Initial work #3

wants to merge 2 commits into from

Conversation

shahzebsiddiqui
Copy link
Contributor

done by Paulo Souza. Few modifications done by Shahzeb Siddiqui.
Attaching log file for output just in case there are issues building
container on different architectures

done by Paulo Souza. Few modifications done by Shahzeb Siddiqui.
Attaching log file for output just in case there are issues building
container on different architectures
@pescobar
Copy link
Owner

pescobar commented Jul 3, 2017

@shahzebsiddiqui why do you want to merge a log file?

@shahzebsiddiqui
Copy link
Contributor Author

I can remove the log file if you want, I just put it in the commit to capture the output of the build. For instance the container might build on some architectures and OS but not others.

# https://gcc.gnu.org/wiki/InstallingGCC
yum install -y libmpc-devel mpfr-devel gmp-devel
yum install -y zlib-devel*
yum install -y curl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none of this is actually needed, I would let dependencies be handled by EasyBuild?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

# scratch space to build and download source files from eb
export EASYBUILD_PREFIX=/scratch
mkdir -p $EASYBUILD_PREFIX
chmod 777 $EASYBUILD_PREFIX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 777?

mkdir -p $EASYBUILD_PREFIX
chmod 777 $EASYBUILD_PREFIX

mkdir -p /app
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $EASYBUILD_INSTALLPATH here

pip install -U setuptools
pip install -U easybuild
yum install -y git
chmod 777 /app
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $EASYBUILD_INSTALLPATH, but there's no need for the 777?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed 777 for now. Also removed git since we are installing easybuild via pip. chmod 777 was set so that singularity user can write to /scratch and /app. By default root will create the directories with 755 privilege and we want to install eb apps with a non-root account. That is why 777 was set.

chmod 777 /app
useradd singularity
. /etc/profile
module load lmod
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit strange, chicken-or-egg problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I don't think we need this, also no need to load lmod module. I think runuser singularity -c will run in Interactive Non-login mode. With bash we need the singularity user to have ~/.bashrc which I confirmed did exist using useradd command. There is a known issue with Interactive Non-login for Bash user in Lmod see page 26 of https://media.readthedocs.org/pdf/lmod/latest/lmod.pdf. The solution seems to be in implemented already so singularity should pick up module command with this shell invocation.


runuser singularity -c 'eb b/binutils/binutils-2.26.eb --robot'
rm -rf $EASYBUILD_PREFIX
chmod 755 /app
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $EASYBUILD_INSTALLPATH, but no need for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the line


cd $EASYBUILD_PREFIX
runuser singularity -c 'git clone https://github.com/hpcugent/easybuild-easyconfigs.git'
cd easybuild-easyconfigs/easybuild/easyconfigs/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed, easyconfigs are shipped with EasyBuild?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

runuser singularity -c 'git clone https://github.com/hpcugent/easybuild-easyconfigs.git'
cd easybuild-easyconfigs/easybuild/easyconfigs/

export EASYBUILD_ROBOT_PATHS=$PWD
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this should be setup within easybuild when installing with pip

export EASYBUILD_ROBOT_PATHS=$PWD

# mkdir $PWD/tmp
# chmod 777 $PWD/tmp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

yum install -y epel-release
yum install -y Lmod
# vi
yum install -y vim-enhanced
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required?

Copy link
Contributor Author

@shahzebsiddiqui shahzebsiddiqui Jul 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need epel-release and Lmod, epel-release is also needed to install pip I have removed vim and Development Tools. I have commented out tcsh, not sure if we want to support csh.

yum install -y Lmod

# eb dependencies
yum install python-devel -y
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EB doesn't require the -devel?


# eb dependencies
yum install python-devel -y
yum install python-setuptools -y
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

being installed with pip below, so either drop this, or drop the pip install setuptools?

. /etc/bashrc
fi
module use /app/modules/all
module load binutils
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow use a variable for both the software name and (long) version?

So you can do:

%post
    ...
    runuser singularity -c "eb ${SOFTWARE_NAME}-${SOFTWARE_VERSION}.eb --robot"

%environment
    ...
    module load ${SOFTWARE_NAME}/${SOFTWARE_VERSION}

Not sure if that's possible though...

# scratch space to build and download source files from eb
export EASYBUILD_PREFIX=/scratch

mkdir -p $EASYBUILD_PREFIX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nitpicking: fix indent?

# module load lmod


runuser singularity -c 'echo $PATH; env | grep EASYBUILD; eb --version; eb --show-config'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the env | grep EASYBUILD is kind of overkill, since eb --show-config will show via which mechanism each setting was defined (E for environment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was testing this out, because eb was not working due to PATH issue. Dont worry will remove this command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants