Skip to content

Commit

Permalink
Documentation: Improve "Container Usage" page
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 12, 2023
1 parent d23e335 commit f114295
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


## in progress

- Documentation: Improve "Container Usage" page

## 2023-09-12 0.1.0
- Initial thing, proof-of-concept
Expand Down
30 changes: 30 additions & 0 deletions docs/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ each PR, as well as `nightly` ones.

## Docker and Podman

This section demonstrates how to use the OCI images using Docker. Podman
can also be used by replacing the `docker` command with `podman`.


### Prerequisites

The following command line examples for both "Standalone" and "Tracking Server"
variants have been written to use a CrateDB instance running on `localhost`.
This command starts it, also using Docker.

```shell
docker run --rm -it \
--name=cratedb --publish=4200:4200 --publish=5432:5432 \
--env=CRATE_HEAP_SIZE=4g crate \
-Cdiscovery.type=single-node
```


### Standalone

In order to instruct MLflow to submit the experiment metadata directly to CrateDB,
Expand All @@ -35,17 +53,28 @@ docker run --rm -it --link=cratedb \
ghcr.io/crate-workbench/ml-runtime python /opt/ml/bin/tracking_dummy.py
```

You can use `crash` to inquire the relevant MLflow database tables.
```shell
docker run --rm -it --link=cratedb ghcr.io/crate-workbench/ml-runtime \
crash --hosts="http://crate@cratedb:4200/" --schema=mlflow --command='SELECT * FROM "experiments";'
docker run --rm -it --link=cratedb ghcr.io/crate-workbench/ml-runtime \
crash --hosts="http://crate@cratedb:4200/" --schema=mlflow --command='SELECT * FROM "runs";'
```


### Tracking Server

When running the MLflow Server within a container, you will need to address the
CrateDB container by name instead of using `localhost`.

```shell
export CRATEDB_SQLALCHEMY_URL="crate://crate@cratedb:4200/?schema=mlflow"
```

Start the MLflow Server, linking it to the other container running CrateDB,
and exposing its HTTP port 5000 to your machine, serving the HTTP API
and the web UI, see http://localhost:5000/.

```shell
docker run --rm -it --name=mlflow --link=cratedb --publish=5000:5000 \
ghcr.io/crate-workbench/mlflow-cratedb mlflow-cratedb server \
Expand All @@ -56,6 +85,7 @@ docker run --rm -it --name=mlflow --link=cratedb --publish=5000:5000 \
Start an experiment program which needs to access both CrateDB and MLflow,
for storing data and recording experiment metadata, linking it to both
other containers.

```shell
docker run --rm -it --link=cratedb --link=mlflow \
--env="MLFLOW_TRACKING_URI=http://mlflow:5000" \
Expand Down

0 comments on commit f114295

Please sign in to comment.