PawContainer
import { PawContainer } from "@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 tm1 = new Tm1ServerContainer(tm1Source);
await using paw = new PawContainer(pawSource).withTm1Server(tm1).acceptLicense();
await paw.start(); // starts tm1 first
return paw.getUrl(); // 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
acceptLicenseor 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 property | Accepts IBM's license for PAW when true. |
HOME_VOLUME property | The Docker volume holding the unpacked PAW Local zip and PAW's secrets, shared by every PAW started this way. |
PAW_NETWORK property | The network IBM's compose files put PAW on. |
ADMIN_PORT property | The Admin Server's REST port in a Tm1ServerContainer. |
PawContainer constructor | A PAW started from source's zip. |
shared static | The PAW most tests share. |
withTm1Server | Logs PAW users on to tm1, and lists servers from its Admin Server. |
withAdminServer | Lists servers from a separate Admin Server instead of the TM1 server's own. |
acceptLicense | Accepts IBM's license for Planning Analytics Workspace, which is in the PAW Local zip as licenses/LA_en. |
licenseAccepted | Whether acceptLicense or PAW_ACCEPT_LICENSE=true accepted IBM's license. |
settings | The settings set with withSetting. |
withSetting | Sets one of paw-local.sh's PAW_* settings, such as PAW_JVM_ARGS or PAW_TM1WEB_URL. |
withStartupTimeout | How long start may take to load IBM's images and start PAW, in milliseconds. |
getSource | Where PAW comes from. |
getTm1Server | The TM1 server set with withTm1Server, or undefined. |
isRunning | Whether PAW is started. |
getUrl | PAW's address as seen from the host, e.g. |
start | Starts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works. |
scriptSettings | paw-local.sh's settings for PAW against the TM1 server, without the ports. |
stop | Removes the PAW containers, keeping PAW's data. |
[Symbol.asyncDispose] | Stops it, for await using. |
licenseAcceptedBySetting static | Whether IBM's PAW license is accepted by the PAW_ACCEPT_LICENSE setting. |
script static | paw-local.sh, as this package ships it (or, in this repository, docker/paw's). |
toString | Where PAW comes from, and its address once it runs, for logs. |
ACCEPT_LICENSE
propertystatic ACCEPT_LICENSEAccepts IBM's license for PAW when true.
HOME_VOLUME
propertystatic HOME_VOLUMEThe Docker volume holding the unpacked PAW Local zip and PAW's secrets, shared by every PAW started this way.
PAW_NETWORK
propertystatic PAW_NETWORKThe network IBM's compose files put PAW on.
ADMIN_PORT
propertystatic ADMIN_PORTThe Admin Server's REST port in a Tm1ServerContainer.
PawContainer
constructorconstructor(source: PawSource)A PAW started from source's zip.
withTm1Server
withTm1Server(tm1: Tm1ServerContainer): thisLogs PAW users on to tm1, and lists servers from its Admin Server. Starts tm1 first if it isn't running.
withAdminServer
withAdminServer(admin: Tm1AdminServerContainer): thisLists servers from a separate 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.
acceptLicense
acceptLicense(): thisAccepts IBM's license for Planning Analytics Workspace, which is in the PAW Local zip as licenses/LA_en.
licenseAccepted
licenseAccepted(): booleanWhether acceptLicense or PAW_ACCEPT_LICENSE=true accepted IBM's license.
settings
settings(): ReadonlyMap<string, string>The settings set with withSetting.
withSetting
withSetting(name: string, value: string): thisSets one of paw-local.sh's PAW_* settings, such as PAW_JVM_ARGS or PAW_TM1WEB_URL. The TM1 server, ports, network and paths are set by this class.
Throws
- IllegalArgumentException if
namedoesn't start withPAW_
withStartupTimeout
withStartupTimeout(timeout: number): thisHow long start may take to load IBM's images and start PAW, in milliseconds. Default: 20 minutes.
getSource
getSource(): PawSourceWhere PAW comes from.
getTm1Server
getTm1Server(): Tm1ServerContainer | undefinedThe TM1 server set with withTm1Server, or undefined.
isRunning
isRunning(): booleanWhether PAW is started: true between start and stop.
getUrl
getUrl(): stringPAW's address as seen from the host, e.g. http://localhost:54321/.
Throws
- IllegalStateException if PAW isn't started
start
start(): Promise<void>Starts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works.
Throws
- IllegalStateException if the license isn't accepted or no TM1 server is set
scriptSettings
scriptSettings(tm1Address: string, adminAddress: string, cognosUrl: string | undefined): Record<string, string>paw-local.sh's settings for PAW against the TM1 server, without the ports: the caller's own, then this class's wiring. With the server in CAM security, PAW logs users on through its Cognos and namespace.
Parameters
tm1Address- the TM1 server's address on its network
adminAddress- the Admin Server's address on that network
cognosUrl- Cognos as the host sees it (
CognosContainer.getUrl()), where PAW sends browsers to log on;undefinedunless the server is in CAM security
stop
stop(): Promise<void>Removes the PAW containers, keeping PAW's data.
[Symbol.asyncDispose]
[Symbol.asyncDispose](): Promise<void>Stops it, for await using: the same as stop.
licenseAcceptedBySetting
staticstatic licenseAcceptedBySetting(): booleanWhether IBM's PAW license is accepted by the PAW_ACCEPT_LICENSE setting.
script
staticstatic script(): Bufferpaw-local.sh, as this package ships it (or, in this repository, docker/paw's).
toString
toString(): stringWhere PAW comes from, and its address once it runs, for logs.