Skip to main content

Restore Cache from GCS step settings

This topic provides settings for the Restore Cache from GCS step, which restores files and directories that were saved using the Save Cache to GCS step.

info

Depending on the stage's build infrastructure, some settings may be unavailable.

Name

Enter a name summarizing the step's purpose. Harness automatically assigns an Id (Entity Identifier Reference) based on the Name. You can change the Id.

GCP Connector

The Harness connector for the GCP account where you saved the cache.

This step supports GCP connectors that use access key authentication. It does not support GCP connectors that inherit delegate credentials.

Bucket

GCS bucket name where you saved the cache.

Key

The key identifying the cache to restore.

You can use the checksum macro to restore a key based on a file's checksum, for example myApp-{{ checksum "path/to/file" }} or gcp-{{ checksum "package.json" }}. The result of the checksum macro is concatenated to the leading string.

The backslash character isn't allowed as part of the checksum value here. This is a limitation of the Go language (golang) template. You must use a forward slash instead, for example:

  • Incorrect format: cache-{{ checksum ".\src\common\myproj.csproj" }}
  • Correct format: cache-{{ checksum "./src/common/myproj.csproj" }}

Optional Configuration

Use the following settings to add additional configuration to the step. Settings specific to containers, such as Set Container Resources, are not applicable when using the step in a stage with VM or Harness Cloud build infrastructure.

Archive Format

Select the archive format. The default archive format is Tar.

Fail if Key Doesn't Exist

Select this option to fail the step if the specified Key doesn't exist.

By default, this option is set to false (unselected).

Run as User

Specify the user ID to use to run all processes in the pod if running in containers. For more information, go to Set the security context for a pod.

Set Container Resources

Maximum resources limits for the resources used by the container at runtime:

  • Limit Memory: Maximum memory that the container can use. You can express memory as a plain integer or as a fixed-point number with the suffixes G or M. You can also use the power-of-two equivalents, Gi or Mi. Do not include spaces when entering a fixed value. The default is 500Mi.
  • Limit CPU: The maximum number of cores that the container can use. CPU limits are measured in CPU units. Fractional requests are allowed. For example, you can specify one hundred millicpu as 0.1 or 100m. For more information, go to Resource units in Kubernetes.

Timeout

Set the timeout limit for the step. Once the timeout limit is reached, the step fails and pipeline execution continues. To set skip conditions or failure handling for steps, go to: