Skip to content

Commit

Permalink
fix(ci|controller): incorrect version, namespace, and types in docs, …
Browse files Browse the repository at this point in the history
…bad platforms

Signed-off-by: Neko Ayaka <[email protected]>
  • Loading branch information
nekomeowww committed Apr 12, 2024
1 parent 4868475 commit 8980dcc
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 18 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ jobs:
export LAST_TAG=$(git describe --tags $LAST_TAGGED_COMMIT)
echo "version=${LAST_TAG#v}" >> $GITHUB_OUTPUT
- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

Expand All @@ -84,6 +89,7 @@ jobs:
- name: Build and Push
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
context: ./
file: ./Dockerfile
push: true
Expand All @@ -92,3 +98,12 @@ jobs:
${{ steps.dockerinfo.outputs.taglatest }}
${{ steps.dockerinfo.outputs.tag }}
- name: Build installer
run: |
make build-installer IMG=ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: ollama-operator-installer-${{ steps.version.outputs.version }}
path: dist/install.yaml
89 changes: 89 additions & 0 deletions .github/workflows/unstable-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Unstable Build

on:
workflow_dispatch:

jobs:
# hub_build:
# name: Build for Docker Hub
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# with:
# platforms: linux/amd64,linux/arm64

# - name: Sign in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ github.repository_owner }}
# password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

# - name: Create image tags
# id: dockerinfo
# run: |
# echo "tagunstable=${{ github.repository_owner }}/insights-bot:unstable" >> $GITHUB_OUTPUT

# - name: Build and Push
# uses: docker/build-push-action@v4
# with:
# context: ./
# file: ./Dockerfile
# push: true
# no-cache: false
# tags: |
# ${{ steps.dockerinfo.outputs.tagunstable }}

ghcr_build:
name: Build for GitHub Container Registry
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Sign in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create image tags
id: dockerinfo
run: |
echo "tagunstable=ghcr.io/${{ github.repository }}:unstable" >> $GITHUB_OUTPUT
- name: Build and Push
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
context: ./
file: ./Dockerfile
push: true
no-cache: false
tags: |
${{ steps.dockerinfo.outputs.tagunstable }}
- name: Build installer
run: |
make build-installer IMG=ghcr.io/${{ github.repository }}:unstable
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: ollama-operator-installer-unstable
path: dist/install.yaml

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ The detailed resources it creates, and the relationships between them are shown

<picture>
<source
srcset="./docs/architecture-theme-night.png"
srcset="./docs/public/architecture-theme-night.png"
media="(prefers-color-scheme: dark)"
/>
<source
srcset="./docs/architecture-theme-day.png"
srcset="./docs/public/architecture-theme-day.png"
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
/>
<img src="./docs/architecture-theme-day.png" />
<img src="./docs/public/architecture-theme-day.png" />
</picture>

## Contributing
Expand Down
9 changes: 4 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ func main() {
SecureServing: secureMetrics,
TLSOpts: tlsOpts,
},
WebhookServer: webhookServer,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "300b498d.ayaka.io",
LeaderElectionNamespace: "ollama-system",
WebhookServer: webhookServer,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "300b498d.ayaka.io",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ kubectl apply -f https://raw.githubusercontent.com/nekomeowww/ollama-operator/ma
2. Wait for the operator to be ready:

```shell
kubectl wait --for=jsonpath='{.status.replicas}'=2 deployment/ollama-operator-controller-manager -n ollama-operator-system
kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 deployment/ollama-operator-controller-manager -n ollama-operator-system
```

3. Create one `Model` CRD to rule them all.
Expand Down
17 changes: 11 additions & 6 deletions docs/pages/zh-CN/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ kind create cluster --config kind-config.yaml
kubectl apply -f https://raw.githubusercontent.com/nekomeowww/ollama-operator/main/dist/install.yaml
```

2. 创建一个 `Model` 类型的 CRD 资源
2. 等待 Operator 就绪:

```shell
kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 deployment/ollama-operator-controller-manager -n ollama-operator-system
```

3. 创建一个 `Model` 类型的 CRD 资源

::: tip 什么是 CRD?

Expand Down Expand Up @@ -92,7 +98,6 @@ EOF

或者您可以创建自己的文件:


::: code-group

```yaml [ollama-model-phi.yaml]
Expand All @@ -106,25 +111,25 @@ spec: # [!code ++]

:::

1. 将 `Model` CRD 应用到 Kubernetes 集群:
4. 将 `Model` CRD 应用到 Kubernetes 集群:

```shell
kubectl apply -f ollama-model-phi.yaml
```

1. 等待模型就绪:
5. 等待模型就绪:

```shell
kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 deployment/ollama-model-phi
```

5. 准备就绪!现在让我们转发访问模型的端口到本地:
6. 准备就绪!现在让我们转发访问模型的端口到本地:

```shell
kubectl port-forward svc/ollama-model-phi ollama
```

1. 直接与模型交互:
7. 直接与模型交互:

```shell
ollama run phi
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/zh-CN/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ kubectl apply -f https://raw.githubusercontent.com/nekomeowww/ollama-operator/ma
2. 等待 Operator 就绪:

```shell
kubectl wait --for=jsonpath='{.status.replicas}'=2 deployment/ollama-operator-controller-manager -n ollama-operator-system
kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 deployment/ollama-operator-controller-manager -n ollama-operator-system
```

3. 创建一个 `Model` 类型的 CRD 资源
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
OllamaBaseImage = "m.daocloud.io/docker.io/ollama/ollama"
OllamaBaseImage = "ollama/ollama"
)

func NewOllamaServerContainer(readOnly bool) corev1.Container {
Expand Down

0 comments on commit 8980dcc

Please sign in to comment.