Sticky Disks
Learn about how sticky disks can speed up your workloads
useblacksmith/stickydisk is a GitHub Action that helps persist state written to disk across jobs. This action can serve as a superior alternative to the Actions cache, especially when the cache artifacts are extremely large. Each sticky disk is hot-loaded into the runner and mounted at the specified path. The sticky disk is formatted as an ext4 filesystem.
Cache Performance Comparison
Caching Solution | Cache Size | Average Download Speed | Time to Access |
---|---|---|---|
GitHub Actions Cache | 6GB | 90 MB/s | ~1m6s |
Blacksmith Cache | 6GB | 400 MB/s | ~15s |
Sticky Disks | 6GB | N/A | 3 seconds |
Use Cases
NPM Package Caching
Node.js projects can have extensive dependency trees, leading to large node_modules
directories. Sticky disks provide persistent, high-performance storage for your NPM packages.
Bazel Build Caching
Bazel’s remote cache can significantly improve build times, but uploading and downloading cached artifacts can still be a bottleneck. Using sticky disks with Blacksmith runners provides near-instant access to your Bazel caches as they are bind mounted into your runners on demand. Our useblacksmith/setup-bazel@v2
action is a zero-confg way to use sticky disks to store the disk, repository, and external cache.
How it works
Blacksmith stores sticky disk artifacts in a secure, highly performant Ceph cluster, running on local NVMe drives. Our runners proxy their requests through our Storage Agents to interact with the Ceph cluster. Each sticky disk is uniquely identified by a key. When a GitHub Action job requests a sticky disk, the last committed snapshot will be cloned and mounted into the runner at the specified path. Once the job completes, the sticky disk will be unmounted and committed for future invocations. At the moment, customers can use up to 5 sticky disks in a single GitHub Action job.
Using Sticky Disks inside a container
If your GitHub Actions job runs inside a container, you will need to ensure that the container is hydrated with certain Blacksmith specific environment variables and is running in privileged mode. These environment variables allow the runner to coordinate with our control plane to hotload and commit the sticky disks used in the workflow. The privileged mode is required for mounting and unmounting block devices inside a container.
The following changes can be made to your service container config in the workflow file:
If the container image does not have sudo
installed, you will need to install it as a step inside the container. sudo
is required for
mounting and formatting the sticky disk with proper permissions.
Without these steps, you will see a 401
error, an Unauthenticated
error, or permission-related errors when attempting to mount or use the sticky disk.
Pricing
Sticky disks are billed at $0.50 per gigabyte per month, snapshotted by the hour.