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
Signed-off-by: Neko Ayaka <[email protected]>
  • Loading branch information
nekomeowww committed Apr 12, 2024
1 parent 4868475 commit 09c6f9f
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 15 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v7

- name: Sign in to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -92,3 +92,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: operator-installer
path: dist/install.yaml
83 changes: 83 additions & 0 deletions .github/workflows/unstable-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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

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

- 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:
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: operator-installer
path: dist/install.yaml

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 09c6f9f

Please sign in to comment.