Class BootstrapCache
java.lang.Object
org.fhirfrog.frog.server.bootstrap.BootstrapCache
Saves and restores HAPI bootstrap artifacts (committed Docker image and
pg_dump
SQL file) to/from a container registry.
Both artifacts are bundled into a single OCI image stored in the registry under
registry/cacheImageName:cacheKey, where cacheKey is a 16-character
SHA-256 prefix of the concatenated bytes of all key files.
Operations:
restore— pulls the cache image, extractspackages.sql, and tags the image withimageTag. Returnsfalseon cache miss.save— layerspackages.sqlinto the localimageTagDocker image via an ephemeral Dockerfile, then pushes to the registry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordConfiguration for cache operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomputeCacheKey(List<Path> keyFiles) Computes a 16-character hex SHA-256 prefix from the concatenated content of key files.booleanrestore(BootstrapCache.Config config) Attempts to restore bootstrap artifacts from the registry.voidsave(BootstrapCache.Config config) Saves bootstrap artifacts to the registry.
-
Constructor Details
-
BootstrapCache
-
-
Method Details
-
restore
Attempts to restore bootstrap artifacts from the registry.- Parameters:
config- cache configuration- Returns:
trueif restore succeeded,falseon cache miss- Throws:
BootstrapException- if restore fails after finding the image
-
save
Saves bootstrap artifacts to the registry.- Parameters:
config- cache configuration- Throws:
BootstrapException- if save fails
-
computeCacheKey
Computes a 16-character hex SHA-256 prefix from the concatenated content of key files.- Throws:
BootstrapException
-