Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eic_container
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
Container registry
Model registry
Operate
Environments
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
containers
eic_container
Commits
9934ff84
Commit
9934ff84
authored
2 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
feat: install environment and push to buildcache with Makefile
parent
a1561165
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
containers/jug/dev.Dockerfile
+1
-67
1 addition, 67 deletions
containers/jug/dev.Dockerfile
spack-environment/Makefile
+29
-0
29 additions, 0 deletions
spack-environment/Makefile
with
30 additions
and
67 deletions
containers/jug/dev.Dockerfile
+
1
−
67
View file @
9934ff84
...
...
@@ -104,73 +104,7 @@ RUN rm -r /usr/local \
&&
cd
/opt/spack-environment
\
&&
source
$SPACK_ROOT
/share/spack/setup-env.sh
\
&&
spack
env
activate
--dir
/opt/spack-environment/
${
ENV
}
\
&&
spack concretize
--fresh
## Now execute the main build (or fetch from cache if possible)
## note, no-check-signature is needed to allow the quicker signature-less
## packages from the internal (docker) buildcache
##
## Optional, nuke the buildcache after install, before (re)caching
## This is useful when going to completely different containers,
## or intermittently to keep the buildcache step from taking too much time
##
## Update the local build cache if needed. Consists of 3 steps:
## 1. Remove the eic-spack buildcache on S3
## 2. Get a list of all packages, and compare with what is already on
## the buildcache (using package hash)
## 3. Add packages that need to be added to buildcache if any
RUN
--mount
=
type
=
cache,target
=
/var/cache/spack-mirror,sharing
=
locked
\
cd
/opt/spack-environment
\
&&
source
$SPACK_ROOT
/share/spack/setup-env.sh
\
&&
spack
env
activate
--dir
/opt/spack-environment/
${
ENV
}
\
&&
status
=
0
\
&&
spack
install
-j64
--no-check-signature
\
||
spack
install
-j64
--no-check-signature
\
||
spack
install
-j64
--no-check-signature
--show-log-on-error
\
||
status
=
$?
\
&&
spack mirror
rm
--scope
site eic-spack
\
&&
[
-z
"
${
CACHE_NUKE
}
"
]
\
||
rm
-rf
/var/cache/spack-mirror/build_cache/
*
\
&&
mkdir
-p
/var/cache/spack-mirror/build_cache
\
&&
spack buildcache update-index
-d
/var/cache/spack-mirror
\
&&
spack buildcache list
--allarch
--very-long
\
|
sed
'/^$/d;/^--/d;s/@.\+//;s/\([a-z0-9]*\) \(.*\)/\2\/\1/'
\
|
sort
>
buildcache.local.txt
\
&&
spack find
--format
{
name
}
/
{
hash
}
|
sort
\
|
comm
-23
- buildcache.local.txt
\
| xargs
--verbose
--no-run-if-empty
\
spack buildcache create
--allow-root
--only
package
--unsigned
\
--directory
/var/cache/spack-mirror
\
--rebuild-index
\
&&
spack clean
-a
\
&&
exit
$status
## Update the S3 build cache (without local cache mount)
ARG
S3RW_ACCESS_KEY=""
ARG
S3RW_SECRET_KEY=""
RUN
cd
/opt/spack-environment
\
&&
source
$SPACK_ROOT
/share/spack/setup-env.sh
\
&&
spack
env
activate
--dir
/opt/spack-environment/
${
ENV
}
\
&&
if
[
-n
"
${
S3RW_ACCESS_KEY
}
"
]
;
then
\
spack mirror add
--scope
site
\
--s3-endpoint-url
https://eics3.sdcc.bnl.gov:9000
\
--s3-access-key-id
"
${
S3RW_ACCESS_KEY
}
"
\
--s3-access-key-secret
"
${
S3RW_SECRET_KEY
}
"
\
eic-spack s3://eictest/EPIC/spack
\
&&
spack mirror list
\
&&
spack buildcache list
--allarch
--very-long
\
|
sed
'/^$/d;/^--/d;s/@.\+//;s/\([a-z0-9]*\) \(.*\)/\2\/\1/'
\
|
sort
>
buildcache.eic-spack.txt
\
&&
spack find
--format
{
name
}
/
{
hash
}
|
sort
\
|
comm
-23
- buildcache.eic-spack.txt
\
| xargs
--verbose
--no-run-if-empty
\
spack buildcache create
--allow-root
--only
package
--unsigned
\
--mirror-name
eic-spack
\
&&
spack buildcache update-index
--mirror-url
eic-spack
\
&&
spack mirror
rm
--scope
site eic-spack
\
;
fi
\
&&
spack mirror list
&&
make
-C
/opt/spack-environment
BUILDCACHE
=
/var/cache/spack-mirror
## Extra post-spack steps:
## - Python packages
...
...
This diff is collapsed.
Click to expand it.
spack-environment/Makefile
0 → 100644
+
29
−
0
View file @
9934ff84
SPACK
?=
spack
SPACK_INSTALL_FLAGS
+=
--no-check-signature
BUILDCACHE
:=
$(
SPACK_ENV
)
/cache
.PHONY
:
all clean
all
:
push
ifeq
(,$(filter clean,$(MAKECMDGOALS)))
include
${SPACK_ENV}/spack.mk
endif
${SPACK_ENV}/push
:
$(addprefix ${SPACK_ENV}/push/
,
$(SPACK_PACKAGE_IDS))
$(SPACK)
buildcache
update-index
--directory
$(BUILDCACHE)
${SPACK_ENV}/push/%
:
${SPACK_ENV}/install/%
@mkdir
-p
$(
dir
$@
)
$(
foreach
buildcache,
$(
BUILDCACHE
)
,
$(
SPACK
)
buildcache create
--allow-root
--only
=
package
--unsigned
$(
buildcache
)
/
$(
HASH
);)
@touch
$@
${SPACK_ENV}/spack.lock
:
${SPACK_ENV}/spack.yaml
$(SPACK)
concretize
--force
${SPACK_ENV}/spack.mk
:
${SPACK_ENV}/spack.lock
$(SPACK)
env
depfile
--output
$@
--make-target-prefix
""
clean
:
rm
-rf
${SPACK_ENV}/spack.lock
${SPACK_ENV}/spack.mk
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