Skip to content

Commit 30addb8

Browse files
committed
RHOAIENG-9707: chore(tests/containers): update README.md with testcontainers motivation and lima section
1 parent 03dd8ee commit 30addb8

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ By completing configuration in previous section, you are able to run any tests t
8181
poetry run pytest
8282
```
8383

84+
##### Container selftests
85+
86+
We're using [Testcontainers.com](https://testcontainers.com/) to run containers from Python tests.
87+
88+
Ideally, these tests should allow switching between Kubernetes and Docker/Podman.
89+
Running on Kubernetes (OpenShift) is the easiest way to manage GPU access for testing TensorFlow/Pytorch images.
90+
This improvement is tracked as a future work.
91+
92+
We also considered [Dagger.io](https://dagger.io).
93+
It has very nice verbose logging by default for every action that is running.
94+
The main difference between the two is that Dagger creates more abstractions over the container engine.
95+
Dagger limitations that stem from tight [BuildKit](https://github.com/moby/buildkit) integration discouraged us from using it.
96+
Images present in a local store cannot be directly used in Dagger, they have to be imported into its BuildKit container first.
97+
In addition, Dagger [does not allow bind-mounting local directories](https://docs.dagger.io/cookbook/#modify-a-copied-directory-or-remote-repository-in-a-container)
98+
to the container but always copies files in and out.
99+
84100
#### Running testcontainers tests in Pytest
85101
```
86102
# Podman/Docker config
@@ -100,7 +116,16 @@ podman machine start
100116
poetry run pytest tests/containers --image quay.io/opendatahub/workbench-images@sha256:e98d19df346e7abb1fa3053f6d41f0d1fa9bab39e49b4cb90b510ca33452c2e4
101117
```
102118

103-
#### Running Playwright tests in Pytest
119+
When using lima on macOS, it might be useful to give yourself access to rootful podman socket
120+
121+
```shell
122+
lima sudo systemctl start podman
123+
lima sudo dnf install acl
124+
lima sudo setfacl -m u:${USER}:x /var/run/podman
125+
lima sudo setfacl -m u:${USER}:rw /var/run/podman/podman.sock
126+
```
127+
128+
#### Running Playwright tests
104129

105130
[tests/browser/README.md](tests/browser/README.md)
106131

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import logging
24

35
logging.basicConfig(level=logging.DEBUG)

0 commit comments

Comments
 (0)