Skip to content

Commit

Permalink
Merge pull request #506 from climbfuji/bugfix/bootstrap_airgapped_spa…
Browse files Browse the repository at this point in the history
…ck_stack_dev

This PR is pulling in the updates from spack#48252, modified for the v0.23 spack base branch (PR 48252 is for spack develop, which is v1.0-alpha). PR 48252 is ready as far as spack core code changes are concerned, the only reason the PR isn't merged yet is because the GitHub actions are missing a spack buildcache update-index command.
  • Loading branch information
climbfuji authored Jan 23, 2025
2 parents 0ee54ff + a231b4b commit 8456a25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/spack/docs/bootstrapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ bootstrapping.
To register the mirror on the platform where it's supposed to be used run the following command(s):
% spack bootstrap add --trust local-sources /opt/bootstrap/metadata/sources
% spack bootstrap add --trust local-binaries /opt/bootstrap/metadata/binaries
% spack buildcache update-index /opt/bootstrap/bootstrap_cache
This command needs to be run on a machine with internet access and the resulting folder
Expand Down
8 changes: 6 additions & 2 deletions lib/spack/spack/bootstrap/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ def __init__(self, conf: ConfigDictionary) -> None:
self.name = conf["name"]
self.metadata_dir = spack.util.path.canonicalize_path(conf["metadata"])

# Promote (relative) paths to file urls
self.url = spack.mirror.Mirror(conf["info"]["url"]).fetch_url
# Check for relative paths, and turn them into absolute paths
# root is the metadata_dir
maybe_url = conf["info"]["url"]
if spack.util.url.is_path_instead_of_url(maybe_url) and not os.path.isabs(maybe_url):
maybe_url = os.path.join(self.metadata_dir, maybe_url)
self.url = spack.mirror.Mirror(maybe_url).fetch_url

@property
def mirror_scope(self) -> spack.config.InternalConfigScope:
Expand Down
9 changes: 5 additions & 4 deletions lib/spack/spack/cmd/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


# Tarball to be downloaded if binary packages are requested in a local mirror
BINARY_TARBALL = "https://github.com/spack/spack-bootstrap-mirrors/releases/download/v0.4/bootstrap-buildcache.tar.gz"
BINARY_TARBALL = "https://github.com/spack/spack-bootstrap-mirrors/releases/download/v0.5/bootstrap-buildcache.tar.gz"

#: Subdirectory where to create the mirror
LOCAL_MIRROR_DIR = "bootstrap_cache"
Expand All @@ -51,9 +51,9 @@
},
}

CLINGO_JSON = "$spack/share/spack/bootstrap/github-actions-v0.4/clingo.json"
GNUPG_JSON = "$spack/share/spack/bootstrap/github-actions-v0.4/gnupg.json"
PATCHELF_JSON = "$spack/share/spack/bootstrap/github-actions-v0.4/patchelf.json"
CLINGO_JSON = "$spack/share/spack/bootstrap/github-actions-v0.5/clingo.json"
GNUPG_JSON = "$spack/share/spack/bootstrap/github-actions-v0.5/gnupg.json"
PATCHELF_JSON = "$spack/share/spack/bootstrap/github-actions-v0.5/patchelf.json"

# Metadata for a generated source mirror
SOURCE_METADATA = {
Expand Down Expand Up @@ -437,6 +437,7 @@ def write_metadata(subdir, metadata):
shutil.copy(spack.util.path.canonicalize_path(GNUPG_JSON), abs_directory)
shutil.copy(spack.util.path.canonicalize_path(PATCHELF_JSON), abs_directory)
instructions += cmd.format("local-binaries", rel_directory)
instructions += " % spack buildcache update-index <final-path>/bootstrap_cache\n"
print(instructions)


Expand Down

0 comments on commit 8456a25

Please sign in to comment.