skipcheck

TM1 Testcontainers · Docs · Containers

PawContainer

using Skipcheck.Tm1.Testcontainers;

IBM Planning Analytics Workspace (PAW) Local in Docker, for tests, started from the user's own PAW Local zip against a Tm1ServerContainer.

await using var tm1 = new Tm1ServerContainer(tm1Source);
await using var paw = new PawContainer(pawSource).WithTm1Server(tm1).AcceptLicense();
await paw.StartAsync(); // starts tm1 first
return paw.Url; // http://localhost:54321/

IBM ships PAW Local as about 30 Docker images, with compose files and a paw.sh that starts them, in ipa_workspace_local_<release>.<build>.zip. This class uses those as they are, never rebuilding or republishing them. It runs docker/paw/paw-local.sh, which unpacks the zip, loads the images when any is missing, writes PAW's configuration and runs IBM's paw.sh, inside a small Linux "runner" container that talks to the Docker daemon. So it works the same on Windows, macOS and Linux: the host needs only Docker. The unpacked zip and PAW's secrets live in the Docker volume tm1-paw-home, and IBM's compose files mount files from it by its path on the Docker host.

Users log on to PAW as users of the TM1 server (PAAuthMode=tm1). PAW is configured with the server's address on its network, and every PAW container is connected to that network too, because PAW calls TM1 at the address the Admin Server advertises.

When the TM1 server runs in Cognos (CAM) security (Tm1ServerContainer.WithCamSecurity), PAW does too (PAAuthMode=cam), as pa-setup wires it: users log on through Cognos, in the TM1 server's namespace. PAW checks logons with Cognos's dispatcher on the network (http://cognos:9300), and sends browsers to Cognos's address on the host to log on. Tests log on with a Cognos test user's name and password, which PAW checks with Cognos. A browser that logs on through Cognos isn't sent back to PAW, though: Cognos hands logons back only to the addresses in IBM's pmhub.html, which CognosContainer doesn't install (pa-setup does, with COGNOS_PMHUB_URLS).

Things to know:

  • The license: starting fails unless IBM's PAW license is accepted, with AcceptLicense or by setting PAW_ACCEPT_LICENSE=true.
  • One PAW per Docker daemon: IBM's compose files give every container a fixed name, under the compose project paw. Most tests share one, with RequiresPawFactAttribute.
  • Heavy: PAW needs about 15 GB of memory. The first start loads about 8 GB of images, which takes a few minutes; later starts take about a minute.
  • Cleanup: StopAsync removes the PAW containers and keeps PAW's data. IBM's containers carry no Testcontainers labels, so if the JVM dies they keep running, and the next start reuses them.
  • linux/amd64 only: on Apple Silicon, IBM's images run under Rosetta.

Members

AcceptLicenseSetting staticThe setting that accepts IBM's PAW license.
HomeVolume staticThe volume PAW's state lives in, kept between runs.
PawContainer constructorPAW from source.
SharedAsync staticThe one PAW the tests of a run share, wired to Tm1ServerContainer.SharedAsync; a failure to start is remembered, so later tests fail fast.
WithTm1ServerLogs users on to tm1, and lists its Admin Server's servers.
WithAdminServerLists the servers of a shared Admin Server, which must be on TM1's network.
AcceptLicenseAccepts IBM's PAW license (read it.
WithSettingSets a paw-local.sh setting.
WithStartupTimeoutHow long the first start (which loads IBM's images) may take.
Source propertyWhere PAW comes from.
Tm1Server propertyThe TM1 server PAW logs users on to, or null.
IsRunning property
Url propertyPAW's address on the Docker host.
StartAsync
StopAsync
DisposeAsyncStops it.
ToString

AcceptLicenseSetting

static
const string AcceptLicenseSetting

The setting that accepts IBM's PAW license.

HomeVolume

static
const string HomeVolume

The volume PAW's state lives in, kept between runs.

PawContainer

constructor
PawContainer(PawSource source)

PAW from source.

SharedAsync

static
Task<PawContainer> SharedAsync(CancellationToken cancellationToken = default)

The one PAW the tests of a run share, wired to Tm1ServerContainer.SharedAsync; a failure to start is remembered, so later tests fail fast.

WithTm1Server

PawContainer WithTm1Server(Tm1ServerContainer tm1)

Logs users on to tm1, and lists its Admin Server's servers.

WithAdminServer

PawContainer WithAdminServer(Tm1AdminServerContainer admin)

Lists the servers of a shared Admin Server, which must be on TM1's network.

AcceptLicense

PawContainer AcceptLicense()

Accepts IBM's PAW license (read it: licenses/LA_en in the zip).

WithSetting

PawContainer WithSetting(string name, string value)

Sets a paw-local.sh setting.

Throws

ArgumentException
It doesn't start with PAW_.

WithStartupTimeout

PawContainer WithStartupTimeout(TimeSpan timeout)

How long the first start (which loads IBM's images) may take.

Source

property
PawSource Source

Where PAW comes from.

Tm1Server

property
Tm1ServerContainer? Tm1Server

The TM1 server PAW logs users on to, or null.

IsRunning

property
bool IsRunning

Url

property
string Url

PAW's address on the Docker host.

Throws

InvalidOperationException
It isn't started.

StartAsync

Task StartAsync(CancellationToken cancellationToken = default)

StopAsync

Task StopAsync(CancellationToken cancellationToken = default)

DisposeAsync

ValueTask DisposeAsync()

Stops it.

ToString

string ToString()