Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2w
autoicon
Commits
1bc72701
Commit
1bc72701
authored
1 year ago
by
Fabian.Jakub
Browse files
Options
Downloads
Patches
Plain Diff
use mktemp file instead of a lock file around spack/upstreams
parent
ea767d8e
No related branches found
No related tags found
No related merge requests found
Pipeline
#18786
failed
1 year ago
Stage: everything
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platforms/common/spack_utils.sh
+6
-13
6 additions, 13 deletions
platforms/common/spack_utils.sh
with
6 additions
and
13 deletions
platforms/common/spack_utils.sh
+
6
−
13
View file @
1bc72701
...
...
@@ -6,26 +6,19 @@ function _install_spack() {
_init_spack
"
$SPACK_INIT_CMD
"
"
$SPACK_ROOT
"
# Adding a lock file to prevent race conditions.
UPSTREAMS_LOCK
=
${
SPACK_ROOT
}
/etc/spack/upstreams.lock
while
[
-f
"
${
UPSTREAMS_LOCK
}
"
]
;
do
sleep
1
done
if
[
!
-z
"
${
SPACK_UPSTREAMS
}
"
]
;
then
touch
${
UPSTREAMS_LOCK
}
UPSTREAMS_CONFIG
=
${
SPACK_ROOT
}
/etc/spack/upstreams.yaml
echo
"upstreams:"
>
$UPSTREAMS_CONFIG
tmpfile
=
$(
mktemp
)
echo
"upstreams:"
>
$tmpfile
i
=
0
for
UP
in
${
SPACK_UPSTREAMS
}
;
do
echo
"Adding upstream repo to config
$UPSTREAMS_CONFIG
<=
$UP
"
i
=
$((
i+1
))
cat
<<
EOF
>>
$UPSTREAMS_CONFIG
spack-instance-
$i
:
install_tree:
$UP
EOF
echo
" spack-instance-
$i
:"
>>
$tmpfile
echo
" install_tree:
$UP
"
>>
$tmpfile
done
r
m
$
{
UPSTREAMS_
LOCK
}
m
v
$tmpfile
$UPSTREAMS_
CONFIG
fi
if
[
!
-z
"
${
SPACK_EXTERNALS
}
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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