summaryrefslogtreecommitdiff
path: root/.devcontainer/postCreateCommand.sh
diff options
context:
space:
mode:
authorWouter Deconinck <wdconinc@gmail.com>2024-03-26 21:13:32 -0500
committerGitHub <noreply@github.com>2024-03-26 21:13:32 -0500
commit6c912b30a2b7c3cc13878ca7ab385d88636f239b (patch)
tree6af6183c837484acbc109ead624cb0d015df7c5c /.devcontainer/postCreateCommand.sh
parentf4da453f6b512dd98c3d9046272596c8f0909a32 (diff)
downloadspack-6c912b30a2b7c3cc13878ca7ab385d88636f239b.tar.gz
spack-6c912b30a2b7c3cc13878ca7ab385d88636f239b.tar.bz2
spack-6c912b30a2b7c3cc13878ca7ab385d88636f239b.tar.xz
spack-6c912b30a2b7c3cc13878ca7ab385d88636f239b.zip
Codespaces support for rapid PR evaluation (#41901)
* Create devcontainer.json * Ensure codespace can be setup for current branch * fix: find compilers in site scope * fix: use cloud_pipelines ubuntu20.04 image * fix: spack config --scope site add * fix: use develop, not develop-root mirror
Diffstat (limited to '.devcontainer/postCreateCommand.sh')
-rwxr-xr-x.devcontainer/postCreateCommand.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh
new file mode 100755
index 0000000000..e319719a37
--- /dev/null
+++ b/.devcontainer/postCreateCommand.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Load spack environment at terminal startup
+cat <<EOF >> /root/.bashrc
+. /workspaces/spack/share/spack/setup-env.sh
+EOF
+
+# Load spack environment in this script
+. /workspaces/spack/share/spack/setup-env.sh
+
+# Ensure generic targets for maximum matching with buildcaches
+spack config --scope site add "packages:all:require:[target=x86_64_v3]"
+spack config --scope site add "concretizer:targets:granularity:generic"
+
+# Find compiler and install gcc-runtime
+spack compiler find --scope site
+
+# Setup buildcaches
+spack mirror add --scope site develop https://binaries.spack.io/develop
+spack buildcache keys --install --trust