Use the Granica CLI

Every command and flag available in the Granica command-line interface.

Top level options

granica [OPTIONS]

--profile — Sets the AWS CLI profile to use for operations. Each profile manages a separate deployment.

--version — Show version.

--version — Show version.


deploy

granica deploy [OPTIONS]

Create all cloud resources necessary for a Granica Crunch deployment.

--custom-domain <domain> — Set a custom domain name for deployment endpoints. Creates https://dashboard.<region>.<domain> and https://bolt.<region>.<domain> endpoints.

--var-file <file-path> — Configure deployments to launch using existing resources. The file should be a Terraform .tfvars file.

--vpc-cidr <cidr> — CIDR range of the VPC to create. Default is 10.0.0.0/16.

--peer-vpc-cidr <cidr> — CIDR range of the VPC(s) to peer to.

--az-allowlist <az-list> — AWS availability zones to deploy the cluster into. Comma-separated list of 2+ AZ IDs, e.g. us-east-1a,us-east-1c.

--az-denylist <az-list> — AWS availability zones to avoid deploying into.

--custom-domain <domain> — Set a custom domain name for deployment endpoints. Creates https://dashboard.<region>.<domain> and https://bolt.<region>.<domain> endpoints.

--var-file <file-path> — Configure deployments to launch using existing resources. The file should be a Terraform .tfvars file.

--create-project, --no-create-project — Create a new project to launch the deployment into. Default is --no-create-project.


crunch

granica crunch [OPTIONS] <bucket-name>

Crunch Amazon S3 buckets in the same region where Granica Crunch is deployed.

Arguments:

<bucket-name> — The bucket to crunch. Must start with s3:// or use the special argument universe. If universe is passed, Crunch will crunch all S3 buckets in the same region, subject to policy filters.

Options:

-p, --pause — Pause crunching on a bucket.

Use --pause with the universe argument to pause crunching on all buckets:

granica crunch --pause universe
granica crunch [OPTIONS] <bucket-name>

Crunch GCP Cloud Storage buckets in the same region where Granica Crunch is deployed.

Arguments:

<bucket-name> — The bucket to crunch. Must start with gs:// or use the special argument universe. If universe is passed, Crunch will crunch all GS buckets in the same region, subject to policy filters.

Options:

-p, --pause — Pause crunching on a bucket.

Use --pause with the universe argument to pause crunching on all buckets:

granica crunch --pause universe

status

granica status [OPTIONS]

Print out a report of global and bucket level crunch metrics and status.

Options:

  • -a, --all — Show status for all crunched buckets, including paused buckets
  • -h, --human-readable — Round byte and object counts for legibility (default)
  • -e, --exact — Show exact byte and object counts

update

granica update [OPTIONS]

Update all deployments to the latest release.

Options:

  • -t <version>, --to-version <version> — Upgrade (or downgrade) to a specific version
  • --no-download — Skip downloading a new package and run update with the existing package
  • --all, --one — Update all deployments or just the one specified by --profile
  • --auto-approve, --confirm — Require manual confirmation or automatically approve. Default is --auto-approve

dashboard

granica dashboard

Display the username and password needed to access the Crunch dashboard to view bucket crunching results.


policy

granica policy <edit|get|set|delete>

Manage Crunch policies.

policy edit

granica policy edit

Edit, view, change, set and delete Crunch policies. Opens existing policies in the editor defined by VISUAL or EDITOR environment variable (defaulting to vi). Writing the changes applies the policies; quitting without saving leaves existing policies in place. Writing an empty file deletes all policies.

This is the preferred method to manage policies.

universe: {}
standard:
  freeze-for: disable
  crunch-after: disable
  tier:
    - class: disable
      after: disable
  expire-after: disable
  object-include: disable
  object-exclude: disable
  cleaner: disable
  non-current-expire-after: disable
  uncrunch-expire-after: 1d
exclude: []
include: []
standard:
  crunch-enable: true
  freeze-for: disable
  crunch-after: disable
  tier:
    - class: disable
      after: disable
  expire-after: disable
exclude:
# - bucket: other-buckets-*
include:
# - bucket: some-bucket-*
#   expire-after: 7d
#   cleaner: disable

For more information, see How policies work.

policy get

granica policy get

Display the current Crunch policy.

policy set

granica policy set <file-path> [--auto-approve]

Set the policy from a policy.yaml file.

  • <file-path> — Path to a YAML file containing the Crunch policy
  • --auto-approve — Skip manual confirmation

policy delete

granica policy delete [--auto-approve]

Delete the Crunch policy.


permissions

granica permissions <edit|get|set|delete>

Manage organization and bucket permissions.

permissions edit

granica permissions edit

Edit, view, change, set and delete permissions. Opens existing permissions in the editor defined by VISUAL or EDITOR. This is the preferred way to manage permissions.

custom:
  # - bucket: some-bucket-*
  # admins:
  #   - arn:aws:iam::123456789012:user/some-user
  #   - arn:aws:iam::123456789012:role/some-role
standard:
  admins:
    # - principal0
  readers:
    # - principal1
  writers:
    # - principal2
custom:
  # - bucket: some-bucket-*
  # admins:
  #   - some-user@your-domain.com      # IAM users
  #   - 123456789012345678901            # Service accounts (client IDs)
standard:
  admins:
    # - principal0
  readers:
    # - principal1
  writers:
    # - principal2

The permissions in the custom section are authoritative — principals granted permissions in the standard section won't have access to custom buckets unless also granted in custom. This can be used to set deny policies on a bucket.

permissions get

granica permissions get

Display the permissions set on a deployment.

permissions set

granica permissions set <file-path> [--auto-approve]

Set permissions from a permissions.yaml file.

permissions delete

granica permissions delete [--auto-approve]

Delete the permissions set on a deployment.


ls

granica ls [FLAGS]

List all current deployments and their associated metadata.

Flags:

  • -c, --clusters — Include clusters with no deployments
  • -p, --projects — Include projects with no clusters

garbage-collect

granica garbage-collect

Collect and permanently delete unneeded resources related to past deployments. Currently targets storage buckets (reduced data and metadata buckets). Run the command to surface past deployments, select one, confirm by entering the deployment ID, and the resources will be staged for permanent deletion.


uncrunch

Restore original, unreduced data into source buckets and delete the reduced data.

#!/usr/bin/env bash
BUCKET=$1
PASSTHROUGH_SUFFIX="_projectn_passthrough"
S3_PATH="s3://"
UNCRUNCH_MD="bolt-uncrunch=true"

granica crunch -p $S3_PATH$BUCKET
aws s3 sync $S3_PATH$BUCKET $S3_PATH$BUCKET$PASSTHROUGH_SUFFIX --metadata $UNCRUNCH_MD
aws s3 rb $S3_PATH$BUCKET --force

Save as granica-uncrunch.sh and run: granica-uncrunch.sh <bucket-name>

#!/usr/bin/env bash
BUCKET=$1
BOLT_URL=$2
PASSTHROUGH_SUFFIX="_projectn_passthrough"
GS_PATH="gs://"

granica crunch -p $GS_PATH$BUCKET
gsutil -h "x-goog-meta-bolt-uncrunch:true" -o Credentials:gs_json_host=$BOLT_URL rsync $GS_PATH$BUCKET $GS_PATH$BUCKET$PASSTHROUGH_SUFFIX
gsutil -o Credentials:gs_json_host=$BOLT_URL rm -r $GS_PATH$BUCKET

Save as granica-uncrunch.sh and run: granica-uncrunch.sh <bucket-name> <bolt-url>


scale

granica scale <up|down>

Scales reducer, worker, and read replica autoscaling groups up and down. (AWS only)


teardown

granica teardown [OPTIONS]

Tear down the Granica cluster, destroying all provisioned resources.

This command doesn't tear down the Granica Admin Server or uninstall the Granica CLI. A new deployment can be created after teardown.

Options:

  • --auto-approve — Tear down without asking for additional confirmation
Was this page helpful?

On this page