def runtime(self, _from='0'): """Runtime specification""" instructions = [] instructions.append(comment('GNU compiler runtime')) instructions.append( packages(apt=self.__runtime_debs, yum=self.__runtime_rpms)) return instructions
def __str__(self): """String representation of the building block""" instructions = [] instructions.append(comment('GNU compiler')) instructions.append( packages(apt=self.__compiler_debs, yum=self.__compiler_rpms)) return '\n'.join(str(x) for x in instructions)
def __str__(self): """String representation of the building block""" instructions = [] instructions.append(comment('Python')) instructions.append( packages(apt=self.__debs, epel=self.__epel, yum=self.__rpms)) return '\n'.join([str(x) for x in instructions])
def runtime(self, _from='0'): """Install the runtime from a full build in a previous stage""" instructions = [] instructions.append(comment('PGI compiler')) if self.__ospackages: instructions.append(packages(ospackages=self.__ospackages)) instructions.append( copy(_from=_from, src=os.path.join(self.__basepath, self.__version, 'REDIST', '*.so'), dest=os.path.join(self.__basepath, self.__version, 'lib', ''))) instructions.append( shell(commands=[ 'ln -s {0} {1}'.format( os.path.join(self.__basepath, self.__version, 'lib', 'libpgnuma.so'), os.path.join(self.__basepath, self.__version, 'lib', 'libnuma.so')) ])) instructions.append( environment( variables={ 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format( os.path.join(self.__basepath, self.__version, 'lib')) })) return instructions
def runtime(self, _from='0'): """Runtime specification""" instructions = [] instructions.append(comment('Python')) instructions.append( packages(apt=self.__debs, epel=self.__epel, yum=self.__rpms)) return instructions
def __str__(self): """String representation of the building block""" instructions = [] instructions.append(comment('OFED')) instructions.append( packages(apt=self.__ospackages_deb, yum=self.__ospackages_rpm)) return '\n'.join(str(x) for x in instructions)
def __str__(self): """String representation of the building block""" ospackages = list(self.__ospackages) # Installer needs perl ospackages.append('perl') instructions = [] instructions.append( comment('PGI compiler version {}'.format(self.__version))) if self.__tarball: # Use tarball from local build context instructions.append( copy(src=self.__tarball, dest=os.path.join(self.__wd, self.__tarball))) else: # Downloading, so need wget ospackages.append('wget') if ospackages: instructions.append(packages(ospackages=ospackages)) instructions.append(shell(commands=self.__commands)) instructions.append( environment( variables={ 'PATH': '{}:$PATH'.format( os.path.join(self.__basepath, self.__version, 'bin')), 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format( os.path.join(self.__basepath, self.__version, 'lib')) })) return '\n'.join(str(x) for x in instructions)
def __str__(self): """String representation of the building block""" instructions = [] instructions.append(comment('CMake version {}'.format(self.__version))) instructions.append(packages(ospackages=self.__ospackages)) instructions.append(shell(commands=self.__commands)) return '\n'.join(str(x) for x in instructions)
def __str__(self): """String representation of the building block""" instructions = [] instructions.append(comment('MKL version {}'.format(self.version))) if self.__ospackages: instructions.append(packages(ospackages=self.__ospackages)) if not self.__eula: raise RuntimeError( 'Intel EULA was not accepted. To accept, see the documentation for this building block' ) instructions.append( packages( apt_keys=[ 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB' ], apt_repositories=[ 'deb https://apt.repos.intel.com/mkl all main' ], ospackages=['intel-mkl-64bit-{}'.format(self.version)], yum_keys=[ 'https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB' ], yum_repositories=[ 'https://yum.repos.intel.com/mkl/setup/intel-mkl.repo' ])) # Set the environment if self.__mklvars: # Source the mklvars environment script when starting the # container, but the variables not be available for any # subsequent build steps. instructions.append( shell(commands=[ 'echo "source /opt/intel/mkl/bin/mklvars.sh intel64" >> {}' .format(self.__bashrc) ])) else: # Set the environment so that it will be available to # subsequent build steps and when starting the container, # but this may miss some things relative to the mklvars # environment script. instructions.append( environment( variables={ 'CPATH': '/opt/intel/mkl/include:$CPATH', 'LD_LIBRARY_PATH': '/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64:$LD_LIBRARY_PATH', 'LIBRARY_PATH': '/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64:$LIBRARY_PATH', 'MKLROOT': '/opt/intel/mkl' })) return '\n'.join(str(x) for x in instructions)
def runtime(self, _from='0'): """Install the runtime from a full build in a previous stage""" instructions = [] instructions.append(comment('Charm++')) instructions.append( copy(_from=_from, src=self.__installdir, dest=self.__installdir)) instructions.append( environment(variables=self.__environment_variables)) return instructions
def __str__(self): """String representation of the building block""" instructions = [] if self.__directory: instructions.append(comment('FFTW')) else: instructions.append( comment('FFTW version {}'.format(self.__version))) instructions.append(packages(ospackages=self.__ospackages)) if self.__directory: # Use source from local build context instructions.append( copy(src=self.__directory, dest=os.path.join(self.__wd, self.__directory))) instructions.append(shell(commands=self.__commands)) instructions.append( environment(variables=self.__environment_variables)) return '\n'.join(str(x) for x in instructions)
def runtime(self, _from='0'): """Install the runtime from a full build in a previous stage""" instructions = [] instructions.append(comment('OpenMPI')) instructions.append(packages(ospackages=self.__runtime_ospackages)) instructions.append( copy(_from=_from, src=self.prefix, dest=self.prefix)) instructions.append( environment(variables=self.__environment_variables)) return instructions
def runtime(self, _from='0'): """Install the runtime from a full build in a previous stage""" instructions = [] instructions.append(comment('MVAPICH2')) # TODO: move the definition of runtime ospackages instructions.append(packages(ospackages=self.__runtime_ospackages)) instructions.append( copy(_from=_from, src=self.prefix, dest=self.prefix)) # No need to workaround compiler wrapper issue for the runtime. # Copy the dictionary so not to modify the original. vars = dict(self.__environment_variables) del vars['PROFILE_POSTLIB'] instructions.append(environment(variables=vars)) return instructions
def __str__(self): """String representation of the building block""" instructions = [] comments = ['NetCDF version {}'.format(self.__version)] if self.__cxx: comments.append('NetCDF C++ version {}'.format(self.__version_cxx)) if self.__fortran: comments.append('NetCDF Fortran version {}'.format( self.__version_fortran)) instructions.append(comment(', '.join(comments))) if self.__ospackages: instructions.append(packages(ospackages=self.__ospackages)) instructions.append(shell(commands=self.__commands)) instructions.append( environment(variables=self.__environment_variables)) return '\n'.join(str(x) for x in instructions)
def test_empty(self): """No comment string specified""" c = comment() self.assertEqual(c.toString(container_type.DOCKER), '')
def test_noreformat(self): """Disable reformatting""" c = comment('foo\nbar', reformat=False) self.assertEqual(c.toString(container_type.DOCKER), '# foo\n# bar')
def test_comment(self): """Comment string specified""" c = comment('foo') self.assertEqual(c.toString(container_type.DOCKER), '# foo') self.assertEqual(c.toString(container_type.SINGULARITY), '# foo')
def test_empty(self): """No comment string specified""" c = comment() self.assertEqual(str(c), '')
def test_wrap(self): """Comment wrapping""" c = comment('foo\nbar') self.assertEqual(c.toString(container_type.DOCKER), '# foo bar')
def test_invalid_ctype(self): """Invalid container type specified Assumes default comment format.""" c = comment('foo') self.assertEqual(str(c), '# foo')
def test_empty_noreformat(self): """No comment string specified, reformatting disabled""" c = comment(reformat=False) self.assertEqual(str(c), '')
def test_comment_docker(self): """Comment string specified""" c = comment('foo') self.assertEqual(str(c), '# foo')
def test_comment_singularity(self): """Comment string specified""" c = comment('foo') self.assertEqual(str(c), '# foo')
def test_noreformat(self): """Disable reformatting""" c = comment('foo\nbar', reformat=False) self.assertEqual(str(c), '# foo\n# bar')
def test_wrap(self): """Comment wrapping""" c = comment('foo\nbar') self.assertEqual(str(c), '# foo bar')
def test_empty_noreformat(self): """No comment string specified, reformatting disabled""" c = comment(reformat=False) self.assertEqual(c.toString(container_type.DOCKER), '')