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_licenseor by settingPAW_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, withRequiresPaw. - 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:
stopremoves 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_LICENSE | Accepts IBM's license for PAW when True. |
HOME_VOLUME | The Docker volume holding the unpacked PAW Local zip and PAW's secrets, shared by every PAW started this way. |
PAW_NETWORK | |
ADMIN_PORT | |
__init__ constructor | A PAW started from source's zip. |
shared static | One PAW for every test in this process, logging on to Tm1ServerContainer.shared. |
with_tm1_server | Logs PAW users on to tm1, and lists servers from its Admin Server. |
with_admin_server | Lists servers from a separate Admin Server (Tm1ServerContainer.with_admin_server) instead of the TM1 server's own. |
accept_license | Accepts IBM's PAW license (licenses/LA_en in the zip), as PAW_ACCEPT_LICENSE=true. |
with_setting | A paw-local.sh setting (PAW_…). |
with_startup_timeout | Seconds to wait for paw-local.sh up (default 20 minutes. |
source property | Where PAW comes from. |
tm1_server property | The TM1 server set with with_tm1_server, or None if none was set. |
is_running property | Whether PAW is started. |
url property | PAW's address as seen from the host, such as http://localhost:54321/, ending in /. |
start | Starts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works. |
stop | Removes the PAW containers, keeping PAW's data. |
close | The same as stop. |
license_accepted_by_setting static | Whether 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.
with_tm1_server
with_tm1_server(tm1: Tm1ServerContainer) -> SelfLogs 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) -> SelfLists 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() -> SelfAccepts IBM's PAW license (licenses/LA_en in the zip), as PAW_ACCEPT_LICENSE=true.
with_setting
with_setting(name: str, value: str) -> SelfA paw-local.sh setting (PAW_…).
with_startup_timeout
with_startup_timeout(timeout: float) -> SelfSeconds to wait for paw-local.sh up (default 20 minutes: the first start loads IBM's images).
source
propertysource: PawSourceWhere PAW comes from.
tm1_server
propertytm1_server: Tm1ServerContainer | NoneThe TM1 server set with with_tm1_server, or None if none was set.
is_running
propertyis_running: boolWhether PAW is started: true between start and stop.
url
propertyurl: strPAW's address as seen from the host, such as http://localhost:54321/, ending in /. A RuntimeError if PAW isn't started.
start
start() -> NoneStarts 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() -> NoneRemoves the PAW containers, keeping PAW's data.
close
close() -> NoneThe same as stop.
license_accepted_by_setting
staticlicense_accepted_by_setting() -> boolWhether IBM's PAW license is accepted by the PAW_ACCEPT_LICENSE setting: true if it's set to true.