Skip to content

Commit

Permalink
docs: added detailed docs, updated gitignore, fixed incorrect copy in…
Browse files Browse the repository at this point in the history
… Dockerfile

Signed-off-by: Neko Ayaka <[email protected]>
  • Loading branch information
nekomeowww committed Apr 16, 2024
1 parent 7086ca4 commit 5b8cc67
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 590 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
bin/*
Dockerfile.cross

# Built application files
dist/

# Test binary, built with `go test -c`
*.test

Expand Down
74 changes: 73 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,53 @@
- `kubectl` version `v1.11.3+`.
- Access to a Kubernetes `v1.11.3+` cluster (Either kind, minikube is suitable for local development).

## Development

### Develop with `kind`

We have pre-defined `kind` configurations in the `hack` directory to help you get started with the development environment.

> [!NOTE]
> Install kind if you haven't already. You can install it using the following command:
>
> ```shell
> go install sigs.k8s.io/kind@latest
> ```
To create a `kind` cluster with the configurations defined in `hack/kind-config.yaml`, run the following command:
```sh
kind create cluster --config hack/kind.yaml
kind create cluster --config hack/kind-config.yaml
```
### Test controller locally

#### Build and install CRD to local cluster

```shell
make manifests && make install
```

#### Run the controller locally

```shell
make run
```

#### Create a CRD to test the controller

```shell
kubectl apply -f hack/ollama-model-phi-kind-cluster.yaml
```

#### Verify the resources is reconciling

```shell
kubectl describe models
```

## Deployment

### To Deploy on the cluster

**Build and push your image to the location specified by `IMG`:**
Expand Down Expand Up @@ -79,6 +118,39 @@ make undeploy
## Project Distribution

### Test your build locally

Developers should test their builds locally before pushing the changes to the repository.

#### Test the build of `kollama` locally

This reporsitory has been configured to build and release by using [GoReleaser](https://goreleaser.com/):

> [!NOTE]
> Install GoReleaser if you haven't already by going through the steps in [GoReleaser Install](https://goreleaser.com/install/)
```shell
goreleaser release --snapshot --clean
```

#### Test the build of `ollama-operator` locally

To build the image for `ollama-operator` locally, run the following command:

```shell
docker buildx build --platform linux/amd64,linux/arm64 .
```

#### Test the release of `kollama` to `krew` locally

Please replace `<Your Tag>` with the tag you want to release.

```shell
docker run -v $(pwd)/.krew.yaml:/tmp/template-file.yaml ghcr.io/rajatjindal/krew-release-bot:v0.0.46 krew-release-bot template --tag <Your Tag> --template-file /tmp/template-file.yaml
```

### Build and distribute the project

Following are the steps to build the installer and distribute this project to users.

1. Build the installer for the image built and published in the registry:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN go mod download
# Copy the go source
COPY cmd/ cmd/
COPY api/ api/
COPY internal/controller/ internal/controller/
COPY internal/ internal/
COPY pkg/ pkg/

# Build
Expand Down
Loading

0 comments on commit 5b8cc67

Please sign in to comment.