Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dedal
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Platform
EBRAINS Software Distribution
dedal
Commits
98dfa98b
Commit
98dfa98b
authored
3 months ago
by
Eric Müller
Browse files
Options
Downloads
Patches
Plain Diff
draft: split out source fetcher
parent
f962e489
No related branches found
No related tags found
No related merge requests found
Pipeline
#56503
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/yashchiki/utils/fetch_sources.sh
+47
-0
47 additions, 0 deletions
share/yashchiki/utils/fetch_sources.sh
with
47 additions
and
0 deletions
share/yashchiki/utils/fetch_sources.sh
0 → 100755
+
47
−
0
View file @
98dfa98b
#!/bin/bash
set
-euo
pipefail
shopt
-s
inherit_errexit
# TODO:
# expects active environment
(
specfile
=
"./env_specfile.yaml"
;
# TODO: expects loaded env
spack spec
-y
>
"
${
specfile
}
"
)
&&
echo
"done."
||
(
echo
"FAILED."
;
exit
1
)
fetch_specfiles
=()
fetch_specfiles_cache
=()
# spack fetch doesn't like proper multi-doc separators (---)
csplit
-z
--prefix
=
env_specfile_split
--suffix-format
=
%02d.yaml ./env_specfile.yaml /---/
'{*}'
for
split_specfile
in
./env_specfile_split
*
.yaml
;
do
fetch_specfiles+
=(
${
split_specfile
}
)
done
# multi-doc style for "normal" yaml parsing
fetch_specfiles_cache+
=(
"./env_specfile.yaml"
)
missing_paths
=()
if
[
-n
"
${
CACHE_SOURCE_TYPE
:-}
"
]
;
then
if
[
${
CACHE_SOURCE_TYPE
}
!=
"oci"
]
;
then
echo
"Unknown cache type"
exit
1
fi
for
fetch_specfile
in
"
${
fetch_specfiles_cache
[@]
}
"
;
do
raw_paths
=
$(
PATH
=
${
MY_SPACK_FOLDER
}
/bin:
$PATH
${
MY_SPACK_PYTHON
}
${
YASHCHIKI_HOME
}
/lib/yashchiki/specfile_storage_path.py
${
fetch_specfile
}
)
fetch_paths
=(
${
raw_paths
}
)
pushd
${
YASHCHIKI_CACHES_ROOT
}
/download_cache
for
fetch_path
in
"
${
fetch_paths
[@]
}
"
;
do
# FIXME: gitlab env vars!
oras pull
${
HARBOR_HOST
}
/
${
HARBOR_PROJECT
}
/source_cache:
$(
basename
${
fetch_path
}
)
2>&1
&&
ret
=
$?
||
ret
=
$?
if
[
${
ret
}
-ne
0
]
;
then
missing_paths+
=(
"
${
fetch_path
}
"
)
fi
done
popd
done
echo
"Missing source cache entries:
${
missing_paths
[@]
}
"
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment