Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
40 changes: 40 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Kruize Optimizer Documentation

Welcome to the Kruize Optimizer documentation! This guide will help you understand, install, configure, and contribute to the Kruize Optimizer project.

## 📚 Documentation Overview

- **[Installation Guide](installation.md)** - Step-by-step instructions to install and deploy Kruize Optimizer
- **[Build Guide](build.md)** - Instructions for building and pushing Docker images
- **[Design Documentation](design.md)** - Architecture, design principles, and system components
- **[Optimizer API Reference](optimizerAPI.md)** - Complete API documentation with endpoints and examples
- **[Configuration Guide](configurables.md)** - Available configuration options and how to customize them
- **[Contributing Guide](contributing.md)** - How to contribute to the project, including testing guidelines

## 🚀 Quick Start

1. Follow the [Installation Guide](installation.md) to set up Kruize Optimizer
2. Review the [Configuration Guide](configurables.md) to customize your deployment
3. Explore the [API Reference](optimizerAPI.md) to integrate with your applications
4. Check the [Design Documentation](design.md) to understand the architecture

## 🤝 Getting Help

- **Issues**: Report bugs or request features on [GitHub Issues](https://github.com/kruize/kruize-optimizer/issues)
- **Discussions**: Join conversations on [GitHub Discussions](https://github.com/kruize/kruize-optimizer/discussions)
- **Contributing**: See our [Contributing Guide](contributing.md) for how to get involved

## 📖 Additional Resources

- [Main README](../README.md) - Project overview and quick start
- [Test Documentation](../src/test/README.md) - Testing guidelines and test structure
- [KRUIZE DOCS](https://github.com/kruize/autotune/tree/master/design) - Kruize product documentation
- [KRUIZE OPERATOR](https://github.com/kruize/kruize-operator/) - Kruize Operator

## 🔄 Documentation Updates

This documentation is continuously updated. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request following our [Contributing Guide](contributing.md).

---

**Last Updated**: 2026-05-05
167 changes: 167 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Build Guide

This guide explains how to build and push Docker images for Kruize Optimizer.

## Table of Contents

- [Overview](#overview)
- [Build Script](#build-script)
- [Build Options](#build-options)
- [Examples](#examples)

## Overview

Kruize Optimizer provides a convenient build script ([`build_and_push.sh`](../build_and_push.sh)) that simplifies building and pushing Docker images. The script uses Quarkus Jib extension for efficient container image creation.


### Configure Registry Credentials

For pushing to container registries:

```bash
# For Quay.io
docker login quay.io

# For Docker Hub
docker login

# For other registries
docker login <registry-url>
```

## Build Script

The build script is located at the root of the repository: [`build_and_push.sh`](../build_and_push.sh)

### Basic Usage

```bash
./build_and_push.sh [OPTIONS]
```

### Script Options

| Option | Description | Default |
|--------|-------------|---------|
| `-i IMAGE_NAME` | Full image name (registry/repository:tag) | quay.io/kruize/optimizer:0.1 |
| `-t TAG` | Image tag (used if -i not provided) | 0.1 |
| `-b BUILD` | Build image (true/false) | true |
| `-p PUSH` | Push image (true/false) | true |
| `-l PLATFORMS` | Target platforms | linux/amd64,linux/arm64 |
| `-h` | Show help message | - |

**Note**: Use either `-i` for full image name OR `-t` for tag with default registry/repo.

## Build Options

### 1. Build Only (No Push)

Build the image locally without pushing to a registry:

```bash
./build_and_push.sh -p false
```

### 2. Build and Push with Custom Tag

Build and push with a specific tag:

```bash
./build_and_push.sh -t 1.0.0
```

This creates: `quay.io/kruize/optimizer:1.0.0`

### 3. Build and Push with Full Image Name

Specify the complete image name including registry:

```bash
./build_and_push.sh -i quay.io/myuser/kruize-optimizer:1.0.0
```

### 4. Build for Specific Platform

Build for a single platform (faster):

```bash
./build_and_push.sh -l linux/amd64 -p false
```

### 5. Multi-Platform Build

Build for multiple platforms (default):

```bash
./build_and_push.sh -l linux/amd64,linux/arm64
```

## Examples

### Example 1: Local Development Build

Build locally for testing without pushing:

```bash
./build_and_push.sh -t dev -p false -l linux/amd64
```

### Example 2: Release Build

Build and push a release version:

```bash
./build_and_push.sh -t 1.0.0
```

### Example 3: Custom Registry

Build and push to a custom registry:

```bash
./build_and_push.sh -i myregistry.com/kruize/optimizer:latest
```

### Example 4: Build Only for Testing

Build without pushing to test changes:

```bash
./build_and_push.sh -b true -p false
```


## Manual Build

If you prefer to build manually without the script:

### Using Maven with Quarkus Jib

```bash
# Build only
./mvnw clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=false

# Build and push
./mvnw clean package \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.image=quay.io/kruize/optimizer:1.0.0 \
-Dquarkus.container-image.push=true \
-Dquarkus.jib.platforms=linux/amd64,linux/arm64
```

### Using Docker Directly

```bash
# Build JVM image
docker build -f src/main/docker/Dockerfile.jvm -t kruize-optimizer:latest .

# Build native image (requires GraalVM)
docker build -f src/main/docker/Dockerfile.native -t kruize-optimizer:native .
```


---

**Last Updated**: 2026-05-05
Loading
Loading