skipcheck

TM1 Testcontainers · Docs · Containers

PawContainer

from skipcheck_tm1_testcontainers import PawContainer

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

# Entering the blocks starts TM1, then PAW; leaving them stops both
with Tm1ServerContainer(tm1_source) as tm1, PawContainer(paw_source).with_tm1_server(tm1).accept_license() as paw:
    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.with_cam_security), 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 accept_license 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 RequiresPaw.
  • 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: stop 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

ACCEPT_LICENSEAccepts IBM's license for PAW when True.
HOME_VOLUMEThe Docker volume holding the unpacked PAW Local zip and PAW's secrets, shared by every PAW started this way.
PAW_NETWORK
ADMIN_PORT
__init__ constructorA PAW started from source's zip.
shared staticOne PAW for every test in this process, logging on to Tm1ServerContainer.shared.
with_tm1_serverLogs PAW users on to tm1, and lists servers from its Admin Server.
with_admin_serverLists servers from a separate Admin Server (Tm1ServerContainer.with_admin_server) instead of the TM1 server's own.
accept_licenseAccepts IBM's PAW license (licenses/LA_en in the zip), as PAW_ACCEPT_LICENSE=true.
with_settingA paw-local.sh setting (PAW_…).
with_startup_timeoutSeconds to wait for paw-local.sh up (default 20 minutes.
source propertyWhere PAW comes from.
tm1_server propertyThe TM1 server set with with_tm1_server, or None if none was set.
is_running propertyWhether PAW is started.
url propertyPAW's address as seen from the host, such as http://localhost:54321/, ending in /.
startStarts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works.
stopRemoves the PAW containers, keeping PAW's data.
closeThe same as stop.
license_accepted_by_setting staticWhether IBM's PAW license is accepted by the PAW_ACCEPT_LICENSE setting.

ACCEPT_LICENSE

ACCEPT_LICENSE: ClassVar[str]

Accepts IBM's license for PAW when True. Read as a system property, then an environment variable.

HOME_VOLUME

HOME_VOLUME: ClassVar[str]

The Docker volume holding the unpacked PAW Local zip and PAW's secrets, shared by every PAW started this way.

PAW_NETWORK

PAW_NETWORK: ClassVar[str]

ADMIN_PORT

ADMIN_PORT: ClassVar[int]

__init__

constructor
__init__(source: PawSource) -> None

A PAW started from source's zip.

shared

static
shared() -> PawContainer

One PAW for every test in this process, logging on to Tm1ServerContainer.shared. A failed start isn't retried: later calls fail at once.

with_tm1_server

with_tm1_server(tm1: Tm1ServerContainer) -> Self

Logs PAW users on to tm1, and lists servers from its Admin Server. Starts tm1 first if it isn't running.

with_admin_server

with_admin_server(admin: Tm1AdminServerContainer) -> Self

Lists servers from a separate Admin Server (Tm1ServerContainer.with_admin_server) instead of the TM1 server's own. Users still log on through that TM1 server, which must be registered with this Admin Server and on its network.

accept_license

accept_license() -> Self

Accepts IBM's PAW license (licenses/LA_en in the zip), as PAW_ACCEPT_LICENSE=true.

with_setting

with_setting(name: str, value: str) -> Self

A paw-local.sh setting (PAW_…).

with_startup_timeout

with_startup_timeout(timeout: float) -> Self

Seconds to wait for paw-local.sh up (default 20 minutes: the first start loads IBM's images).

source

property
source: PawSource

Where PAW comes from.

tm1_server

property
tm1_server: Tm1ServerContainer | None

The TM1 server set with with_tm1_server, or None if none was set.

is_running

property
is_running: bool

Whether PAW is started: true between start and stop.

url

property
url: str

PAW's address as seen from the host, such as http://localhost:54321/, ending in /. A RuntimeError if PAW isn't started.

start

start() -> None

Starts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works. A RuntimeError if the license isn't accepted or no TM1 server is set.

stop

stop() -> None

Removes the PAW containers, keeping PAW's data.

close

close() -> None

The same as stop.

license_accepted_by_setting

static
license_accepted_by_setting() -> bool

Whether IBM's PAW license is accepted by the PAW_ACCEPT_LICENSE setting: true if it's set to true.