skipcheck

TM1 Testcontainers · Docs · Where TM1 comes from

CognosSource

import io.skipcheck.tm1.testcontainers.CognosSource;

Where a CognosContainer gets IBM Cognos Analytics from.

The cognos-server image contains no IBM software, so every container needs one of these. Cognos writes into its install while it runs, so unlike TM1 an install can't be mounted read-only and shared: a CognosSource.PrivateImage is the fastest source, and safe for containers in parallel, because Docker gives each container its own copy-on-write copy. The zip sources install Cognos into every new container (about a minute, and 10 GB).

discover finds one from the environment. Each setting is read first as a system property and then as an environment variable, under the same name. The names match the cognos-server image's settings. The first source found wins, in this order:

  1. COGNOS_PRIVATE_IMAGE: an image with Cognos built in (CognosSource.PrivateImage)
  2. COGNOS_INSTALL_VOLUME: a Docker volume holding an install (CognosSource.InstallVolume)
  3. COGNOS_ZIP_DIR, optionally with COGNOS_ZIP: a folder holding IBM's repository zip, and the file name to use from it (CognosSource.Zip)
  4. COGNOS_ZIP_URL, optionally with COGNOS_ZIP_SHA256: a download link for the zip (CognosSource.ZipUrl)
  5. TM1_BUNDLE_DIR, if it also holds a Cognos zip (or COGNOS_ZIP names one in it): the same downloads folder as TM1

Members

PRIVATE_IMAGE staticAn image with Cognos built in, for CognosSource.PrivateImage.
INSTALL_VOLUME staticA Docker volume holding an install, for CognosSource.InstallVolume.
ZIP_DIR staticA folder holding IBM's Cognos repository zip, for CognosSource.Zip.
ZIP staticThe zip's file name within the zip folder; the newest one if unset.
ZIP_URL staticA download link for IBM's Cognos repository zip, for CognosSource.ZipUrl.
ZIP_SHA256 staticThe SHA-256 to check the ZIP_URL download against; optional.
describeA short description for logs and messages.
discover staticFinds a source from system properties and environment variables.
discover staticFinds a source using lookup to read each setting.

PRIVATE_IMAGE

static
String PRIVATE_IMAGE

An image with Cognos built in, for CognosSource.PrivateImage.

INSTALL_VOLUME

static
String INSTALL_VOLUME

A Docker volume holding an install, for CognosSource.InstallVolume.

ZIP_DIR

static
String ZIP_DIR

A folder holding IBM's Cognos repository zip, for CognosSource.Zip.

ZIP

static
String ZIP

The zip's file name within the zip folder; the newest one if unset.

ZIP_URL

static
String ZIP_URL

A download link for IBM's Cognos repository zip, for CognosSource.ZipUrl.

ZIP_SHA256

static
String ZIP_SHA256

The SHA-256 to check the ZIP_URL download against; optional.

describe

String describe()

A short description for logs and messages. Never includes a URL's query string.

Returns

the description

discover

static
static Optional<CognosSource> discover()

Finds a source from system properties and environment variables. See the class docs.

Returns

the source, or empty if none is configured

Throws

IllegalArgumentException
if a setting is present but invalid

discover

static
static Optional<CognosSource> discover(Function<String,String> lookup)

Finds a source using lookup to read each setting. Blank values count as unset.

Parameters

lookup
reads a setting by name, returning null if it's unset

Returns

the first source found, or empty if none is configured

Throws

IllegalArgumentException
if a setting is present but invalid, such as a folder that doesn't exist. A wrong setting fails rather than silently skipping the tests.

Also in the Javadoc.