Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
---
title: Push ModelPack to Harbor
description: Package a model as a ModelPack using modctl and push it to Harbor for use in OtterScale.
---

import { Steps, Aside } from '@astrojs/starlight/components';

This guide walks through how to package a model as a ModelPack using `modctl` and push it to a Harbor registry for use in OtterScale.

---

## Prerequisites

Before you begin, make sure:

- You have access to **OtterScale** and **Harbor**
- `modctl` is installed on your local machine
- Docker is installed and running
- You have permission to create **Robot Accounts** in the target Harbor project

---

## Step 1. Navigate to Harbor from OtterScale

1. In the **OtterScale** UI, locate the left-side navigation bar.
2. Click **Registry**.
3. You will be redirected to the Harbor UI associated with your OtterScale environment.
Comment on lines +25 to +27
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the Steps component is already imported, it should be used to wrap numbered lists to provide a better visual representation of the workflow in the Starlight theme. This should also be applied to other multi-step lists in the document.

<Steps>
1. In the **OtterScale** UI, locate the left-side navigation bar.
2. Click **Registry**.
3. You will be redirected to the Harbor UI associated with your OtterScale environment.
</Steps>


> OtterScale uses Harbor as its OCI registry for storing model artifacts such as ModelPack.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use the <Aside> component instead of a standard blockquote for better visual integration and to match the existing imports.

<Aside type="note">
  OtterScale uses Harbor as its OCI registry for storing model artifacts such as ModelPack.
</Aside>


---

## Step 2. Create a Robot Account in Harbor

Robot Accounts are recommended for CLI and automation access (for example, `docker` and `modctl`).

1. In Harbor, select the target **Project** from the left sidebar.
2. Navigate to **Robot Accounts**.
3. Click **New Robot Account**.

---

## Step 3. Configure Robot Account Permissions

Configure the Robot Account with the following settings:

- **Name**: for example, `modctl-pusher`
- **Scope**: select the target project
- **Permissions**:
- Repository → ✅ Pull
- Repository → ✅ Push

Click **Create**.

After creation, Harbor will display:

- **Username** (for example: `robot$my_project+modctl-pusher`)
- **Token (Password)**

> ⚠️ The token is shown only once. Make sure to copy and store it securely.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This security warning is important. Using <Aside type="caution"> will make it much more prominent and consistent with the documentation style. The emoji can be removed as the component provides its own icon.

<Aside type="caution">
  The token is shown only once. Make sure to copy and store it securely.
</Aside>


---

## Step 4. Log in to Harbor using Docker

`modctl` reuses Docker’s OCI credentials, so you must log in using Docker first.

```bash
docker login <harbor-host:port>
```

### Example

```bash
docker login 127.0.0.1:32180
```

When prompted, enter:

- **Username**: the Robot Account username
- **Password**: the Robot Account token

### Note for HTTP Harbor Registries

If your Harbor registry is **HTTP-only**, ensure it is configured as an insecure registry in Docker:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is helpful to specify that this configuration belongs in the Docker daemon.json file and mention its typical location (e.g., /etc/docker/daemon.json on Linux or via Docker Desktop settings).


```json
{
"insecure-registries": [
"127.0.0.1:32180"
]
}
```

After updating the configuration, restart Docker.

---

## Step 5. Build the ModelPack

Navigate to your ModelPack project directory and run:

```bash
modctl build -t <REGISTRY/PROJECT/NAME:TAG> .
```

### Example

```bash
modctl build -t 127.0.0.1:32180/my_projects/my_project001:0.1.0 .
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The project name my_projects/my_project001 is inconsistent with the robot account example my_project used in Step 3. Using a consistent project name like my_project/my-model throughout the guide prevents confusion.

modctl build -t 127.0.0.1:32180/my_project/my-model:0.1.0 .

```

This command:

- Reads the ModelPack specification in the current directory
- Packages the model into an OCI artifact
- Tags it with the specified registry reference

---

## Step 6. Push the ModelPack to Harbor

Push the built ModelPack to Harbor:

```bash
modctl push <REGISTRY/PROJECT/NAME:TAG>
```

### Example

```bash
modctl push 127.0.0.1:32180/my_projects/my_project001:0.1.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update this example to match the project name used in the previous steps for consistency.

modctl push 127.0.0.1:32180/my_project/my-model:0.1.0

```

If your Harbor registry uses HTTP, include:

```bash
modctl push --plain-http 127.0.0.1:32180/my_projects/my_project001:0.1.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Update this example to match the project name used in the previous steps for consistency.

modctl push --plain-http 127.0.0.1:32180/my_project/my-model:0.1.0

```

---

## Verify in Harbor

After the push succeeds:

1. Open the Harbor UI.
2. Navigate to the target project.
3. Confirm the repository and tag appear under **Repositories**.

The ModelPack is now available for use in OtterScale.

---

## Common Issues

### Unauthorized / 401 errors

Ensure you are using a Harbor **Robot Account**, not a Keycloak user.

### HTTPS / HTTP mismatch

Configure Docker `insecure-registries` and use `--plain-http` with `modctl` when pushing.

### Project does not exist

Harbor projects must be created before pushing artifacts.

---

## Summary

- Harbor stores ModelPack as OCI artifacts
- Robot Accounts are required for CLI access
- `modctl build` creates the ModelPack
- `modctl push` uploads it to Harbor
- OtterScale can then reference the artifact by tag or digest
Loading