Skip to content
Snippets Groups Projects
Commit b50f6924 authored by Eleni Mathioulaki's avatar Eleni Mathioulaki
Browse files

Merge branch 'ray' into 'master'

Ray package for tvb-multiscale

See merge request technical-coordination/project-internal/devops/platform/ebrains-spack-builds!419
parents 50849de3 fc170a3a
No related branches found
No related tags found
No related merge requests found
# Copyright 2013-2023 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.package import *
class Libvips(AutotoolsPackage):
"""libvips is a demand-driven, horizontally threaded image processing
library. Compared to similar libraries, libvips runs quickly and uses
little memory."""
homepage = "https://libvips.github.io/libvips/"
url = "https://github.com/libvips/libvips/releases/download/v8.9.0/vips-8.9.0.tar.gz"
git = "https://github.com/libvips/libvips.git"
version("8.13.3", sha256="4eff5cdc8dbe1a05a926290a99014e20ba386f5dcca38d9774bef61413435d4c")
version("8.10.5", sha256="a4eef2f5334ab6dbf133cd3c6d6394d5bdb3e76d5ea4d578b02e1bc3d9e1cfd8")
version("8.9.1", sha256="45633798877839005016c9d3494e98dee065f5cb9e20f4552d3b315b8e8bce91")
version("8.9.0", sha256="97334a5e70aff343d2587f23cb8068fc846a58cd937c89a446142ccf00ea0349")
variant("fftw", default=True, description="Uses FFTW3 for fourier transforms.")
variant("jpeg", default=False, description="Enable JPEG support")
variant("tiff", default=False, description="Enable TIFF support")
variant("png", default=False, description="Enable pngfile support")
variant("poppler", default=False, description="Enable PDF rendering via poppler")
# TODO: Add more variants!
depends_on("glib")
depends_on("expat")
depends_on("fftw", when="+fftw")
depends_on("libjpeg", when="+jpeg")
depends_on("libtiff", when="+tiff")
depends_on("libpng", when="+png")
depends_on("poppler", when="+poppler")
# Copyright 2013-2023 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 os
import shutil
from spack.package import *
class Npm(Package):
"""npm: A package manager for javascript."""
homepage = "https://github.com/npm/cli"
# base https://www.npmjs.com/
git = "https://github.com/npm/cli.git"
url = "https://registry.npmjs.org/npm/-/npm-9.3.1.tgz"
version("9.3.1", sha256="41caa26a340b0562bc5429d28792049c980fe3e872b42b82cad94e8f70e37f40")
version("8.19.3", sha256="634bf4e0dc87be771ebf48a058629960e979a209c20a51ebdbc4897ca6a25260")
version("7.24.2", sha256="5b9eeea011f8bc3b76e55cc33339e87213800677f37e0756ad13ef0e9eaccd64")
version("6.14.18", sha256="c9b15f277e2a0b1b57e05bad04504296a27024555d56c2aa967f862e957ad2ed")
version(
"6.14.9",
sha256="1e0e880ce0d5adf0120fb3f92fc8e5ea5bac73681d37282615d074ff670f7703",
deprecated=True,
)
version(
"6.14.8",
sha256="fe8e873cb606c06f67f666b4725eb9122c8927f677c8c0baf1477f0ff81f5a2c",
deprecated=True,
)
version(
"6.13.7",
sha256="6adf71c198d61a5790cf0e057f4ab72c6ef6c345d72bed8bb7212cb9db969494",
deprecated=True,
)
version(
"6.13.4",
sha256="a063290bd5fa06a8753de14169b7b243750432f42d01213fbd699e6b85916de7",
deprecated=True,
)
version(
"3.10.9",
sha256="fb0871b1aebf4b74717a72289fade356aedca83ee54e7386e38cb51874501dd6",
deprecated=True,
)
version(
"3.10.5",
sha256="ff019769e186152098841c1fa6325e5a79f7903a45f13bd0046a4dc8e63f845f",
deprecated=True,
)
depends_on("node-js", type=("build", "run"))
depends_on("libvips")
# npm 6.13.4 ships with node-gyp 5.0.5, which contains several Python 3
# compatibility issues on macOS. Manually update to node-gyp 6.0.1 for
# full Python 3 support.
resource(
name="node-gyp",
destination="node-gyp",
url="https://registry.npmjs.org/node-gyp/-/node-gyp-6.0.1.tgz",
sha256="bbc0e137e17a63676efc97a0e3b1fcf101498a1c2c01c3341cd9491f248711b8",
when="@6",
)
resource(
name="env-paths",
destination="env-paths",
url="https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz",
sha256="168b394fbca60ea81dc84b1824466df96246b9eb4d671c2541f55f408a264b4c",
when="@6",
)
@when("@6")
def patch(self):
shutil.rmtree("node_modules/node-gyp")
install_tree("node-gyp/package", "node_modules/node-gyp")
filter_file(r'"node-gyp": "\^5\..*"', '"node-gyp": "^6.0.1"', "package.json")
install_tree("env-paths/package", "node_modules/env-paths")
@when("@:8")
def install(self, spec, prefix):
# `npm install .` doesn't work properly out of the box on npm up to 8, so we do
# what it would do manually. The only thing we seem to miss is docs. In
# particular, it will end up symlinking into the stage, which spack then
# deletes. You can avoid that with `npm install $(npm pack .)`, but `npm pack`
# also seems to fail when run from the tarball on macos. So we just copy manually.
to_install = [
"LICENSE",
"README.md",
"bin",
"docs",
"index.js",
"lib",
"node_modules",
"package.json",
]
mkdirp(prefix.bin)
mkdirp(prefix.lib.node_modules.npm)
# manually install all the files above (if they exist for a particular node version)
for filename in to_install:
if os.path.exists(filename):
install_fn = install if os.path.isfile(filename) else install_tree
install_fn(filename, os.path.join(prefix.lib.node_modules.npm, filename))
# set up symlinks in bin
node_modules_bin = os.path.relpath(prefix.lib.node_modules.npm.bin, prefix.bin)
symlink(os.path.join(node_modules_bin, "npm-cli.js"), prefix.bin.npm)
symlink(os.path.join(node_modules_bin, "npx-cli.js"), prefix.bin.npx)
@when("@9:")
def install(self, spec, prefix):
# in npm 9, `npm install .` finally works within the repo, so we can just call it.
node = which("node", required=True)
node("bin/npm-cli.js", "install", "-ddd", "--global", f"--prefix={prefix}", ".")
def setup_dependent_build_environment(self, env, dependent_spec):
npm_config_cache_dir = "%s/npm-cache" % dependent_spec.prefix
if not os.path.isdir(npm_config_cache_dir):
mkdirp(npm_config_cache_dir)
env.set("npm_config_cache", npm_config_cache_dir)
def setup_dependent_run_environment(self, env, dependent_spec):
npm_config_cache_dir = "%s/npm-cache" % dependent_spec.prefix
env.set("npm_config_cache", npm_config_cache_dir)
# Copyright 2013-2022 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.package import *
class PyRay(PythonPackage):
"""Ray provides a simple, universal API for building distributed applications."""
homepage = "https://github.com/ray-project/ray"
url = "https://github.com/ray-project/ray/archive/ray-0.8.7.tar.gz"
version("2.0.1", sha256="b8b2f0a99d2ac4c001ff11c78b4521b217e2a02df95fb6270fd621412143f28b")
version("0.8.7", sha256="2df328f1bcd3eeb4fa33119142ea0d669396f4ab2a3e78db90178757aa61534b")
variant("default", default=False, description="Install default extras", when="@2.0.1")
depends_on("python@3.6:3.10", when="@2.0.1", type=("build", "run"))
depends_on("python@3.6:3.8", when="@0.8.7", type=("build", "run"))
depends_on("bazel@4.2.2:", when="@2.0.1", type="build")
depends_on("bazel@3.2.0", when="@0.8.7", type="build")
depends_on("npm", type="build")
depends_on("py-setuptools", type="build")
depends_on("py-cython@0.29.26:", when="@2.0.1", type="build")
depends_on("py-cython@0.29.14:", when="@0.8.7", type="build")
depends_on("py-attrs", when="@2.0.1", type=("build", "run"))
depends_on("py-click@7:8.0.4", when="@2.0.1", type=("build", "run"))
depends_on("py-click@7.0:", when="@0.8.7", type=("build", "run"))
depends_on("py-dataclasses", when="@2.0.1 ^python@:3.6", type=("build", "run"))
depends_on("py-filelock", type=("build", "run"))
depends_on("py-grpcio@1.32:1.43.0", when="@2.0.1 ^python@:3.9", type=("build", "run"))
depends_on("py-grpcio@1.42:1.43.0", when="@2.0.1 ^python@3.10:", type=("build", "run"))
depends_on("py-grpcio@1.28.1:", when="@0.8.7", type=("build", "run"))
depends_on("py-jsonschema", type=("build", "run"))
depends_on("py-msgpack@1", type=("build", "run"))
depends_on("py-numpy@1.16:", when="^python@:3.8", type=("build", "run"))
depends_on("py-numpy@1.19.3:", when="^python@3.9:", type=("build", "run"))
depends_on("py-protobuf@3.15.3:3", when="@2.0.1", type=("build", "run"))
depends_on("py-protobuf@3.8.0:", when="@0.8.7", type=("build", "run"))
depends_on("py-pyyaml", type=("build", "run"))
depends_on("py-frozenlist", when="@2.0.1", type=("build", "run"))
depends_on("py-requests", type=("build", "run"))
depends_on("py-typing-extensions", when="@2.0.1 ^python@:3.7", type=("build", "run"))
depends_on("py-virtualenv", when="@2.0.1", type=("build", "run"))
with when("+default"):
depends_on("py-aiohttp@3.7:", type=("build", "run"))
depends_on("py-aiohttp-cors", type=("build", "run"))
depends_on("py-colorful", type=("build", "run"))
depends_on("py-py-spy@0.2:", type=("build", "run"))
depends_on("py-gpustat@1:", type=("build", "run"))
depends_on("py-opencensus", type=("build", "run"))
depends_on("py-pydantic", type=("build", "run"))
depends_on("py-prometheus-client@0.7.1:0.13", type=("build", "run"))
depends_on("py-smart-open", type=("build", "run"))
# Historical dependencies
with when("@0.8.7"):
depends_on("py-aiohttp", type=("build", "run"))
depends_on("py-aioredis", type=("build", "run"))
depends_on("py-colorama", type=("build", "run"))
depends_on("py-colorful", type=("build", "run"))
depends_on("py-google", type=("build", "run"))
depends_on("py-gpustat", type=("build", "run"))
depends_on("py-py-spy@0.2.0:", type=("build", "run"))
depends_on("py-redis@3.3.2:3.4", type=("build", "run"))
depends_on("py-opencensus", type=("build", "run"))
depends_on("py-prometheus-client@0.7.1:", type=("build", "run"))
# If not guarded by SKIP_THIRDPARTY_INSTALL, those dependencies
# would be automatically installed via pip by the setup.py script.
depends_on("py-setproctitle", type=("build", "run"))
depends_on("py-psutil", type=("build", "run"))
# If not detected during install, the following dependency would
# be automatically downloaded and installed by the setup.py script.
depends_on("py-pickle5", when="^python@:3.8.1", type=("build", "run"))
build_directory = "python"
def setup_build_environment(self, env):
env.set("SKIP_THIRDPARTY_INSTALL", "1")
# Compile the dashboard npm modules included in the project
@run_before("install")
def build_dashboard(self):
with working_dir(join_path("python", "ray", "dashboard", "client")):
npm = which("npm")
npm("ci")
npm("run", "build")
......@@ -34,7 +34,7 @@ class PyTvbMultiscale(PythonPackage):
depends_on('py-nestml', type=('build', 'run'))
depends_on('py-elephant', type=('build', 'run'))
depends_on('py-pyspike', type=('build', 'run'))
# TODO: depends_on('py-ray', type=('build', 'run'))
depends_on('py-ray', type=('build', 'run'))
# Test dependency
depends_on('py-pytest@:7.1', type='test')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment