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
34718c2e
Commit
34718c2e
authored
2 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
feat: push build cache to eic-spack mirror on eics3
parent
20f4c8da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!436
feat: push build cache to eic-spack mirror on eics3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+4
-0
4 additions, 0 deletions
.gitlab-ci.yml
containers/jug/dev.Dockerfile
+36
-8
36 additions, 8 deletions
containers/jug/dev.Dockerfile
spack.yaml
+1
-0
1 addition, 0 deletions
spack.yaml
with
41 additions
and
8 deletions
.gitlab-ci.yml
+
4
−
0
View file @
34718c2e
...
...
@@ -275,6 +275,8 @@ jug_dev:default:
--build-arg EICSPACK_CHERRYPICKS="${EICSPACK_CHERRYPICKS}"
--build-arg S3_ACCESS_KEY="${S3_ACCESS_KEY}"
--build-arg S3_SECRET_KEY="${S3_SECRET_KEY}"
--build-arg S3RW_ACCESS_KEY="${S3RW_ACCESS_KEY}"
--build-arg S3RW_SECRET_KEY="${S3RW_SECRET_KEY}"
--build-arg CACHE_BUST=${PACKAGE_HASH}
--build-arg INTERNAL_TAG=${INTERNAL_TAG}
--build-arg JUG_VERSION=${INTERNAL_TAG}-$(git rev-parse HEAD)
...
...
@@ -292,6 +294,8 @@ jug_dev:default:
--build-arg EICSPACK_CHERRYPICKS="${EICSPACK_CHERRYPICKS}"
--build-arg S3_ACCESS_KEY="${S3_ACCESS_KEY}"
--build-arg S3_SECRET_KEY="${S3_SECRET_KEY}"
--build-arg S3RW_ACCESS_KEY="${S3RW_ACCESS_KEY}"
--build-arg S3RW_SECRET_KEY="${S3RW_SECRET_KEY}"
--build-arg CACHE_BUST=${PACKAGE_HASH}
--build-arg INTERNAL_TAG=${INTERNAL_TAG}
--build-arg JUG_VERSION=${INTERNAL_TAG}-$(git rev-parse HEAD)
...
...
This diff is collapsed.
Click to expand it.
containers/jug/dev.Dockerfile
+
36
−
8
View file @
34718c2e
...
...
@@ -61,6 +61,7 @@ RUN declare -A arch=( \
RUN
--mount
=
type
=
cache,target
=
/var/cache/spack-mirror
\
export
PATH
=
$PATH
:
$SPACK_ROOT
/bin
\
&&
spack mirror add docker /var/cache/spack-mirror
\
&&
spack buildcache update-index
-d
/var/cache/spack-mirror
\
&&
spack mirror list
## Setup eic-spack buildcache mirrors (FIXME: leaks credentials into layer)
...
...
@@ -68,16 +69,16 @@ ARG S3_ACCESS_KEY=""
ARG
S3_SECRET_KEY=""
RUN
--mount
=
type
=
cache,target
=
/var/cache/spack-mirror
\
export
PATH
=
$PATH
:
$SPACK_ROOT
/bin
\
&&
if
[
-n
$
S3_ACCESS_KEY
]
;
then
\
&&
if
[
-n
"
${
S3_ACCESS_KEY
}
"
]
;
then
\
spack mirror add
--scope
site
\
--s3-endpoint-url
https://
dtn01
.sdcc.bnl.gov:9000
\
--s3-access-key-id
${
S3_ACCESS_KEY
}
\
--s3-access-key-secret
${
S3_SECRET_KEY
}
\
--s3-endpoint-url
https://
eics3
.sdcc.bnl.gov:9000
\
--s3-access-key-id
"
${
S3_ACCESS_KEY
}
"
\
--s3-access-key-secret
"
${
S3_SECRET_KEY
}
"
\
eic-spack s3://eictest/EPIC/spack
\
;
fi
\
&&
spack mirror list
## This variable will change whenever
y
either spack.yaml or our spack package
## This variable will change whenever either spack.yaml or our spack package
## overrides change, triggering a rebuild
ARG
CACHE_BUST="hash"
ARG
CACHE_NUKE=""
...
...
@@ -112,7 +113,7 @@ RUN rm -r /usr/local \
## 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
B010 networ
k buildcache
(silicon)
## 1. Remove the
eic-spac
k 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
...
...
@@ -125,15 +126,16 @@ RUN --mount=type=cache,target=/var/cache/spack-mirror \
||
spack
install
-j64
--no-check-signature
\
||
spack
install
-j64
--no-check-signature
\
||
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
>
tmp.
buildcache.txt
\
|
sort
>
buildcache.
local.
txt
\
&&
spack find
--format
{
name
}
/
{
hash
}
|
sort
\
|
comm
-23
-
tmp.
buildcache.txt
\
|
comm
-23
- buildcache.
local.
txt
\
| xargs
--no-run-if-empty
\
spack buildcache create
--allow-root
--only
package
--unsigned
\
--directory
/var/cache/spack-mirror
\
...
...
@@ -141,6 +143,32 @@ RUN --mount=type=cache,target=/var/cache/spack-mirror \
&&
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
.
\
&&
if
[
-n
"
${
S3RW_ACCESS_KEY
}
"
]
;
then
\
spack mirror add
--scope
site
\
--s3-endpoint-url
https://dtn01.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
--no-run-if-empty
\
spack buildcache create
--allow-root
--only
package
--unsigned
\
--mirror-name
eic-spack
\
--rebuild-index
\
&&
spack mirror
rm
--scope
site eic-spack
\
;
fi
\
&&
spack mirror list
## Extra post-spack steps:
## - Python packages
COPY
requirements.txt /usr/local/etc/requirements.txt
...
...
This diff is collapsed.
Click to expand it.
spack.yaml
+
1
−
0
View file @
34718c2e
...
...
@@ -39,6 +39,7 @@ spack:
-
prmon@3.0.2 +plot
-
pythia8@8.306 +fastjet
-
python@3.10.8
-
py-boto3@1.18.12
-
py-numpy@1.23.4
-
py-pip@22.2.2
-
py-toml@0.10.2
...
...
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