How to use the hpccm.primitives.comment.comment function in hpccm

To help you get started, we’ve selected a few hpccm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NVIDIA / hpc-container-maker / hpccm / building_blocks / cgns.py View on Github external
def runtime(self, _from='0'):
        """Generate the set of instructions to install the runtime specific
        components from a build in a previous stage.

        # Example

        ```python
        c = cgns(...)
        Stage0 += c
        Stage1 += c.runtime()
        ```
        """
        self.rt += comment('CGNS')
        self.rt += packages(ospackages=self.__runtime_ospackages)
        self.rt += self.__bb.runtime(_from=_from)
        return str(self.rt)
github NVIDIA / hpc-container-maker / hpccm / building_blocks / amgx.py View on Github external
# Setup build configuration
        self.__bb = generic_cmake(
            annotations={'branch': self.__branch},
            base_annotation=self.__class__.__name__,
            branch=self.__branch,
            comment=False,
            cmake_opts=self.__cmake_opts,
            devel_environment=self.environment_variables,
            prefix=self.__prefix,
            runtime_environment=self.environment_variables,
            repository=self.__repository,
            **kwargs)

        # Container instructions
        self += comment('AMGX branch {}'.format(self.__branch))
        self += packages(ospackages=self.__ospackages)
        self += self.__bb
github NVIDIA / hpc-container-maker / hpccm / building_blocks / conda.py View on Github external
def runtime(self, _from='0'):
        """Generate the set of instructions to install the runtime specific
        components from a build in a previous stage.

        # Examples

        ```python
        c = conda(...)
        Stage0 += c
        Stage1 += c.runtime()
        ```
        """
        self.rt += comment('Anaconda')
        self.rt += copy(_from=_from, src=self.__prefix, dest=self.__prefix)
        self.rt += shell(commands=[
            '{0} init'.format(
                posixpath.join(self.__prefix, 'bin', 'conda')),
            'ln -s {0} /etc/profile.d/conda.sh'.format(
                posixpath.join(self.__prefix, 'etc', 'profile.d',
                               'conda.sh'))])
        return str(self.rt)
github NVIDIA / hpc-container-maker / hpccm / building_blocks / slurm_pmi2.py View on Github external
self.__bb = generic_autotools(
            annotations={'version': self.__version},
            base_annotation=self.__class__.__name__,
            comment=False,
            devel_environment=self.environment_variables,
            environment=self.__environment,
            install=False,
            make=False,
            postconfigure=['make -C contribs/pmi2 install'],
            prefix=self.__prefix,
            runtime_environment=self.environment_variables,
            url='{0}/slurm-{1}.tar.bz2'.format(self.__baseurl, self.__version),
            **kwargs)

        # Container instructions
        self += comment('SLURM PMI2 version {}'.format(self.__version))
        self += packages(ospackages=self.__ospackages)
        self += self.__bb
github NVIDIA / hpc-container-maker / hpccm / building_blocks / hdf5.py View on Github external
# Setup build configuration
        self.__bb = generic_autotools(
            annotations={'version': self.__version},
            base_annotation=self.__class__.__name__,
            check=self.__check,
            configure_opts=self.__configure_opts,
            comment=False,
            devel_environment=self.environment_variables,
            prefix=self.__prefix,
            runtime_environment=self.environment_variables,
            url=self.__url,
            **kwargs)

        # Container instructions
        self += comment('HDF5 version {}'.format(self.__version))
        self += packages(ospackages=self.__ospackages)
        self += self.__bb
github NVIDIA / hpc-container-maker / hpccm / building_blocks / knem.py View on Github external
def runtime(self, _from='0'):
        """Generate the set of instructions to install the runtime specific
        components from a build in a previous stage.

        # Examples

        ```python
        k = knem(...)
        Stage0 += k
        Stage1 += k.runtime()
        ```
        """
        self.rt += comment('KNEM')
        self.rt += self.__bb.runtime(_from=_from)
        return str(self.rt)
github NVIDIA / hpc-container-maker / hpccm / building_blocks / generic_cmake.py View on Github external
def runtime(self, _from='0'):
        """Generate the set of instructions to install the runtime specific
        components from a build in a previous stage.

        # Examples

        ```python
        g = generic_cmake(...)
        Stage0 += g
        Stage1 += g.runtime()
        ```
        """
        if self.prefix:
            if self.__comment:
                if self.url:
                    self.rt += comment(self.url, reformat=False)
                elif self.repository:
                    self.rt += comment(self.repository, reformat=False)
            self.rt += copy(_from=_from, src=self.prefix, dest=self.prefix)
            if self.ldconfig:
                self.rt += shell(commands=[self.ldcache_step(
                    directory=posixpath.join(self.prefix, self.__libdir))])
            if self.runtime_environment_variables:
                self.rt += environment(
                    variables=self.environment_step(runtime=True))
            if self.annotate:
                self.rt += label(metadata=self.annotate_step())
            return str(self.rt)
        else: # pragma: no cover
            return
github NVIDIA / hpc-container-maker / hpccm / building_blocks / python.py View on Github external
def __instructions(self):
        """Fill in container instructions"""

        self += comment('Python')
        self += packages(apt=self.__debs, yum=self.__rpms)
        if self.__alternatives:
            alternatives = ['alternatives --set python /usr/bin/python2']
            if self.__devel:
                alternatives.append('alternatives --install /usr/bin/python-config python-config /usr/bin/python2-config 30')
            self += shell(commands=alternatives)
github NVIDIA / hpc-container-maker / hpccm / building_blocks / llvm.py View on Github external
def runtime(self, _from='0'):
        """Generate the set of instructions to install the runtime specific
        components from a build in a previous stage.

        # Examples

        ```python
        l = llvm(...)
        Stage0 += l
        Stage1 += l.runtime()
        ```
        """
        self.rt += comment('LLVM compiler runtime')
        if self.__runtime_ospackages:
            self.rt += packages(ospackages=self.__runtime_ospackages)
        self.rt += packages(apt=self.__runtime_debs,
                            apt_keys=self.__apt_keys,
                            apt_repositories=self.__apt_repositories,
                            scl=bool(self.__version), # True / False
                            yum=self.__runtime_rpms)
        return str(self.rt)
github NVIDIA / hpc-container-maker / hpccm / building_blocks / pgi.py View on Github external
def __instructions(self):
        """Fill in container instructions"""

        self += comment('PGI compiler version {}'.format(self.__version))
        if self.__tarball:
            # Use tarball from local build context
            self += copy(src=self.__tarball,
                         dest=posixpath.join(self.__wd,
                                             posixpath.basename(self.__tarball)))
        else:
            # Downloading, so need wget
            self.__ospackages.append('wget')
        if self.__ospackages:
            self += packages(ospackages=self.__ospackages)
        self += shell(commands=self.__commands)
        self += environment(variables=self.environment_step())