From 64913af04a78e5cb33516f66cca0e8efe919b95c Mon Sep 17 00:00:00 2001 From: Teodor Nikolov Date: Tue, 18 Jan 2022 11:59:09 +0100 Subject: New package: Sarus (#28349) And tini --- .../repos/builtin/packages/rapidjson/package.py | 35 +++++-- var/spack/repos/builtin/packages/sarus/package.py | 111 +++++++++++++++++++++ var/spack/repos/builtin/packages/tini/package.py | 18 ++++ .../packages/tini/tini_static_rpath_issue.patch | 13 +++ 4 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 var/spack/repos/builtin/packages/sarus/package.py create mode 100644 var/spack/repos/builtin/packages/tini/package.py create mode 100644 var/spack/repos/builtin/packages/tini/tini_static_rpath_issue.patch diff --git a/var/spack/repos/builtin/packages/rapidjson/package.py b/var/spack/repos/builtin/packages/rapidjson/package.py index a7558b2797..22bcb1c92f 100644 --- a/var/spack/repos/builtin/packages/rapidjson/package.py +++ b/var/spack/repos/builtin/packages/rapidjson/package.py @@ -10,18 +10,35 @@ class Rapidjson(CMakePackage): """A fast JSON parser/generator for C++ with both SAX/DOM style API""" homepage = "https://rapidjson.org" - url = "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" - - version('1.1.0', sha256='bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e') - version('1.0.2', sha256='c3711ed2b3c76a5565ee9f0128bb4ec6753dbcc23450b713842df8f236d08666') - version('1.0.1', sha256='a9003ad5c6384896ed4fd1f4a42af108e88e1b582261766df32d717ba744ee73') - version('1.0.0', sha256='4189b32b9c285f34b37ffe4c0fd5627c1e59c2444daacffe5a96fdfbf08d139b') + url = "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" + + version( + "1.2.0-2021-08-13", + git="https://github.com/Tencent/rapidjson.git", + commit="00dbcf2c6e03c47d6c399338b6de060c71356464", + ) + version( + "1.1.0", + sha256="bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e", + ) + version( + "1.0.2", + sha256="c3711ed2b3c76a5565ee9f0128bb4ec6753dbcc23450b713842df8f236d08666", + ) + version( + "1.0.1", + sha256="a9003ad5c6384896ed4fd1f4a42af108e88e1b582261766df32d717ba744ee73", + ) + version( + "1.0.0", + sha256="4189b32b9c285f34b37ffe4c0fd5627c1e59c2444daacffe5a96fdfbf08d139b", + ) # released versions compile with -Werror and fail with gcc-7 # branch-fall-through warnings - patch('0001-turn-off-Werror.patch') + patch("0001-turn-off-Werror.patch", when="@1.0.0:1.1.0") - patch('arm.patch', when='@1.1.0 target=aarch64: %gcc@:5.9') + patch("arm.patch", when="@1.1.0 target=aarch64: %gcc@:5.9") # Not correspond to define '-march=native' with Fujitsu compiler. - patch('remove_march.patch', when='%fj') + patch("remove_march.patch", when="%fj") diff --git a/var/spack/repos/builtin/packages/sarus/package.py b/var/spack/repos/builtin/packages/sarus/package.py new file mode 100644 index 0000000000..9afe4a4955 --- /dev/null +++ b/var/spack/repos/builtin/packages/sarus/package.py @@ -0,0 +1,111 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import llnl.util.tty as tty + +from spack import * + + +class Sarus(CMakePackage): + """Sarus is an OCI-compliant container engine for HPC systems.""" + + homepage = "https://github.com/eth-cscs/sarus" + url = "https://github.com/eth-cscs/sarus/archive/1.3.3.tar.gz" + git = "https://github.com/eth-cscs/sarus.git" + maintainers = ["Madeeks", "teonnik"] + + version("develop", branch="develop") + version("master", branch="master") + version( + "1.4.0", + sha256="59cdb957bcf34b5f85999165986c0b45e9694facfb851f6504ec1fa1c7d77221", + ) + version( + "1.3.3", + sha256="792741601ef4b8aa60f55a698f7e08fd510786f636d42285ddcbe659a914fe66", + ) + version( + "1.3.2", + sha256="94d571c3eab7df195c17387818c6f652a6b2301a4e56081aaea74d4d19a4bd07", + ) + version( + "1.3.1", + sha256="7809f4ecf6d65cd5791b74cd296da407d68a2e6fbc319e1af9c0d33c2830d979", + ) + version( + "1.3.0", + sha256="3f11b3bd58c44d165762bff5e53b081e729486df98f4fe6fecde104e21eab131", + ) + version( + "1.2.0", + sha256="c5eca12e4cf96ab586401546d932afb33952d60b10048ff7382526a7ac8fe591", + ) + version( + "1.1.0", + sha256="79f3d3e0eef94c42a0356a012291afb42d79cc09f5d92dc241d9a8c743cfae83", + ) + version( + "1.0.1", + sha256="6422805a496a738f43f137291761ca21c1e46303b2eea0777f36d3dbcbc622fa", + ) + version( + "1.0.0", + sha256="b08f26b8249a064d6a45d935b96efc04e25070a03ac8002d0e427da0598d51fc", + ) + + variant( + "ssh", + default=False, + description="Build and install the SSH hook and custom SSH software " + "to enable connections inside containers." + "Requires a static version of the glibc libraries " + "(including libcrypt) to be available on the system", + ) + + depends_on("expat", type="build") + depends_on("squashfs", type=("build", "run")) + depends_on("boost@1.65.0: cxxstd=11") + depends_on("cpprestsdk@2.10.0:") + depends_on("libarchive@3.4.1:") + depends_on("rapidjson@1.2.0-2021-08-13", type="build") + depends_on("runc") + depends_on("tini") + + # autoconf is required to build Dropbear for the SSH hook + depends_on("autoconf", type="build") + + # Python 3 is used to run integration tests + depends_on("python@3:", type="test", when="@develop") + + def cmake_args(self): + spec = self.spec + args = [ + "-DCMAKE_TOOLCHAIN_FILE=./cmake/toolchain_files/gcc.cmake", + "-DENABLE_SSH=%s" % ("+ssh" in spec), + ] + return args + + def install(self, spec, prefix): + with working_dir(self.build_directory): + make(*self.install_targets) + mkdirp(prefix.var.OCIBundleDir) + + @run_after("install") + def build_perms_script(self): + script_sh = join_path(self.spec.prefix, "configure_installation.sh") + tty.warn( + """ + To complete Sarus's configuration: + + 1. Make sure sarus and its dependencies (tini, squashfs) are in PATH, for example do `spack load sarus`. + 2. Execute the script {} with root privileges. + + The script generates a basic working configuration. For more details: + + https://sarus.readthedocs.io/en/stable/config/basic_configuration.html + """.format( + script_sh + ) + ) diff --git a/var/spack/repos/builtin/packages/tini/package.py b/var/spack/repos/builtin/packages/tini/package.py new file mode 100644 index 0000000000..4219938961 --- /dev/null +++ b/var/spack/repos/builtin/packages/tini/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack import * + + +class Tini(CMakePackage): + """A tiny but valid `init` for containers""" + + homepage = "https://github.com/krallin/tini" + url = "https://github.com/krallin/tini/archive/refs/tags/v0.19.0.tar.gz" + maintainers = ["teonnik", "Madeeks"] + + version('0.19.0', sha256='0fd35a7030052acd9f58948d1d900fe1e432ee37103c5561554408bdac6bbf0d') + patch('tini_static_rpath_issue.patch', when='@0.19.0:') diff --git a/var/spack/repos/builtin/packages/tini/tini_static_rpath_issue.patch b/var/spack/repos/builtin/packages/tini/tini_static_rpath_issue.patch new file mode 100644 index 0000000000..de83da4e1f --- /dev/null +++ b/var/spack/repos/builtin/packages/tini/tini_static_rpath_issue.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 332b361..2c14a55 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,7 +82,7 @@ include_directories ("${PROJECT_BINARY_DIR}") + add_executable (tini src/tini.c) + + add_executable (tini-static src/tini.c) +-set_target_properties (tini-static PROPERTIES LINK_FLAGS "-Wl,--no-export-dynamic -static") ++set_target_properties (tini-static PROPERTIES LINK_FLAGS "-Wl,--no-export-dynamic -static" INSTALL_RPATH "" BUILD_RPATH "") + + # Installation + install (TARGETS tini DESTINATION bin) -- cgit v1.2.3-70-g09d2