Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hartmut/ebrains-spack-builds
  • filippomarchetti/ebrains-spack-builds
  • woodman/ebrains-spack-builds
  • ri/tech-hub/platform/esd/ebrains-spack-builds
  • ri/tech-hub/platform/esd/ebrains-spack-builds-lab-testing
  • hl11/ebrains-spack-builds
  • ansimsek/ebrains-spack-builds
  • deepu/ebrains-spack-builds
  • lcalori0/ebrains-spack-builds
  • ziaee/ebrains-spack-builds
  • noelp/ebrains-spack-builds
  • jkaiser/ebrains-spack-builds
  • mloshakov/ebrains-spack-builds
  • dsegebarth/ebrains-spack-builds
  • lupoc/ebrains-spack-builds
  • dsegebarth/ebrains-spack-builds-na-3
  • rshimoura/ebrains-spack-builds
  • kozlov/ebrains-spack-builds
  • rominabaila/ebrains-spack-builds
  • willemw/ebrains-spack-builds
20 results
Show changes
Commits on Source (398)
Showing
with 917 additions and 401 deletions
This diff is collapsed.
### Summary
| | |
|---------------|----------------------------------------|
| Package | <!-- Spack package name --> |
| Contact point | <!-- maintainer GitLab handle --> |
| KG entry | <!-- insert link --> |
### Checks
<!-- please download the EBRAINS Software Quality checklist, fill it and replace the file below -->
* [ ] Software Quality Checklist: [SQ-Checklist.pdf](https://drive.ebrains.eu/d/6061531326d048308823/files/?p=%2FSQ-Checklist.pdf) (level: <!-- passing, silver, gold -->)
* [ ] Current maintainer is listed first in `package.py`
* [ ] No pinned dependency versions
* [ ] Post-installation tests are defined
\ No newline at end of file
### Summary
| | |
|---------------|----------------------------------------|
| Package | <!-- Spack package name --> |
| Version added | <!-- version number --> |
| Contact point | <!-- maintainer GitLab handle --> |
| KG entry | <!-- insert link --> |
### Checks
<!-- please download the EBRAINS Software Quality checklist, fill it and replace the file below -->
* [ ] Software Quality Checklist: [SQ-Checklist.pdf](https://drive.ebrains.eu/d/6061531326d048308823/files/?p=%2FSQ-Checklist.pdf) (level: <!-- passing, silver, gold -->)
* [ ] Current maintainer is listed first in `package.py`
* [ ] No pinned dependency versions
* [ ] Post-installation tests are defined
\ No newline at end of file
[submodule "vendor/spack"]
path = vendor/spack
url = https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/spack.git
shallow = true
[submodule "vendor/yashchiki"]
path = vendor/yashchiki
url = https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/dedal
shallow = true
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MIT License
Copyright (c) 2013-2023 LLNS, LLC and other Spack Project Developers.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
...@@ -35,12 +35,12 @@ To install the EBRAINS Spack environment on a new machine, it is recommended to ...@@ -35,12 +35,12 @@ To install the EBRAINS Spack environment on a new machine, it is recommended to
Clone this repository. You can use the `ebrains-yy-mm` branches to install the EBRAINS official releases, the `experimental-rel` branch for the experimental release, or the `master` branch for the latest state: Clone this repository. You can use the `ebrains-yy-mm` branches to install the EBRAINS official releases, the `experimental-rel` branch for the experimental release, or the `master` branch for the latest state:
``` ```
git clone --branch {branch-name} https://gitlab.ebrains.eu/technical-coordination/project-internal/devops/platform/ebrains-spack-builds.git git clone --branch {branch-name} https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
``` ```
Clone Spack. We currently use version v0.20.0: Clone Spack. We currently use version v0.23.1:
``` ```
git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch v0.20.0 https://github.com/spack/spack git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch v0.23.1 https://github.com/spack/spack
``` ```
Activate Spack: Activate Spack:
...@@ -53,11 +53,6 @@ Add the project repository to your Spack environment: ...@@ -53,11 +53,6 @@ Add the project repository to your Spack environment:
spack repo add ebrains-spack-builds spack repo add ebrains-spack-builds
``` ```
Create the environment:
```
spack env create -d ebrains-spack-builds/
```
Define your site-specific configurations: Define your site-specific configurations:
``` ```
export SYSTEMNAME=<your-system-name> export SYSTEMNAME=<your-system-name>
...@@ -73,4 +68,4 @@ spack install --fresh ...@@ -73,4 +68,4 @@ spack install --fresh
## Troubleshooting ## Troubleshooting
If you encounter any issues with installing, testing, or using the EBRAINS Spack environment or a specific package, please [open an issue](https://gitlab.ebrains.eu/technical-coordination/project-internal/devops/platform/ebrains-spack-builds/-/issues/new) using the provided templates, or contact the Technical Coordination team directly. If you encounter any issues with installing, testing, or using the EBRAINS Spack environment or a specific package, please [open an issue](https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds/-/issues/new) using the provided templates, or contact the Technical Coordination team directly.
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
# loaded by all users. # loaded by all users.
# =========================================================================================================== # ===========================================================================================================
set -euo pipefail
INSTALLATION_ROOT=$1 INSTALLATION_ROOT=$1
EBRAINS_SPACK_ENV=$2 EBRAINS_SPACK_ENV=$2
RELEASE_NAME=$3 RELEASE_NAME=$3
...@@ -35,12 +37,17 @@ cp $INSTALLATION_ROOT/spack/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.s ...@@ -35,12 +37,17 @@ cp $INSTALLATION_ROOT/spack/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.s
# and the location of python modules installed in the base docker Collab image # and the location of python modules installed in the base docker Collab image
cat <<EOF >> $KERNEL_PATH/bin/env.sh cat <<EOF >> $KERNEL_PATH/bin/env.sh
export PATH=\$PATH:/opt/app-root/src/.local/bin export PATH=\$PATH:/opt/app-root/src/.local/bin
export PYTHONPATH=\$PYTHONPATH:/opt/app-root/src/.local/lib/python3.8/site-packages:/usr/local/lib/python3.8/dist-packages export PYTHONPATH=\$PYTHONPATH:/opt/conda/lib/python3.11/site-packages
export R_LIBS_USER=/opt/app-root/src/.local/lib/R/site-library export R_LIBS_USER=/opt/app-root/src/.local/lib/R/site-library
mkdir -p \$R_LIBS_USER mkdir -p \$R_LIBS_USER
export R_LIBS=\$R_LIBS_USER:\$R_LIBS export R_LIBS=\$R_LIBS_USER:\$R_LIBS
EOF EOF
# ... and set the SYSTEMNAME env var, to use Spack commands inside the kernel
cat <<EOF >> $KERNEL_PATH/bin/env.sh
export SYSTEMNAME=ebrainslab
EOF
# (4) create startup script for python kernel # (4) create startup script for python kernel
cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_python.sh cat $KERNEL_PATH/bin/env.sh > $KERNEL_PATH/bin/env_python.sh
echo "python -m ipykernel_launcher -f \$@" >> $KERNEL_PATH/bin/env_python.sh echo "python -m ipykernel_launcher -f \$@" >> $KERNEL_PATH/bin/env_python.sh
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
# =========================================================================================================== # ===========================================================================================================
# title : create_job.sh # title : create_job.sh
# usage : ./create_job.sh $OC_JOB_ID $BUILD_ENV_DOCKER_IMAGE $OP $INSTALLATION_ROOT $SPACK_VERSION # usage : ./create_job.sh $OC_JOB_ID $BUILD_ENV_DOCKER_IMAGE $INSTALLATION_ROOT
# $SPACK_ENV $BRANCH $RELEASE_NAME $LAB_KERNEL_ROOT # $SPACK_ENV $COMMIT_SHA $RELEASE_NAME $LAB_KERNEL_ROOT
# description : creates OKD job yaml file that builds/updates spack environment and creates Lab kernel # description : creates OKD job yaml file that builds/updates spack environment and creates Lab kernel
# =========================================================================================================== # ===========================================================================================================
OC_JOB_ID=$1 OC_JOB_ID=$1
BUILD_ENV_DOCKER_IMAGE=$2 BUILD_ENV_DOCKER_IMAGE=$2
OP=$3 INSTALLATION_ROOT=$3
INSTALLATION_ROOT=$4 EBRAINS_SPACK_ENV=$4
SPACK_VERSION=$5 COMMIT_SHA=$5
SPACK_ENV=$6 RELEASE_NAME=$6
BRANCH=$7 LAB_KERNEL_ROOT=$7
RELEASE_NAME=$8 UPDATE_SPACK_OCI_CACHES=$8
LAB_KERNEL_ROOT=$9 OCI_CACHE_PREFIX=$9
cat <<EOT >> simplejob.yml cat <<EOT >> simplejob.yml
apiVersion: batch/v1 apiVersion: batch/v1
...@@ -34,26 +34,77 @@ spec: ...@@ -34,26 +34,77 @@ spec:
- name: simplejob - name: simplejob
image: ${BUILD_ENV_DOCKER_IMAGE} image: ${BUILD_ENV_DOCKER_IMAGE}
imagePullPolicy: Always imagePullPolicy: Always
resources:
limits:
cpu: '8'
memory: '32Gi'
requests:
cpu: '4'
memory: '20Gi'
volumeMounts: volumeMounts:
- name: sharedbin - name: sharedbin
mountPath: /srv mountPath: /srv
command: ["/usr/local/bin/deploy-build-env.sh", "$OP", "$INSTALLATION_ROOT", "$SPACK_VERSION", "$SPACK_ENV", "$BRANCH", "$RELEASE_NAME", "$LAB_KERNEL_ROOT"] - name: tmp
mountPath: /tmp
command:
- /bin/bash
- -c
- |
# create root dir if it doesn't exist
mkdir -p \$INSTALLATION_ROOT
# reset spack repository dir by cloning the selected version
if [ ! -d \$EBRAINS_REPO_PATH ]; then git clone ${CI_PROJECT_URL} --recurse-submodules \$EBRAINS_REPO_PATH; fi
cd \$EBRAINS_REPO_PATH
git fetch origin
git reset --hard \$COMMIT_SHA
git submodule update --force
# reset build error log dir (delete previous logs to save space)
rm -rf \$BUILD_LOGS_DIR
mkdir -p \$BUILD_LOGS_DIR
cd \$BUILD_LOGS_DIR
# run installation script
bash \$EBRAINS_REPO_PATH/install_spack_env.sh \$SPACK_JOBS \$INSTALLATION_ROOT \$EBRAINS_REPO_PATH \$EBRAINS_SPACK_ENV "" \$UPDATE_SPACK_OCI_CACHES \$OCI_CACHE_PREFIX
if [ \$? -eq 0 ]
then
# build process succeeded - create or update kernel on the NFS based on the current spack environment
bash \$EBRAINS_REPO_PATH/create_JupyterLab_kernel.sh \$INSTALLATION_ROOT \$EBRAINS_SPACK_ENV \$RELEASE_NAME \$LAB_KERNEL_ROOT && exit 0
else
# build process failed - keep spack build logs and fail the pipeline
cp -r /tmp/spack/spack-stage/* \$BUILD_LOGS_DIR
exit 1
fi
env: env:
- name: SYSTEMNAME - name: SYSTEMNAME
value: ebrainslab value: ebrainslab
- name: GITLAB_USER - name: INSTALLATION_ROOT
valueFrom: value: $INSTALLATION_ROOT
secretKeyRef: - name: EBRAINS_SPACK_ENV
name: spack-repo-gitlab-token value: $EBRAINS_SPACK_ENV
key: username - name: UPDATE_SPACK_OCI_CACHES
- name: GITLAB_TOKEN value: '$UPDATE_SPACK_OCI_CACHES'
valueFrom: - name: OCI_CACHE_PREFIX
secretKeyRef: value: $OCI_CACHE_PREFIX
name: spack-repo-gitlab-token - name: COMMIT_SHA
key: password value: $COMMIT_SHA
- name: RELEASE_NAME
value: $RELEASE_NAME
- name: LAB_KERNEL_ROOT
value: $LAB_KERNEL_ROOT
- name: BUILD_LOGS_DIR
value: /srv/build_logs/$EBRAINS_SPACK_ENV
- name: EBRAINS_REPO_PATH
value: $INSTALLATION_ROOT/ebrains-spack-builds
- name: SPACK_JOBS
value: '6'
volumes: volumes:
- name: sharedbin - name: sharedbin
persistentVolumeClaim: persistentVolumeClaim:
claimName: shared-binaries claimName: shared-binaries
- name: tmp
emptyDir: {}
restartPolicy: Never restartPolicy: Never
EOT EOT
#!/bin/bash
# ===========================================================================================================
# title : create_job_widget_script.sh
# usage : ./create_job_widget_script.sh $OC_JOB_ID $RUN_ENV_DOCKER_IMAGE $INSTALLATION_ROOT
# $SPACK_ENV $RELEASE_NAME $LAB_KERNEL_ROOT
# description : creates job file that generates a script to load the jupyter extensions for a given env
# ===========================================================================================================
OC_JOB_ID=$1
RUN_ENV_DOCKER_IMAGE=$2
INSTALLATION_ROOT=$3
EBRAINS_SPACK_ENV=$4
RELEASE_NAME=$5
LAB_KERNEL_ROOT=$6
cat <<EOT >> widget-script.yml
apiVersion: batch/v1
kind: Job
metadata:
name: widget-script${OC_JOB_ID}
spec:
parallelism: 1
completions: 1
backoffLimit: 0
template:
spec:
containers:
- name: widget-script
image: ${RUN_ENV_DOCKER_IMAGE}
imagePullPolicy: Always
resources:
limits:
cpu: '1'
memory: '1Gi'
requests:
cpu: '0.5'
memory: '500Mi'
volumeMounts:
- name: sharedbin
mountPath: /srv
command:
- /bin/bash
- -c
- |
. \$INSTALLATION_ROOT/spack/share/spack/setup-env.sh
spack env activate --without-view \$EBRAINS_SPACK_ENV
KERNEL_PATH=\$LAB_KERNEL_ROOT/\$(echo "\$RELEASE_NAME" | tr '[:upper:]' '[:lower:]')
spack load --sh --first clb-nb-utils py-pip py-tvb-ext-bucket py-tvb-ext-unicore py-tvb-ext-xircuits > \$KERNEL_PATH/bin/widget_activation.sh
env:
- name: SYSTEMNAME
value: ebrainslab
- name: SPACK_DISABLE_LOCAL_CONFIG
value: "true"
- name: INSTALLATION_ROOT
value: "$INSTALLATION_ROOT"
- name: EBRAINS_SPACK_ENV
value: "$EBRAINS_SPACK_ENV"
- name: RELEASE_NAME
value: "$RELEASE_NAME"
- name: LAB_KERNEL_ROOT
value: "$LAB_KERNEL_ROOT"
volumes:
- name: sharedbin
persistentVolumeClaim:
claimName: shared-binaries
restartPolicy: Never
EOT
#!/bin/bash #!/bin/bash
# =============================================================================================================================== # =========================================================================================================================================
# title : install_spack_env.sh # title : install_spack_env.sh
# usage : ./install_spack_env.sh $INSTALLATION_ROOT $SPACK_VERSION $EBRAINS_REPO $EBRAINS_SPACK_ENV $UPSTREAM_INSTANCE # usage : ./install_spack_env.sh $SPACK_JOBS $INSTALLATION_ROOT $EBRAINS_REPO $EBRAINS_SPACK_ENV $UPSTREAM_INSTANCE \
# $UPDATE_SPACK_OCI_CACHES $OCI_CACHE_PREFIX
# description : installs or updates the spack environment defined in the EBRAINS spack repo # description : installs or updates the spack environment defined in the EBRAINS spack repo
# (if the specified spack instance doesn't exist, it also creates it) # (if the specified spack instance doesn't exist, it also creates it)
# =============================================================================================================================== # =========================================================================================================================================
INSTALLATION_ROOT=$1 # where to set up the installation set -eo pipefail
SPACK_VERSION=$2 # which spack version to use
SPACK_JOBS=$1 # number of jobs
INSTALLATION_ROOT=$2 # where to set up the installation
EBRAINS_REPO=$3 # location of ebrains-spack-builds repository EBRAINS_REPO=$3 # location of ebrains-spack-builds repository
EBRAINS_SPACK_ENV=$4 # name of EBRAINS Spack environment to be created/updated EBRAINS_SPACK_ENV=$4 # name of EBRAINS Spack environment to be created/updated
UPSTREAM_INSTANCE=$5 # path to Spack instance to use as upstream (optional) UPSTREAM_INSTANCE=$5 # path to Spack instance to use as upstream (optional)
UPDATE_SPACK_OCI_CACHES=$6 # "true" enables updating the OCI cache for spack sources and build results
export OCI_CACHE_PREFIX=$7
# make sure spack uses the symlinked folder as path
export CI_SPACK_ROOT=${INSTALLATION_ROOT}/spack
# specify location of .spack dir (by default in ~) # disable local configuration and cache directories
# this is where cache and configuration settings are stored export SPACK_DISABLE_LOCAL_CONFIG=true
export SPACK_USER_CACHE_PATH=$INSTALLATION_ROOT/spack/.spack export SPACK_USER_CACHE_PATH=/tmp/spack
export SPACK_USER_CONFIG_PATH=$INSTALLATION_ROOT/spack/.spack
# define SYSTEMNAME variable in sites where it's not already defined # define SYSTEMNAME variable in sites where it's not already defined
export SYSTEMNAME=${SYSTEMNAME:-${HPC_SYSTEM:-$BSC_MACHINE}} export SYSTEMNAME=${SYSTEMNAME:-${HPC_SYSTEM:-$BSC_MACHINE}}
# initial setup: clone spack if spack dir doesn't already exist # cache related variables
if [ ! -d $INSTALLATION_ROOT/spack ] export CACHE_SPECFILE=${CACHE_SPECFILE:-"env_specfile.yaml"}
then export YASHCHIKI_HOME=${EBRAINS_REPO}/vendor/yashchiki
git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $INSTALLATION_ROOT/spack export SPACK_CACHE_SOURCE=${SPACK_CACHE_SOURCE:-${CI_SPACK_ROOT}/var/spack/cache}
# SPACK PATCH: the post-build logs on install-time-test-logs.txt gets ovewritten by the post-install logs. export SPACK_CACHE_BUILD=${SPACK_CACHE_BUILD:-${CI_SPACK_ROOT}/var/spack/cache}
# quick fix for that: (TODO: investigate more and open PR)
sed -i "s/self.file_like, \"w\"/self.file_like, \"a\"/g" $INSTALLATION_ROOT/spack/lib/spack/llnl/util/tty/log.py if [ ! -d ${INSTALLATION_ROOT} ]; then
mkdir -p ${INSTALLATION_ROOT}
fi fi
if [[ $UPSTREAM_INSTANCE ]] # initial setup: use spack submodule if spack dir doesn't already exist
then SPACK_ROOT_EXISTED=1
cat <<EOF > $INSTALLATION_ROOT/spack/etc/spack/defaults/upstreams.yaml if [ ! -d ${CI_SPACK_ROOT} ]; then
upstreams: ln -s ${EBRAINS_REPO}/vendor/spack ${CI_SPACK_ROOT}
upstream-spack-instance: SPACK_ROOT_EXISTED=0
install_tree: $UPSTREAM_INSTANCE/spack/opt/spack
EOF
fi fi
# activate Spack # activate Spack
source $INSTALLATION_ROOT/spack/share/spack/setup-env.sh source ${CI_SPACK_ROOT}/share/spack/setup-env.sh
if [[ $UPSTREAM_INSTANCE ]]; then
UPSTREAM_PREFIX=$(find $UPSTREAM_INSTANCE/spack/opt/spack/ -type d -name ".spack-db" 2>/dev/null | xargs -I {} dirname {})
spack config add upstreams:upstream-spack-instance:install_tree:$UPSTREAM_PREFIX
fi
if [ "${SPACK_ROOT_EXISTED}" -eq 0 ]; then
# for caching purposes it's nice if we can relocate into long paths, but we
# can't do that for existing installations -> else path
# ECM (2025-01-23) true seems to yield too large paths for some packages (e.g., gcc)
spack config add config:install_tree:padded_length:128
fi
# add repo if it does not exist # add repo if it does not exist
if [[ ! $(spack repo list | grep ebrains-spack-builds$) ]] if [[ ! $(spack repo list | grep ebrains-spack-builds$) ]]
...@@ -48,37 +66,119 @@ then ...@@ -48,37 +66,119 @@ then
spack repo add $EBRAINS_REPO spack repo add $EBRAINS_REPO
fi fi
# install platform compiler (extract version from packages.yaml) # make sure all fetching/clingo stuff happens before anything else
if [ $SYSTEMNAME == ebrainslab ] spack spec aida
then
EBRAINS_SPACK_COMPILER=$(grep 'compiler' $EBRAINS_REPO/site-config/$SYSTEMNAME/packages.yaml | awk -F'[][]' '{ print $2 }') # rebuild spack's database (could be an debugging session)
spack compiler find spack reindex
spack load $EBRAINS_SPACK_COMPILER || { spack install $EBRAINS_SPACK_COMPILER; spack load $EBRAINS_SPACK_COMPILER; }
# add local mirror if it does not exist
if [[ ! $(spack mirror list | grep local_cache) ]]; then
# TODO for newer spack versions, add: --autopush --unsigned, drop create cache command below
# (Note: spack expects `build_cache/` below the folder we specify here
spack mirror add local_cache ${SPACK_CACHE_BUILD}
fi fi
spack compiler find spack compiler find
# create environment if it does not exist # create environment if it does not exist
if [ ! -d "$SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV" ] if [ ! -d "${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV" ]
then then
spack env create $EBRAINS_SPACK_ENV spack env create $EBRAINS_SPACK_ENV
fi fi
# update environment site-configs # update environment site-configs
rm -rf $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/site-config && cp -r $EBRAINS_REPO/site-config $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV rm -rf ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV/site-config && cp -r $EBRAINS_REPO/site-config ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV
# update spack.yaml: merge top-level and site-specific spack.yaml files # update spack.yaml: merge top-level and site-specific spack.yaml files
spack-python $EBRAINS_REPO/site-config/ymerge.py $EBRAINS_REPO/spack.yaml $EBRAINS_REPO/site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml spack-python $EBRAINS_REPO/site-config/ymerge.py $EBRAINS_REPO/spack.yaml $EBRAINS_REPO/site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml
cp /tmp/spack.yaml $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/ cp /tmp/spack.yaml ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV/
# There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies
# for installation tests. The workaround suggested in the issue is to NOT concretize separately, but simply
# remove the .lock file and let the environment be concretized by the spack install command:
rm $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.lock || echo "No spack.lock file"
# activate environment # activate environment
spack env activate $EBRAINS_SPACK_ENV spack env activate --without-view $EBRAINS_SPACK_ENV
spack concretize --force --fresh --test root
# dump dag to file
spack spec -y > "${CACHE_SPECFILE}"
if [ -n "${OCI_CACHE_PREFIX}" ]; then
# fetch missing sources (if packages not yet installed)
python3 ${YASHCHIKI_HOME}/fetch_cached_sources.py \
--local-cache=${SPACK_CACHE_SOURCE} \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/source_cache \
--yashchiki-home=${YASHCHIKI_HOME} \
/tmp/missing_paths_sources.dat ${CACHE_SPECFILE}
# fetch missing build results (if packages not yet installed)
python3 ${YASHCHIKI_HOME}/fetch_cached_buildresults.py \
--local-cache=${SPACK_CACHE_BUILD}/build_cache \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/build_cache \
--yashchiki-home=${YASHCHIKI_HOME} \
/tmp/missing_paths_buildresults.dat ${CACHE_SPECFILE}
fi
spack-python -c "exit(not len(spack.environment.active_environment().uninstalled_specs()))" && (
# fetch all sources but delay exit code handling
spack fetch --dependencies --missing && ret=$? || ret=$?;
if [ -n "${OCI_CACHE_PREFIX}" ] && [ "${UPDATE_SPACK_OCI_CACHES:-false}" = "true" ]; then
# push freshly fetched sources to remote cache
echo "Performing update of the source cache"
python3 ${YASHCHIKI_HOME}/update_cached_sources.py \
--local-cache=${SPACK_CACHE_SOURCE} \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/source_cache \
/tmp/missing_paths_sources.dat;
else
echo "Updating of the source cache disabled."
fi
# if [ "$ret" -ne 0 ]; then
# (exit $ret)
# fi
)
if [ -n "${OCI_CACHE_PREFIX}" ]; then
# record the state of installed/uninstalled packages before actually installing them
dag_hashes_pre_install=$(spack-python ${YASHCHIKI_HOME}/specfile_dag_hash.py ${CACHE_SPECFILE})
fi
# install the environment, use 2 jobs to reduce the amount of required RAM # install the environment, use 2 jobs to reduce the amount of required RAM
spack install -y -j2 --fresh --test root # delay exit code until we have updated the cache below
spack install --no-check-signature -y -j$SPACK_JOBS --fresh --test root && spack_install_ret=$? || spack_install_ret=$?
# no need to update the local cache nor the remote cache if we don't want to update
if [ -n "${OCI_CACHE_PREFIX}" ] && [ "${UPDATE_SPACK_OCI_CACHES:-false}" = "true" ]; then
# push previously missing (but now installed) packages to the local cache
for dag_hash in $dag_hashes_pre_install; do
spack buildcache create --unsigned --only package ${SPACK_CACHE_BUILD} /${dag_hash} && ret=$? || ret=$?
if [ $ret -ne 0 ]; then
echo "Failed to push ${dag_hash}, trying to call spack find on it:"
spack find -Lvp /${dag_hash} || true
fi
done
# upload packages from local to remote cache
echo "Performing update of the build cache"
python3 ${YASHCHIKI_HOME}/update_cached_buildresults.py \
--local-cache=${SPACK_CACHE_BUILD}/build_cache \
--remote-cache-type=oci \
--remote-cache=${OCI_CACHE_PREFIX}/build_cache \
/tmp/missing_paths_buildresults.dat
else
echo "Updating of the build cache disabled."
fi
# propagate spack install exit code
if [ $spack_install_ret -ne 0 ]; then
(exit "$spack_install_ret")
fi
# remove local cache content
if [ -d ${SPACK_CACHE_BUILD} ]; then
spack mirror destroy --mirror-name local_cache
fi
# TODO: when using spack remote OCI build caches require an index file
#spack mirror add ebrains oci://docker-registry.ebrains.eu/esd/build_cache
#spack buildcache list -a ebrains && ret=$? || ret=$?
# rebuild spack's database # rebuild spack's database
spack reindex spack reindex
...@@ -87,7 +187,7 @@ spack reindex ...@@ -87,7 +187,7 @@ spack reindex
# this needs deactivating the environment first: # this needs deactivating the environment first:
spack env deactivate spack env deactivate
unset SPACK_LD_LIBRARY_PATH unset SPACK_LD_LIBRARY_PATH
spack env activate --sh $EBRAINS_SPACK_ENV > $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh spack env activate --sh $EBRAINS_SPACK_ENV > ${CI_SPACK_ROOT}/var/spack/environments/$EBRAINS_SPACK_ENV/load_env.sh
# create modules files with spack # create modules files with spack
# spack module tcl refresh -y # spack module tcl refresh -y
......
from spack import * # Copyright 2013-2024 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 Acpype(PythonPackage): class Acpype(PythonPackage):
"""A tool based in Python to use Antechamber to generate topologies for chemical """A tool based in Python to use Antechamber to generate topologies for chemical
......
from spack import * # Copyright 2013-2024 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)
class Ambertools (CMakePackage): from spack.package import *
"""AmberTools is a free, useful standalone package and a prerequisite for installing Amber itself.
The AmberTools suite is free of charge, and its components are mostly released under the GNU General Public License (GPL).
A few components are included that are in the public domain or which have other, open-source, licenses.
The libsander and libpbsa libraries use the LGPL license."""
# Set the homepage and download url
homepage = "http://ambermd.org/AmberTools.php"
url = "http://ambermd.org/downloads/AmberTools22jlmrcc.tar.bz2"
# Set the gitlab accounts of this package maintainers class Ambertools(CMakePackage):
maintainers = ['dbeltran', 'elmath'] """AmberTools is a free, useful standalone package and a prerequisite
for installing Amber itself. The AmberTools suite is free of charge,
and its components are mostly released under the GNU General Public
License (GPL). A few components are included that are in the public
domain or which have other, open-source, licenses. The libsander and
libpbsa libraries use the LGPL license."""
version('22jlmrcc', sha256='1571d4e0f7d45b2a71dce5999fa875aea8c90ee219eb218d7916bf30ea229121') homepage = "https://ambermd.org/AmberTools.php"
url = "https://ambermd.org/downloads/AmberTools22jlmrcc.tar.bz2"
# Dependencies maintainers("d-beltran")
depends_on("flex", type="build") # This is necessary for sure (experimentally tested)
depends_on("bison", type="build") # This is necessary for sure (experimentally tested)
depends_on("tcsh", type="build")
depends_on("zlib", type=("build", "run"))
depends_on("bzip2", type=("build", "run"))
depends_on("blas", type=("build", "run"))
depends_on("lapack", type=("build", "run"))
depends_on("arpack-ng", type=("build", "run"))
depends_on("netcdf-c", type=("build", "run"))
depends_on("netcdf-fortran", type=("build", "run"))
depends_on("fftw", type=("build", "run"))
depends_on("readline", type=("build", "run"))
depends_on("netlib-xblas~plain_blas", type=("build", "run"))
# specific variants needed for boost - from the build log "Could NOT find Boost (missing: thread system program_options iostreams regex timer chrono filesystem graph)"
depends_on("boost+thread+system+program_options+iostreams+regex+timer+chrono+filesystem+graph", type=("build", "run"))
# begin EBRAINS (added): add version
version("23_rc6", sha256="debb52e6ef2e1b4eaa917a8b4d4934bd2388659c660501a81ea044903bf9ee9d")
# end EBRAINS
version("22jlmrcc", sha256="1571d4e0f7d45b2a71dce5999fa875aea8c90ee219eb218d7916bf30ea229121")
depends_on("flex", type="build")
depends_on("bison", type="build")
depends_on("tcsh", type="build")
depends_on("zlib", type=("build", "run"))
depends_on("bzip2", type=("build", "run"))
depends_on("blas", type=("build", "run"))
depends_on("lapack", type=("build", "run"))
depends_on("arpack-ng", type=("build", "run"))
depends_on("netcdf-c", type=("build", "run"))
depends_on("netcdf-fortran", type=("build", "run"))
depends_on("fftw", type=("build", "run"))
depends_on("readline", type=("build", "run"))
depends_on("netlib-xblas~plain_blas", type=("build", "run"))
# Specific variants needed for boost according to build logs
depends_on(
"boost+thread+system+program_options+iostreams+regex+timer+chrono+filesystem+graph",
type=("build", "run"),
)
# Python dependencies # Python dependencies
# WARNING: If a python 3.8 version is already installed in spack then the '+tkinter' variant makes spack ignore the version # begin EBRAINS (modified): add version
# WARNING: Spack may try to install the preferred python version (i.e. python 3.10.8) depends_on("python@3.8:3.10 +tkinter", type=("build", "run"), when="@22jlmrcc")
# WARNING: The soultion is uninstall python and reinstall with this variant depends_on("python@3.8: +tkinter", type=("build", "run"), when="@23_rc6")
depends_on('python@3.8: +tkinter', type=('build', 'run')) # end EBRAINS
depends_on("py-numpy", type=("build", "run")) depends_on("py-setuptools", type="build")
depends_on("py-matplotlib", type=("build", "run")) depends_on("py-numpy", type=("build", "run"))
depends_on("py-scipy", type=("build", "run")) depends_on("py-matplotlib", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
def cmake_args(self): def cmake_args(self):
# Translated from ambertools build/run_cmake script # Translated from ambertools build/run_cmake script
# We also add the TRUST_SYSTEM_LIBS argument that is mentioned in the ambertools CMake guide # We also add the TRUST_SYSTEM_LIBS argument mentioned in the ambertools guide
# https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Guide-to-Options # https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Guide-to-Options
args = [ args = [
self.define("COMPILER", "GNU"), self.define("COMPILER", "GNU"),
...@@ -53,9 +64,9 @@ class Ambertools (CMakePackage): ...@@ -53,9 +64,9 @@ class Ambertools (CMakePackage):
self.define("DOWNLOAD_MINICONDA", False), self.define("DOWNLOAD_MINICONDA", False),
self.define("TRUST_SYSTEM_LIBS", True), self.define("TRUST_SYSTEM_LIBS", True),
# This is to avoid the x11 (X11_Xext_LIB) error # This is to avoid the x11 (X11_Xext_LIB) error
# It is equivalent to the '-noX11' flag accoridng to the docs: # It is equivalent to the "-noX11" flag accoridng to the docs:
# https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Common-Options # https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Common-Options
self.define("BUILD_GUI", False) self.define("BUILD_GUI", False),
] ]
return args return args
...@@ -67,7 +78,17 @@ class Ambertools (CMakePackage): ...@@ -67,7 +78,17 @@ class Ambertools (CMakePackage):
env.set("AMBER_PREFIX", self.prefix) env.set("AMBER_PREFIX", self.prefix)
env.set("AMBERHOME", self.prefix) env.set("AMBERHOME", self.prefix)
@run_after('install') @run_after("install")
@on_package_attributes(run_tests=True) @on_package_attributes(run_tests=True)
def check_install(self): def check_install(self):
make("test.serial") make("test.serial")
# Temporarily copy netcdf.h header file to netcdf-fortran/include to pass the Ambertools
# cmake check (quickest fix, will probably cause problems, needs to change)
@run_before("cmake")
def fix_check(self):
cp = Executable("cp")
cp(
self.spec["netcdf-c"].headers.directories[0] + "/netcdf.h",
self.spec["netcdf-fortran"].headers.directories[0],
)
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
from spack import *
class Apbs(CMakePackage): class Apbs(CMakePackage):
...@@ -39,9 +38,9 @@ class Apbs(CMakePackage): ...@@ -39,9 +38,9 @@ class Apbs(CMakePackage):
depends_on('boost', type=('build', 'run')) depends_on('boost', type=('build', 'run'))
depends_on('blas', type=('build', 'run')) depends_on('blas', type=('build', 'run'))
depends_on('arpack-ng', type=('build', 'run')) depends_on('arpack-ng', type=('build', 'run'))
depends_on('suite-sparse+tbb', type=('build', 'run')) depends_on('suite-sparse', type=('build', 'run'))
depends_on('maloc', type=('build', 'run')) depends_on('maloc', type=('build', 'run'))
depends_on('python@3.8:3.10', type=('build', 'run')) depends_on('python@3.8:3.11', type=('build', 'run'))
def cmake_args(self): def cmake_args(self):
# Min and max Python versions need to be set as variables to pass tests. # Min and max Python versions need to be set as variables to pass tests.
......
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
...@@ -13,10 +13,15 @@ class Arbor(CMakePackage, CudaPackage): ...@@ -13,10 +13,15 @@ class Arbor(CMakePackage, CudaPackage):
homepage = "https://arbor-sim.org" homepage = "https://arbor-sim.org"
git = "https://github.com/arbor-sim/arbor.git" git = "https://github.com/arbor-sim/arbor.git"
url = "https://github.com/arbor-sim/arbor/releases/download/v0.9.0/arbor-v0.9.0-full.tar.gz" url = "https://github.com/arbor-sim/arbor/releases/download/v0.9.0/arbor-v0.9.0-full.tar.gz"
maintainers = ["thorstenhater", "brenthuisman", "haampie"] maintainers = ("thorstenhater", "ErbB4", "haampie")
version("master", branch="master") version("master", branch="master", submodules=True)
version("develop") version("develop", branch="master", submodules=True)
version(
"0.10.0",
sha256="72966b7a2f45ce259b8ba167ca3e4f5ab9f212136a300267aaac0c04ed3fe3fc",
url="https://github.com/arbor-sim/arbor/releases/download/v0.10.1/arbor-v0.10.0-full.tar.gz",
)
version( version(
"0.9.0", "0.9.0",
sha256="5f9740955c821aca81e23298c17ad64f33f635756ad9b4a0c1444710f564306a", sha256="5f9740955c821aca81e23298c17ad64f33f635756ad9b4a0c1444710f564306a",
...@@ -75,36 +80,50 @@ class Arbor(CMakePackage, CudaPackage): ...@@ -75,36 +80,50 @@ class Arbor(CMakePackage, CudaPackage):
conflicts("%cce@:9.1") conflicts("%cce@:9.1")
conflicts("%intel") conflicts("%intel")
depends_on("cmake@3.19:", type="build") # begin EBRAINS (modified: added run dep)
depends_on("cmake@3.19:", type=("build", "run"))
# end EBRAINS
# misc dependencies # misc dependencies
depends_on("fmt@7.1:", when="@0.5.3:") # required by the modcc compiler depends_on("fmt@7.1:", when="@0.5.3:") # required by the modcc compiler
depends_on("fmt@9.1:", when="@0.7.1:") depends_on("fmt@9.1:", when="@0.7.1:")
depends_on("googletest@1.12.1", when="@0.7.1:") # begin EBRAINS (modified: relaxed (upstream gave no info about update))
# upstream adds: depends_on("fmt@10.1:", when="@0.9.1:")
depends_on("googletest@1.12.1:", when="@0.7.1:")
depends_on("pugixml@1.11:", when="@0.7.1:") depends_on("pugixml@1.11:", when="@0.7.1:")
depends_on("nlohmann-json@3.11.2") # upstream adds: depends_on("pugixml@1.13:", when="@0.9.1:")
depends_on("nlohmann-json@3.11.2:")
depends_on("random123") depends_on("random123")
#upstream adds: depends_on("random123@1.14.0:", when="@0.10:")
# end EBRAINS (modified)
with when("+cuda"): with when("+cuda"):
depends_on("cuda@10:") depends_on("cuda@10:")
depends_on("cuda@11:", when="@0.7.1:") depends_on("cuda@11:", when="@0.7.1:")
depends_on("cuda@12:", when="@0.9.1:")
# mpi # mpi
depends_on("mpi", when="+mpi") # begin EBRAINS (modified: added run dep)
depends_on("mpi", when="+mpi", type=("build", "run"))
# end EBRAINS (modified)
depends_on("py-mpi4py", when="+mpi+python", type=("build", "run")) depends_on("py-mpi4py", when="+mpi+python", type=("build", "run"))
# python (bindings) # python (bindings)
extends("python", when="+python")
depends_on("python@3.7:", when="+python", type=("build", "run"))
depends_on("py-numpy", when="+python", type=("build", "run"))
with when("+python"): with when("+python"):
extends("python")
depends_on("python@3.7:", type=("build", "run"))
depends_on("python@3.9:", when="@0.9.1:", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))
depends_on("py-pybind11@2.6:", type="build") depends_on("py-pybind11@2.6:", type="build")
depends_on("py-pybind11@2.8.1:", when="@0.5.3:", type="build") depends_on("py-pybind11@2.8.1:", when="@0.5.3:", type="build")
depends_on("py-pybind11@2.10.1:", when="@0.7.1:", type="build") depends_on("py-pybind11@2.10.1:", when="@0.7.1:", type="build")
depends_on("py-pandas", type="test")
depends_on("py-seaborn", type="test")
# sphinx based documentation # sphinx based documentation
depends_on("python@3.7:", when="+doc", type="build") with when("+doc"):
depends_on("py-sphinx", when="+doc", type="build") depends_on("python@3.10:", type="build")
depends_on("py-svgwrite", when="+doc", type="build") depends_on("py-sphinx", type="build")
depends_on("py-svgwrite", type="build")
@property @property
def build_targets(self): def build_targets(self):
...@@ -124,10 +143,14 @@ class Arbor(CMakePackage, CudaPackage): ...@@ -124,10 +143,14 @@ class Arbor(CMakePackage, CudaPackage):
# query spack for the architecture-specific compiler flags set by its wrapper # query spack for the architecture-specific compiler flags set by its wrapper
args.append("-DARB_ARCH=none") args.append("-DARB_ARCH=none")
opt_flags = self.spec.target.optimization_flags( opt_flags = spack.build_environment.optimization_flags(
self.spec.compiler.name, self.spec.compiler.version self.compiler, self.spec.target
) )
args.append("-DARB_CXX_FLAGS_TARGET=" + opt_flags) # Might return nothing
if opt_flags:
args.append("-DARB_CXX_FLAGS_TARGET=" + opt_flags)
# Needed, spack has no units package
args.append("-DARB_USE_BUNDLED_UNITS=ON")
return args return args
...@@ -135,3 +158,4 @@ class Arbor(CMakePackage, CudaPackage): ...@@ -135,3 +158,4 @@ class Arbor(CMakePackage, CudaPackage):
@on_package_attributes(run_tests=True) @on_package_attributes(run_tests=True)
def install_test(self): def install_test(self):
python("-c", "import arbor") python("-c", "import arbor")
python("python/example/single_cell_model.py")
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java
@@ -150,6 +150,13 @@
builder.put("PATH", null);
builder.put("LD_LIBRARY_PATH", null);
}
+
+ Map<String, String> spackEnv = System.getenv();
+ for (String envName : spackEnv.keySet()) {
+ if (envName.startsWith("SPACK_")) {
+ builder.put(envName, spackEnv.get(envName));
+ }
+ }
}
private static PathFragment determineShellExecutable(OS os, PathFragment fromOption) {
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
@@ -168,6 +168,13 @@ public class BazelRuleClassProvider {
env.put("PATH", null);
}
+ Map<String, String> spackEnv = System.getenv();
+ for (String envName : spackEnv.keySet()) {
+ if (envName.startsWith("SPACK_")) {
+ env.put(envName, spackEnv.get(envName));
+ }
+ }
+
// Shell environment variables specified via options take precedence over the
// ones inherited from the fragments. In the long run, these fragments will
// be replaced by appropriate default rc files anyway.
From 9c9d27561780bc56d9f0867e325c7421a94ee1cb Mon Sep 17 00:00:00 2001
From: Harsh Bhatia <bhatia4@llnl.gov>
Date: Tue, 15 Dec 2020 15:56:10 -0800
Subject: [PATCH] https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0
---
src/conditions/BUILD | 6 ++++++
third_party/BUILD | 8 ++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/conditions/BUILD b/src/conditions/BUILD
index 2b28e28057..faa41a439d 100644
--- a/src/conditions/BUILD
+++ b/src/conditions/BUILD
@@ -10,6 +10,12 @@ filegroup(
visibility = ["//src:__pkg__"],
)
+config_setting(
+ name = "linux_ppc",
+ values = {"cpu": "ppc"},
+ visibility = ["//visibility:public"],
+)
+
config_setting(
name = "linux_x86_64",
values = {"cpu": "k8"},
diff --git a/third_party/BUILD b/third_party/BUILD
index 159006d741..4fcae54c00 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -523,12 +523,13 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({
"//src/conditions:darwin": "*.so *.dll",
"//src/conditions:darwin_x86_64": "*.so *.dll",
"//src/conditions:linux_x86_64": "*.jnilib *.dll",
+ "//src/conditions:linux_ppc": "*.so *.jnilib *.dll",
# The .so file is an x86 one, so we can just remove it if the CPU is not x86
"//src/conditions:arm": "*.so *.jnilib *.dll",
"//src/conditions:linux_aarch64": "*.so *.jnilib *.dll",
# Play it safe -- better have a big binary than a slow binary
# zip -d does require an argument. Supply something bogus.
- "//conditions:default": "*.bogusextension",
+ "//conditions:default": "",
})
# Remove native libraries that are for a platform different from the one we are
@@ -537,7 +538,10 @@ genrule(
name = "filter_netty_dynamic_libs",
srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"],
outs = ["netty_tcnative/netty-tcnative-filtered.jar"],
- cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES,
+ cmd = "cp $< $@ && " +
+ # End successfully if there is nothing to be deleted from the archive
+ "if [ -n '" + UNNECESSARY_DYNAMIC_LIBRARIES + "' ]; then " +
+ "zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + "; fi",
)
java_import(
--
2.21.0 (Apple Git-122.2)
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -173,8 +173,19 @@
else:
inc_dirs = result.stderr[index1 + 1:index2].strip()
- return [repository_ctx.path(_cxx_inc_convert(p))
- for p in inc_dirs.split("\n")]
+ default_inc_directories = [
+ repository_ctx.path(_cxx_inc_convert(p))
+ for p in inc_dirs.split("\n")
+ ]
+
+ env = repository_ctx.os.environ
+ if "SPACK_INCLUDE_DIRS" in env:
+ for path in env["SPACK_INCLUDE_DIRS"].split(":"):
+ default_inc_directories.append(
+ repository_ctx.path(_cxx_inc_convert(path))
+ )
+
+ return default_inc_directories
def _add_option_if_supported(repository_ctx, cc, option):
"""Checks that `option` is supported by the C compiler."""
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -200,8 +200,19 @@
else:
inc_dirs = result.stderr[index1 + 1:index2].strip()
- return [_escape_string(repository_ctx.path(_cxx_inc_convert(p)))
- for p in inc_dirs.split("\n")]
+ default_inc_directories = [
+ _escape_string(repository_ctx.path(_cxx_inc_convert(p)))
+ for p in inc_dirs.split("\n")
+ ]
+
+ env = repository_ctx.os.environ
+ if "SPACK_INCLUDE_DIRS" in env:
+ for path in env["SPACK_INCLUDE_DIRS"].split(":"):
+ default_inc_directories.append(
+ repository_ctx.path(_cxx_inc_convert(path))
+ )
+
+ return default_inc_directories
def _add_option_if_supported(repository_ctx, cc, option):