How to use hpccm - 10 common examples

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 / test / test_baseimage.py View on Github external
def test_arch_nonexistent(self):
        """Base image CPU architecture specification"""
        b = baseimage(image='foo', _arch='nonexistent')
        self.assertEqual(hpccm.config.g_cpu_arch, cpu_arch.X86_64)
github NVIDIA / hpc-container-maker / test / test_shell.py View on Github external
def test_apptest_singularity(self):
        """test option"""
        cmds = ['a', 'b', 'c']
        s = shell(commands=cmds, _app='foo', chdir=False, _test=True)
        self.assertEqual(str(s), '%apptest foo\n    a\n    b\n    c')
github NVIDIA / hpc-container-maker / test / test_environment.py View on Github external
def test_single_docker(self):
        """Single environment variable specified"""
        e = environment(variables={'A': 'B'}, _export=False)
        self.assertEqual(str(e), 'ENV A=B')
github NVIDIA / hpc-container-maker / test / test_environment.py View on Github external
def test_single_export_docker(self):
        """Single environment variable specified"""
        e = environment(variables={'A': 'B'})
        self.assertEqual(str(e), 'ENV A=B')
github NVIDIA / hpc-container-maker / test / test_environment.py View on Github external
def test_appenv_multiple_singularity(self):
        """Multiple app-specific environment variables specified"""
        e = environment(variables={'ONE': 1, 'TWO': 2, 'THREE': 3},
                        _app='foo')
        self.assertEqual(str(e),
'''%appenv foo
    export ONE=1
github NVIDIA / hpc-container-maker / test / test_copy.py View on Github external
def test_merge_file_singularity(self):
        """merge primitives"""
        c = []
        c.append(copy(src='a', dest='A'))
        c.append(copy(src='b', dest='B'))

        merged = c[0].merge(c)
        self.assertEqual(str(merged), '%files\n    a A\n    b B')
github NVIDIA / hpc-container-maker / test / test_copy.py View on Github external
def test_multiple_docker(self):
        """Multiple source files specified"""
        c = copy(src=['a1', 'a2', 'a3'], dest='b')
        self.assertEqual(str(c), 'COPY a1 \\\n    a2 \\\n    a3 \\\n    b/')
github NVIDIA / hpc-container-maker / test / test_copy.py View on Github external
def test_appfiles_files_singularity(self):
        """Pairs of app-specific files specified"""
        c = copy(files={'a1': 'b1', 'a2': 'b2', 'a3': 'b3'}, _app='foo')
        self.assertEqual(str(c),
                         '%appfiles foo\n    a1 b1\n    a2 b2\n    a3 b3')
github NVIDIA / hpc-container-maker / test / test_copy.py View on Github external
def test_appfiles_multiple_singularity(self):
        """Multiple app-specific source files specified"""
        c = copy(src=['a1', 'a2', 'a3'], dest='b', _app='foo')
        self.assertEqual(str(c),
                         '%appfiles foo\n    a1 b\n    a2 b\n    a3 b')
github NVIDIA / hpc-container-maker / test / test_copy.py View on Github external
def test_invalid_ctype(self):
        """Invalid container type specified"""
        c = copy(src='a', dest='b')
        with self.assertRaises(RuntimeError):
            str(c)