Skip to content

Move Azure cache implementation to plugin #1037

@ecraig12345

Description

@ecraig12345

For the many users of lage (and indirectly backfill) who don't use remote caching, it would be nice if the Azure cache implementation could be moved to a plugin instead of being included by default (due to the significant dependency+parsing bulk). Making this approach extensible would also open the opportunity for other remote cache backends.

Probably something like this:

interface CustomCacheStoragePlugin<TOptions> {
  name: string;
  getProvider: (logger: Logger, cwd: string, options: TOptions) => ICacheStorage;
}

interface CustomCacheStorageConfig<TOptions = unknown> {
  provider: "custom";
  // Can be either a path or a package name.
  // If a package name, it's resolved from the location of the config file.
  // (Maybe come up with a better prop name...?)
  plugin: string;
  options: TOptions;
}

// REMOVED: AzureBlobCacheStorageConfig (now a plugin)
type CacheStorageConfig =
  | { provider: "local" }
  | { provider: "local-skip" }
  | NpmCacheStorageConfig
  | CustomCacheStorageConfig;

// lage.config.js
const lageConfig = {
  cacheOptions: {
    cacheStorageConfig: {
      provider: "custom",
      plugin: "@lage-run/azure-blob-cache-storage",
      options: { /*...*/ }
    }
  }
}

Metadata

Metadata

Labels

lage-v3Work items for lage v3 and related major bumps of backfill

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions