Written by

IRIS Developer Advocate, Software developer at CaretDev, Tabcorp
Article Dmitry Maslennikov · Dec 14, 2023 1m read

Start IRIS in container from Python

I would like to share some of the latest projects I've implemented

It is based on Testcontainers project, and it allows, to start a container from Python, and it provides SQLAlchemy compatible URL to a working container

Mostly useful by using in tests, SQLAlchemy-iris project itself, uses this project in tests.

Give it a try, and download this demo from the project's repository

Comments

Dmitry Maslennikov · Dec 18, 2023

Also possible to use Enterprise license

import os
from testcontainers.iris import IRISContainer

license_key = os.path.abspath(os.path.expanduser("~/iris.key"))
image = 'containers.intersystems.com/intersystems/iris:2023.3'
container = IRISContainer(image, username="demo", password="demo", namespace="demo", license_key=license_key)
container.with_exposed_ports(1972, 52773)
container.start()
print('SQLAlchemy URL', container.get_connection_url())
print('Username', container.username)
print('Password', container.password)
0
Guillaume Rongier  Dec 18, 2023 to Dmitry Maslennikov

Great features, is possible to pass also an entrypoint script ?

Or is it only for vanilla versions ?

0
Dmitry Maslennikov  Dec 18, 2023 to Guillaume Rongier

There is a function `exec`, which may help to execute something after start, and has option to update the command using `with_command`

0