Skip to content

Commit

Permalink
Link KIND deployment on main README
Browse files Browse the repository at this point in the history
* Add link to KIND deployment doc
* Update the script that checks for broken links
* Fix broken links in usage steps and API README
* Update the resource requirements for KIND
* Add a deployment wait-loop for KIND
* Update the import assets documentation

Related machine-learning-exchange#266

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
  • Loading branch information
ckadner committed Dec 5, 2021
1 parent 2a1f2ea commit 25537c5
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 15 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ Additionally it provides:
## 1. Deployment
<img src="docs/images/mlx-architecture-4.png" height="40%" width="40%">

For a simple up-and-running MLX with asset catalog only, we created a [Quickstart Guide](./quickstart) using [Docker Compose](https://docs.docker.com/compose/install/).
For a simple up-and-running MLX with asset catalog only, we created a [Quickstart Guide](./quickstart)
using [Docker Compose](https://docs.docker.com/compose/install/).

For a slightly more resource-hungry local deployment that allows pipeline execution, we created the
[MLX with Kubernetes in Docker (KIND)](./docs/install-mlx-on-kind.md) deployment option.

For a full deployment, we use [Kubeflow Kfctl](https://github.com/kubeflow/kfctl) tooling.

* #### [MLX using Docker Compose (Asset Catalog Only)](./quickstart)

* #### [MLX on Kubernetes in Docker (Fully Featured)](./docs/install-mlx-on-kind.md)

* #### [MLX Deployment on Kubernetes or OpenShift](./docs/mlx-setup.md)

* #### [MLX on an existing Kubeflow Cluster](./docs/install-mlx-on-kubeflow.md)
Expand Down
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ download it the first time it runs:
# function swagger-codegen() { java -jar "swagger-codegen-cli-2.4.8.jar" "$@"; }
# export -f swagger-codegen

It is **not recommended** to install [`swagger-codegen@2`](https://formulae.brew.sh/formula-linux/swagger-codegen@2)
It is **not recommended** to install [`swagger-codegen@2`](https://formulae.brew.sh/formula/swagger-codegen@2)
via [Homebrew](https://docs.brew.sh/Installation) on macOS, since `brew install swagger-codegen@2`
does not allow selecting the _"old"_ version `2.4.8`. Instead, the `generate_code.sh` script
will automatically download the _"correct"_ version of the `swagger-codegen-cli.jar` file.
Expand Down
18 changes: 15 additions & 3 deletions docs/import-assets.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Import Data and AI Assets in MLX Catalog

To import a catalog of assets first click on the three dots at the bottom of the left navigation bar and then click on `MLX Settings`. Then select `Choose Catalog` under the `Bulk Imports` sections. Find and select the [JSON file](/bootstrapper/catalog_upload.json) that describes your catalog and then your import will begin. A progress bar will appear to indicate upload progress.
To _import a catalog of assets_ you must be logged in as an `admin`. To log in, append `/#` to the
MLX URL in your browser's address bar:

If an asset exists in your Catalog, but has not been imported then make sure that all the info provided in the Catalog (API Key, Asset URL, etc.) is correct. If it is correct, ensure that the asset you are trying to import does not share a name/ID with another asset.
http://mlx-ui-url/#

![Catalog Import Screenshot](/docs/images/CatalogImport.png)
Then expand the :gear: **Settings** at the bottom of the left-hand side navigation bar, and click on
**MLX Settings**. At the top of the center screen, click on the **Choose Catalog** button under
the **Bulk Imports** sections.

Find and select the [JSON file](/bootstrapper/catalog_upload.json) that describes your catalog
and the import should begin. A progress bar will indicate the upload progress.

If an asset from your Catalog did not get imported, make sure that all the metadata provided in the
Catalog upload file is correct (API Key, Asset URL, etc.). If it is correct, ensure that the
asset you are trying to import does not share a name/ID with another asset.

![Catalog Import Screenshot](/docs/images/CatalogImport.png)
34 changes: 26 additions & 8 deletions docs/install-mlx-on-kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ you could download the `kustomize` `v3.2.0` binary as described

Increase the default resources for Docker:

- CPUs: 4 Cores
- Memory: 8 GB RAM
- CPUs: 8 Cores
- Memory: 16 GB RAM
- Disk: 32+ GB

**Note**: We found that on older laptops, like a 2016 15 in MacBook Pro (2.7 GHz i7, 16 GB) the MLX
**Note**: We found that on older laptops, like a 2016 MacBook Pro (2.7 GHz i7, 16 GB RAM) the MLX
deployment on KIND may require to give all available resources to the Docker daemon in order to be
able to deploy the manifests and run basic pipelines. Even then, trying to run notebooks or deploying
a model, will cause the laptop to get very slow with fans running full throttle. It may even cause
Expand All @@ -66,19 +66,37 @@ kubectl get pods --all-namespaces
git clone https://github.com/IBM/manifests -b v1.4.0-mlx
cd manifests

# run the below command two times if the CRDs take too long to provision.
# run the below command two times if the CRDs take too long to provision
while ! kustomize build mlx-single-kind | \
kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done

# wait while the MLX deployment is starting up, may take 10 to 20 minutes
while $( kubectl get pods --all-namespaces | grep -q -v "STATUS\|Running" ); do \
echo "Hold tight, still waiting for $( kubectl get pods --all-namespaces | grep -v "STATUS\|Running" | wc -l ) pods ..."; \
sleep 10; \
done

# check pod status
kubectl get pods --all-namespaces

# make the MLX UI available to your local browser on http://localhost:3000/
kubectl port-forward -n istio-system svc/istio-ingressgateway 3000:80
kubectl port-forward -n istio-system svc/istio-ingressgateway 3000:80 &
```

Now paste the URL http://localhost:3000/ into your browser and proceed to
[import the MLX catalog](import-assets.md).
Now paste the URL http://localhost:3000/# into your browser and proceed to
[import the MLX catalog](import-assets.md), or, upload the assets from the
[default MLX asset catalog](https://github.com/machine-learning-exchange/katalog)
using the MLX API directly with `curl`:

```Bash
UPLOAD_API="http://localhost:3000/apis/v1alpha1/catalog/upload_from_url"
CATALOG_URL="https://raw.githubusercontent.com/machine-learning-exchange/mlx/main/bootstrapper/catalog_upload.json"

curl -X POST \
-H "Content-Type: multipart/form-data" \
-F url="${CATALOG_URL}" \
-s "${UPLOAD_API}" | grep -iE "total_|error"
```

Delete the `mlx` cluster when it is no longer needed:

Expand All @@ -87,7 +105,7 @@ kind delete cluster --name mlx
```


## Install Kubeflow Pipelines (for reference, optional)
## Install Kubeflow Pipelines (for Reference only, Optional)

```Bash
kind create cluster --name kfp
Expand Down
2 changes: 1 addition & 1 deletion docs/usage-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

3. [Models](../models/README.md)
- [Create Model Metadata](../models/README.md#Create-Model-Metadata)
- [Register Model](./models/README.md#Register-Model)
- [Register Model](../models/README.md#Register-Model)
- [Use Models in Pipelines](../models/README.md#Use-Models-in-Pipelines)
- [Model Metadata Template](../models/template.yaml)

Expand Down
3 changes: 2 additions & 1 deletion tools/python/verify_doc_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def get_links_from_md_file(md_file_path: str) -> [(int, str, str)]: # -> [(line,

# find plain http(s)-style links
for url in re.findall(r"[\n\r\s\"'](https?://[^\s]+)[\n\r\s\"']", line_text):
if not any(s in url for s in ["localhost", "...", "lorem", "ipsum", "/path/to/", "address", "port"]):
if not any(s in url for s in
["localhost", "...", "lorem", "ipsum", "/path/to/", "address", "port", "${OS}"]):
try:
parse_url(url)
line_text_url.append((line_number + 1, "", url))
Expand Down

0 comments on commit 25537c5

Please # to comment.