Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
1f93c39c
Commit
1f93c39c
authored
Mar 31, 2016
by
Todd Gamblin
Browse files
Options
Downloads
Plain Diff
Merge pull request #291 from trws/stage-path
add a path argument to the stage command
parents
2441068d
5d2151ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/spack/spack/cmd/stage.py
+5
-0
5 additions, 0 deletions
lib/spack/spack/cmd/stage.py
lib/spack/spack/package.py
+6
-3
6 additions, 3 deletions
lib/spack/spack/package.py
lib/spack/spack/stage.py
+5
-2
5 additions, 2 deletions
lib/spack/spack/stage.py
with
16 additions
and
5 deletions
lib/spack/spack/cmd/stage.py
+
5
−
0
View file @
1f93c39c
...
@@ -35,6 +35,9 @@ def setup_parser(subparser):
...
@@ -35,6 +35,9 @@ def setup_parser(subparser):
subparser
.
add_argument
(
subparser
.
add_argument
(
'
-n
'
,
'
--no-checksum
'
,
action
=
'
store_true
'
,
dest
=
'
no_checksum
'
,
'
-n
'
,
'
--no-checksum
'
,
action
=
'
store_true
'
,
dest
=
'
no_checksum
'
,
help
=
"
Do not check downloaded packages against checksum
"
)
help
=
"
Do not check downloaded packages against checksum
"
)
subparser
.
add_argument
(
'
-p
'
,
'
--path
'
,
dest
=
'
path
'
,
help
=
"
Path to stage package, does not add to spack tree
"
)
subparser
.
add_argument
(
subparser
.
add_argument
(
'
specs
'
,
nargs
=
argparse
.
REMAINDER
,
help
=
"
specs of packages to stage
"
)
'
specs
'
,
nargs
=
argparse
.
REMAINDER
,
help
=
"
specs of packages to stage
"
)
...
@@ -50,4 +53,6 @@ def stage(parser, args):
...
@@ -50,4 +53,6 @@ def stage(parser, args):
specs
=
spack
.
cmd
.
parse_specs
(
args
.
specs
,
concretize
=
True
)
specs
=
spack
.
cmd
.
parse_specs
(
args
.
specs
,
concretize
=
True
)
for
spec
in
specs
:
for
spec
in
specs
:
package
=
spack
.
repo
.
get
(
spec
)
package
=
spack
.
repo
.
get
(
spec
)
if
args
.
path
:
package
.
path
=
args
.
path
package
.
do_stage
()
package
.
do_stage
()
This diff is collapsed.
Click to expand it.
lib/spack/spack/package.py
+
6
−
3
View file @
1f93c39c
...
@@ -335,6 +335,9 @@ def __init__(self, spec):
...
@@ -335,6 +335,9 @@ def __init__(self, spec):
if
'
.
'
in
self
.
name
:
if
'
.
'
in
self
.
name
:
self
.
name
=
self
.
name
[
self
.
name
.
rindex
(
'
.
'
)
+
1
:]
self
.
name
=
self
.
name
[
self
.
name
.
rindex
(
'
.
'
)
+
1
:]
# Allow custom staging paths for packages
self
.
path
=
None
# Sanity check attributes required by Spack directives.
# Sanity check attributes required by Spack directives.
spack
.
directives
.
ensure_dicts
(
type
(
self
))
spack
.
directives
.
ensure_dicts
(
type
(
self
))
...
@@ -445,7 +448,8 @@ def _make_resource_stage(self, root_stage, fetcher, resource):
...
@@ -445,7 +448,8 @@ def _make_resource_stage(self, root_stage, fetcher, resource):
resource_stage_folder
=
self
.
_resource_stage
(
resource
)
resource_stage_folder
=
self
.
_resource_stage
(
resource
)
resource_mirror
=
join_path
(
self
.
name
,
os
.
path
.
basename
(
fetcher
.
url
))
resource_mirror
=
join_path
(
self
.
name
,
os
.
path
.
basename
(
fetcher
.
url
))
stage
=
ResourceStage
(
resource
.
fetcher
,
root
=
root_stage
,
resource
=
resource
,
stage
=
ResourceStage
(
resource
.
fetcher
,
root
=
root_stage
,
resource
=
resource
,
name
=
resource_stage_folder
,
mirror_path
=
resource_mirror
)
name
=
resource_stage_folder
,
mirror_path
=
resource_mirror
,
path
=
self
.
path
)
return
stage
return
stage
def
_make_root_stage
(
self
,
fetcher
):
def
_make_root_stage
(
self
,
fetcher
):
...
@@ -455,7 +459,7 @@ def _make_root_stage(self, fetcher):
...
@@ -455,7 +459,7 @@ def _make_root_stage(self, fetcher):
s
=
self
.
spec
s
=
self
.
spec
stage_name
=
"
%s-%s-%s
"
%
(
s
.
name
,
s
.
version
,
s
.
dag_hash
())
stage_name
=
"
%s-%s-%s
"
%
(
s
.
name
,
s
.
version
,
s
.
dag_hash
())
# Build the composite stage
# Build the composite stage
stage
=
Stage
(
fetcher
,
mirror_path
=
mp
,
name
=
stage_name
)
stage
=
Stage
(
fetcher
,
mirror_path
=
mp
,
name
=
stage_name
,
path
=
self
.
path
)
return
stage
return
stage
def
_make_stage
(
self
):
def
_make_stage
(
self
):
...
@@ -709,7 +713,6 @@ def do_fetch(self, mirror_only=False):
...
@@ -709,7 +713,6 @@ def do_fetch(self, mirror_only=False):
if
spack
.
do_checksum
and
self
.
version
in
self
.
versions
:
if
spack
.
do_checksum
and
self
.
version
in
self
.
versions
:
self
.
stage
.
check
()
self
.
stage
.
check
()
def
do_stage
(
self
,
mirror_only
=
False
):
def
do_stage
(
self
,
mirror_only
=
False
):
"""
Unpacks the fetched tarball, then changes into the expanded tarball
"""
Unpacks the fetched tarball, then changes into the expanded tarball
directory.
"""
directory.
"""
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/stage.py
+
5
−
2
View file @
1f93c39c
...
@@ -89,7 +89,7 @@ class Stage(object):
...
@@ -89,7 +89,7 @@ class Stage(object):
"""
"""
def
__init__
(
self
,
url_or_fetch_strategy
,
def
__init__
(
self
,
url_or_fetch_strategy
,
name
=
None
,
mirror_path
=
None
,
keep
=
False
):
name
=
None
,
mirror_path
=
None
,
keep
=
False
,
path
=
None
):
"""
Create a stage object.
"""
Create a stage object.
Parameters:
Parameters:
url_or_fetch_strategy
url_or_fetch_strategy
...
@@ -135,6 +135,9 @@ def __init__(self, url_or_fetch_strategy,
...
@@ -135,6 +135,9 @@ def __init__(self, url_or_fetch_strategy,
# Try to construct here a temporary name for the stage directory
# Try to construct here a temporary name for the stage directory
# If this is a named stage, then construct a named path.
# If this is a named stage, then construct a named path.
if
path
is
not
None
:
self
.
path
=
path
else
:
self
.
path
=
join_path
(
spack
.
stage_path
,
self
.
name
)
self
.
path
=
join_path
(
spack
.
stage_path
,
self
.
name
)
# Flag to decide whether to delete the stage folder on exit or not
# Flag to decide whether to delete the stage folder on exit or not
...
...
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