-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: RJ Sampson <rj.sampson@chainguard.dev>
- Loading branch information
Showing
8 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!--monopod:start--> | ||
# mlflow | ||
| | | | ||
| - | - | | ||
| **OCI Reference** | `cgr.dev/chainguard/mlflow` | | ||
|
||
|
||
* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/mlflow/overview/) | ||
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags. | ||
* [Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.* | ||
|
||
--- | ||
<!--monopod:end--> | ||
|
||
<!--overview:start--> | ||
A minimal, [Wolfi](https://github.com/wolfi-dev)-based image for MLflow, an open source platform for the machine learning lifecycle. | ||
|
||
<!--overview:end--> | ||
|
||
<!--getting:start--> | ||
## Download this Image | ||
The image is available on `cgr.dev`: | ||
|
||
``` | ||
docker pull cgr.dev/chainguard/mlflow:latest | ||
``` | ||
<!--getting:end--> | ||
|
||
<!--body:start--> | ||
### MLflow Usage | ||
|
||
MLflow's default entrypoint is Python, enabling us to run projects directly: | ||
|
||
```bash | ||
docker run -it cgr.dev/chainguard/mlflow:latest <your project>.py | ||
``` | ||
|
||
### MLflow Tracking Usage | ||
|
||
MLflow provides a UI, MLflow Tracking, allowing the user to track 'runs' (executions of data science code) via visualizations of metrics, parameters, and artifacts. | ||
|
||
To start the UI, open a terminal and run: | ||
|
||
```bash | ||
docker run -it -p 5000:5000 --entrypoint mlflow cgr.dev/chainguard/mlflow:latest ui | ||
``` | ||
|
||
While the UI defaults to running on port 5000, you can use a different port via passing `-p <PORT>` as a command line option. Ensure Docker also maps to the correct port. | ||
|
||
You should now be able to access the UI at [localhost:5000](http://localhost:5000). | ||
|
||
For additional documentation covering MLflow Tracking, see the [official docs](https://mlflow.org/docs/latest/tracking.html). | ||
|
||
<!--body:end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
variable "extra_packages" { | ||
description = "Additional packages to install." | ||
type = list(string) | ||
default = [ | ||
"busybox", | ||
"git", | ||
"mlflow", | ||
] | ||
} | ||
|
||
variable "environment" { | ||
default = {} | ||
} | ||
|
||
module "accts" { | ||
source = "../../../tflib/accts" | ||
} | ||
|
||
output "config" { | ||
value = jsonencode({ | ||
contents = { | ||
packages = var.extra_packages | ||
} | ||
accounts = module.accts.block | ||
environment = merge({ | ||
"PATH" : "/usr/share/mlflow/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", | ||
}, var.environment) | ||
entrypoint = { | ||
command = "/usr/share/mlflow/bin/python3" | ||
} | ||
}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
variable "target_repository" { | ||
description = "The docker repo into which the image and attestations should be published." | ||
} | ||
|
||
module "config" { | ||
source = "./config" | ||
} | ||
|
||
module "latest" { | ||
source = "../../tflib/publisher" | ||
name = basename(path.module) | ||
target_repository = var.target_repository | ||
config = module.config.config | ||
build-dev = true | ||
} | ||
|
||
module "test" { | ||
source = "./tests" | ||
digest = module.latest.image_ref | ||
} | ||
|
||
resource "oci_tag" "latest" { | ||
depends_on = [module.test] | ||
digest_ref = module.latest.image_ref | ||
tag = "latest" | ||
} | ||
|
||
resource "oci_tag" "latest-dev" { | ||
depends_on = [module.test] | ||
digest_ref = module.latest.dev_ref | ||
tag = "latest-dev" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: mlflow | ||
image: cgr.dev/chainguard/mlflow | ||
logo: https://storage.googleapis.com/chainguard-academy/logos/mlflow.svg | ||
endoflife: "" | ||
console_summary: "" | ||
short_description: | | ||
A minimal, [Wolfi](https://github.com/wolfi-dev)-based image for MLflow, an open source platform for the machine learning lifecycle. | ||
compatibility_notes: "" | ||
readme_file: README.md | ||
upstream_url: https://mlflow.org/ | ||
keywords: | ||
- ai | ||
- python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o errtrace -o pipefail -x | ||
|
||
cwd=$(cd "${0%/*}" && pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
imagetest = { source = "chainguard-dev/imagetest" } | ||
} | ||
} | ||
|
||
variable "digest" { | ||
description = "The image digest to run tests over." | ||
} | ||
|
||
data "imagetest_inventory" "this" {} | ||
|
||
resource "imagetest_container_volume" "volume" { | ||
name = "scratch-volume" | ||
inventory = data.imagetest_inventory.this | ||
} | ||
|
||
resource "imagetest_harness_docker" "this" { | ||
name = "jre" | ||
inventory = data.imagetest_inventory.this | ||
|
||
mounts = [{ | ||
source = path.module | ||
destination = "/tests" | ||
}] | ||
|
||
envs = { | ||
"IMAGE_NAME" : var.digest | ||
} | ||
} | ||
|
||
resource "imagetest_feature" "basic" { | ||
name = "Test MLflow" | ||
harness = imagetest_harness_docker.this | ||
|
||
steps = [{ | ||
name = "Import test" | ||
cmd = <<EOT | ||
docker run --rm $IMAGE_NAME -m mlflow | ||
EOT | ||
}] | ||
} |