-
Notifications
You must be signed in to change notification settings - Fork 190
Add docker-test skill for running commands in arcticdb Docker container #2947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||
| --- | ||||||
| name: docker-test | ||||||
| description: Run commands or tests inside the arcticdb Docker container | ||||||
| argument-hint: "[command]" | ||||||
| --- | ||||||
|
|
||||||
| Run commands or tests inside the arcticdb Docker container. | ||||||
|
|
||||||
| ## Usage | ||||||
|
|
||||||
| - `/docker-test` — start the container if not running, then open an interactive prompt for what to run | ||||||
| - `/docker-test pytest python/tests/unit/some_test.py` — run a specific test | ||||||
| - `/docker-test python -c "import arcticdb"` — run arbitrary command | ||||||
|
|
||||||
| ## Instructions | ||||||
|
|
||||||
| Container name: `arc-dev` | ||||||
| Image name: `arcticdb-env` | ||||||
| Dockerfile: `docker/Dockerfile` | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually subtly different from the docker images we use on the CI. For C++ test I think we use Dockerfile_clang and for python wheel we use the bespoke build_manylinux_image.sh. It might be useful to add some description of this and information of how the ghcr images are called so when you tell claude "Reproduce this failure on the CI within the docker image" it can figure out which image it needs to pull |
||||||
|
|
||||||
| ### 1. Ensure the image is built | ||||||
|
|
||||||
| Check if the image exists: | ||||||
| ```bash | ||||||
| docker image inspect arcticdb-env >/dev/null 2>&1 | ||||||
| ``` | ||||||
|
|
||||||
| If it doesn't exist, build it from the repo root: | ||||||
| ```bash | ||||||
| docker build -f docker/Dockerfile -t arcticdb-env . | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dockerfile path has diverged from the actual repo structure The skill says: But the actual file in the repo is docker build -f docker/Dockerfile -t arcticdb-env .Building from the repo root ( |
||||||
| ``` | ||||||
|
|
||||||
| ### 2. Ensure the container is running | ||||||
|
|
||||||
| Check if the container is running: | ||||||
| ```bash | ||||||
| docker ps --filter name=arc-dev --format '{{.Names}}' | grep -q arc-dev | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Container check is fragile when a stopped container exists The "is running" check is: docker ps --filter name=arc-dev --format '{{.Names}}' | grep -q arc-dev
The agent will likely hit the error before reaching step 3. A more robust ordering would be to check |
||||||
| ``` | ||||||
|
|
||||||
| If not running, start it with the repo mounted: | ||||||
| ```bash | ||||||
| docker run -d --name arc-dev -v "$(pwd)":/workspace -w /workspace arcticdb-env sleep infinity | ||||||
| ``` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
docker run -d --name arc-dev -v "$(pwd)":/workspace -w /workspace arcticdb-env sleep infinityWhen an AI agent executes this snippet inside a Consider documenting that this command must be run from the repository root, or replacing |
||||||
|
|
||||||
| If the container exists but is stopped, start it: | ||||||
| ```bash | ||||||
| docker start arc-dev | ||||||
| ``` | ||||||
|
|
||||||
| ### 3. Execute the command | ||||||
|
|
||||||
| Run the user's command inside the container: | ||||||
| ```bash | ||||||
| docker exec -w /workspace arc-dev $ARGUMENTS | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unquoted docker exec -w /workspace arc-dev $ARGUMENTS
Since the intended usage is to pass an arbitrary command string (e.g.
Suggested change
This makes it explicit that the full argument string is a shell command fragment, avoids unexpected word-splitting, and matches the interactive usage shown in the Usage section. |
||||||
| ``` | ||||||
|
|
||||||
| If no command was provided, ask the user what they want to run. | ||||||
|
|
||||||
| ### 4. Show results | ||||||
|
|
||||||
| Display the command output. If the command fails, help debug as usual. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No mention of what the Docker image actually provides / prerequisites
The Usage section jumps straight to example invocations without explaining what environment the container provides (Python version, whether ArcticDB is pre-installed or needs to be built, etc.). A developer encountering this skill for the first time won't know whether they need to build ArcticDB into the image first or whether
import arcticdbwill work out of the box.Adding a brief note like "The image is a build environment — ArcticDB must be installed into it (e.g. by running
pip install -ve .inside the container) before running tests" would significantly improve usability.