Skip to content

Commit

Permalink
Added documentation on how to use a pci-e Coral Accelerator in Talos …
Browse files Browse the repository at this point in the history
…Linux for Code Project AI
  • Loading branch information
UntouchedWagons committed Jul 11, 2024
1 parent 59124da commit c488ffe
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
talos/testing/secrets.yaml
talos/testing/rendered
talos/testing/rendered+nvidia
talos/testing/rendered+coral
production/*/*/.decrypted~values.yaml
58 changes: 58 additions & 0 deletions talos/testing/coral.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

## Cleaning house

```
rm -Rf ~/.talos ~/.kube/talos-config talos/testing/rendered talos/testing/rendered+nvidia talos/testing/rendered+coral talos/testing/secrets.yaml
```

## Getting started

```
talosctl gen secrets --output-file talos/testing/secrets.yaml
talosctl gen config coral-test https://192.168.20.105:6443 \
--with-secrets talos/testing/secrets.yaml \
--config-patch @talos/testing/patches/allow-controlplane-workloads.yaml \
--config-patch @talos/testing/patches/dhcp.yaml \
--config-patch @talos/testing/patches/install-disk+coral.yaml \
--config-patch @talos/testing/patches/interface-names.yaml \
--config-patch @talos/testing/patches/kubelet-certificates.yaml \
--config-patch-control-plane @talos/testing/patches/admissionControl.yaml \
--output talos/testing/rendered+coral/
```

## Install Talos

```
talosctl apply -f talos/testing/rendered+coral/controlplane.yaml -n 192.168.20.105 --insecure
```

## Copy talos config for talosctl

```
mkdir -p ~/.talos
cp talos/testing/rendered+coral/talosconfig ~/.talos/config
```

## Configure the context's endpoints

```
talosctl config contexts
talosctl config endpoint 192.168.20.105
talosctl config node 192.168.20.105
```

## Bootstrap the cluster

```
talosctl bootstrap -n 192.168.20.105
```

## Generate a kubeconfig for kubectl

```
talosctl kubeconfig ~/.kube/talos-config
```

Based off of https://mirceanton.com/posts/2023-11-28-the-best-os-for-kubernetes/
10 changes: 10 additions & 0 deletions talos/testing/patches/install-disk+coral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
machine:
install:
disk: /dev/vda
image: factory.talos.dev/installer/70fb923343260bfe3e419cfb7bfeb66719b973df0149da9f49ab7637971b1aef:v1.7.5

kernel:
modules:
- name: gasket
- name: apex
64 changes: 64 additions & 0 deletions testing/ai/codeproject-coral/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/app-template-3.2.1/charts/other/app-template/values.schema.json

controllers:
main:
strategy: Recreate

containers:
main:
image:
repository: codeproject/ai-server
tag: cpu-2.6.5
securityContext:
privileged: true
allowPrivilegeEscalation: true

probes:
# -- Liveness probe configuration
# @default -- See below
liveness:
# -- Enable the liveness probe
enabled: true
# -- Set this to `true` if you wish to specify your own livenessProbe
custom: false
# -- sets the probe type when not using a custom probe
# @default -- "TCP"
type: HTTP
path: /
# -- The spec field contains the values for the default livenessProbe.
# If you selected `custom: true`, this field holds the definition of the livenessProbe.
# @default -- See below
spec:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3

service:
main:
controller: main
type: LoadBalancer
ports:
http:
port: 32168

persistence:
config:
type: persistentVolumeClaim
accessMode: ReadWriteOnce
storageClass: local-path
size: 3Gi
advancedMounts:
main:
main:
- path: /etc/codeproject/ai
subPath: data
- path: /app/modules
subPath: modules
usb:
type: hostPath
hostPath: /dev
hostPathType: Directory
globalMounts:
- path: /dev

0 comments on commit c488ffe

Please sign in to comment.