Using the Air Gap Utility

Describes how to use the Air Gap Utility to download files in an air-gapped HPE Ezmeral Unified Analytics Software environment.

IMPORTANT
The README.txt file included with the product provides instructions for downloading and extracting the HPE Ezmeral Unified Analytics Software binaries that are required to install the product, including the Air Gap Utility. If you downloaded and extracted the files, as described in the README.txt file, you should have the Air Gap Utility.

Requirements

The Air Gap Utility has the following requirements:
Python
  • 2.7
  • 3.6 and above
Operating System
At minimum:
  • RHEL 8
  • SLES 15
  • Rocky Linux 8
Scopeo
At minimum:
  • For RHEL or Rocky Linux:
    • Skopeo 0.1.40
  • For SLES:
    • Skopeo 0.1.41

About the Air Gap Utility

HPE Ezmeral Unified Analytics Software provides a utility you can use to query, filter, and download all air gap container images necessary for your environment to a local filesystem or remote registry.

Installing the Air Gap Utility Package

Before downloading files for your air gap environment, you must first install the air gap script package. You can install the package on any non-platform host, even outside the platform installation. Python 2.7 or Python 3.6 and greater is required for installation.

To install the air gap utility package:
  1. Install Skopeo. In the CLI, enter the following:
    • For RHEL:
      dnf install -y skopeo
    • For SLES:
      zypper install -y skopeo
  2. Install the hpeairgaputil package:
    • PIP2:
      pip install hpeairgaputil-1.6.0-py2.py3-none-any.whl
    • PIP3:
      pip3 install hpeairgaputil-1.6.0-py2.py3-none-any.whl
    TIP
    To uninstall hpeairgaputil, use:
    • PIP2:
      pip uninstall hpeairgaputil-1.6.0-py2.py3-none-any.whl
    • PIP3:
      pip3 uninstall hpeairgaputil-1.6.0-py2.py3-none-any.whl

Using Air Gap Utility Filters

After installing the air gap utility package, you can filter the available apps for a given HPE Ezmeral Unified Analytics Software version in a project.

You must provide one of the following mandatory arguments in each of your commands:
  • --list_releases
  • --release
    TIP
    To display a list of options available in the ezua-airgap-util, use the following command:
    ezua-airgap-util --help
You can use filters to display the following information:
  • Release: List all releases with the following command:
    ezua-airgap-util --list_releases
  • Images: List all the images for a particular release:
    ezua-airgap-util --release <release-number>
    • List available images without headers:
      ezua-airgap-util --release <release-number> --noheaders
    • List all required images:
      ezua-airgap-util --release <release-number> --required 
    • List all optional images:
      ezua-airgap-util --release <release-number> --optional
  • List components: List all the components that are available for a particular release:
    ezua-airgap-util --list_components --release <release-number>
  • Component: List all images for a particular component:
    ezua-airgap-util --release <release-number> --component <component>
  • Size: Valid values include b, kb, mb, and gb.
    • Display images less than a certain size:
      ezua-airgap-util --release <release-number> --lessthan 1mb
    • Display images greater than a certain size:
      ezua-airgap-util --release <release-number> --greaterthan 5gb
    • Display images between two sizes:
      ezua-airgap-util --release <release-number> --lessthan 6gb --greaterthan 5gb
  • You can combine filters to provide a more customized query, for example:
    ezua-airgap-util --release <release-number> --component falco
  • To filter for a specific name or string, you can use the options –noheaders | grep <String>:
    ezua-airgap-util --release <release-number> --noheaders | grep <String>

Downloading Air Gap Files

After Using Air Gap Utility Filters to find the necessary files for your deployment, download the files as follows:
  1. Use a single command to filter and copy air gap files to a local filesystem or remote registry. Include all filters you want to apply to your download. Include --dest_compress to compress the files and download in a .tgz file. Otherwise, the files download in a .tar file. For example:
    ezua-airgap-util --release <release-number> --lessthan 1mb --copy --dest_path images/ --dest_compress
    Use --force to delete the .tgz or .tar file of the image if it already exists. For example:
    ezua-airgap-util --release <release-number> --lessthan 1mb --copy --dest_path images/ --force
    ezua-airgap-util --release <release-number> --lessthan 1mb --copy --dest_path images/ --dest_compress --force
    
    • To copy multiple images to a local filesystem, run the following command. Provide the destination path where you want to store your files.
      ezua-airgap-util --release <release-number> <add-on_filters> --copy --dest_path <destination-path>
    • To copy a single image to a local filesystem, execute the following command. Provide the destination path where you want to store your files.
      ezua-airgap-util --release <release-number> --image <image-name> --copy --dest_path <destination-path>
    • To copy multiple images to a remote container registry, select one of the following options. Provide the destination URL and credentials for your container registry.
      • Use the --dest_creds <username:password> command line option:
        ezua-airgap-util --release <release-number> <add-on-filters> --copy --dest_url <destination-url> --dest_creds <username:password>
      • Alternatively, set environment variable AIRGAP_UTIL_CREDS. You can set environmental variables using the export command:
        export AIRGAP_UTIL_CREDS=<username>:<password>
      • To copy a single image to a remote container registry, execute the following command. Provide the destination URL and credentials for your container registry.
        ezua-airgap-util --release <release-number> --image <image-name> --copy --dest_url <destination-url> --dest_creds <username:password>

Air Gap Utility Logging

By default, the Air Gap Utility creates a logs/ directory in the present working directory from which you invoked the Air Gap Utility command line.

You can change the log directory location as follows:
  • If you pass the --logdir argument in the Air Gap Utility command line, then the Air Gap Utility creates a logs/ directory in the path provided in the --logdir argument.
  • If you set the AIRGAP_UTIL_LOGDIR environment variable, but do not pass the --logdir argument in the Air Gap Utility command line, then the Air Gap utility creates a logs/ directory in the path set in the AIRGAP_UTIL_LOGDIR environment variable.
    NOTE
    The Air Gap Utility does not create log files when commands are run in TTY mode. For example:
    ezua-airgap-util --release v1.5.0 | grep -i airflow

Using Skopeo --options with the Air Gap Utility

This section describes how to use Skopeo --options with the Air Gap Utility and provides usage examples.

The following examples show the Skopeo --preserve-digests and --retry-times options used with the Air Gap Utility:
ezua-airgap-util --release v1.5.0 --image longhornio/livenessprobe:v2.9.0 --copy --dest_path ezua-v1.5.0/ --options="--preserve-digests"
ezua-airgap-util --release v1.5.0 --image longhornio/livenessprobe:v2.9.0 --copy --dest_path ezua-v1.5.0/ --options="--retry-times 5"
You can use multiple Skopeo options with the Air Gap Utility.
The following example demonstrates how to use the Skopeo --preserve-digests and --retry-times options together:
ezua-airgap-util --release v1.5.0 --image longhornio/livenessprobe:v2.9.0 --copy --dest_path ezua-v1.5.0/ --options="--preserve-digests --retry-times 5"

Expediting the Image Download Process

HPE recommends copying the images to the remote container registry using the following command:
ezua-airgap-util --release <release-number> <add-on-filters> --copy --dest_url <destination-url> --dest_creds <username:password>
However, if this process is too time-intensive, for example if internet access is slow and downloading 250-300 GB of images takes more than a day to download at the container registry location, use this expedited method to download images.

To expedite the image download process, download the images to disk on a host at a location with a high-speed internet connection, transfer the downloaded images to an internal container registry location, and then upload the images to your private image registry.

To expedite the image download process, complete the following steps:
1. On a server with a high-speed connection, download the images to a package.
To download some or all of the images into a local directory, run the following ezua-airgap-util command:
ezua-airgap-util --release v1.5.0 --copy --dest_path <local-directory-path> --force

//Example: hpe-airgap-util --release v1.5.0 --image busybox:latest --copy --dest_path images/ --force
This command downloads each image into an individual TAR file.

2. Transfer the package (TAR files) to a host that runs the container registry.
Transfer all of the TAR files to the server where you will run the Air Gap Utility to upload the images to the private image registry.

3. Use the Air Gap Utility to upload the package (TAR files) to the private image registry.
To upload the image files to the private image registry, run the following ezua-airgap-util command:
ezua-airgap-util --release v1.5.0 --copy_from_dir <image-dir-path> --dest_url <destination-url> --dest_creds <username:password>

//Example: ezua-airgap-util --release v1.5.0 --copy_from_dir /home/mehul/images --dest_creds username:password  --dest_url lr1-bd-harbor-registry.mip.storage.hpecorp.net/mehul-test