Skip to content

Commit

Permalink
Add local debug
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
  • Loading branch information
yeahdongcn committed May 22, 2024
1 parent 69c909d commit cf02466
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach as Root",
"type": "go",
"request": "attach",
"mode": "local",
"processId": 0,
"asRoot": true,
"console": "integratedTerminal",
},
{
"name": "Launch Containerd",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/containerd/main.go",
"env": {},
},
]
}
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,8 @@ else
endif
endif

ifndef GODEBUG
EXTRA_LDFLAGS += -s -w
DEBUG_GO_GCFLAGS :=
DEBUG_TAGS :=
else
DEBUG_GO_GCFLAGS := -gcflags=all="-N -l"
DEBUG_TAGS := static_build
endif
DEBUG_GO_GCFLAGS := -gcflags=all="-N -l"
DEBUG_TAGS := static_build

WHALE = "🇩"
ONI = "👹"
Expand Down Expand Up @@ -264,7 +258,7 @@ bin/gen-manpages: cmd/gen-manpages FORCE

bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
@echo "$(WHALE) $@"
@CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o $@ ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
@$(GO) build ${GO_BUILD_FLAGS} -o $@ ./cmd/containerd-shim-runc-v2

binaries: $(BINARIES) ## build binaries
@echo "$(WHALE) $@"
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1271/badge)](https://bestpractices.coreinfrastructure.org/projects/1271)
[![Check Links](https://github.com/containerd/containerd/actions/workflows/links.yml/badge.svg)](https://github.com/containerd/containerd/actions/workflows/links.yml)

# LLM Quick Start

```bash
# Start macOS CNI
./bronzewillow
# Start containerd
sudo ./containerd
# Pull tinyllama from ollama registry
sudo crictl --timeout 100s --runtime-endpoint unix:///var/run/containerd/containerd.sock pull registry.ollama.ai/library/tinyllama:latest
# Run tinyllama
cd test/ollama
sudo crictl --timeout 100s --runtime-endpoint unix:///var/run/containerd/containerd.sock run container-config.json pod-config.json
```

containerd is an industry-standard container runtime with an emphasis on simplicity, robustness, and portability. It is available as a daemon for Linux and Windows, which can manage the complete container lifecycle of its host system: image transfer and storage, container execution and supervision, low-level storage and network attachments, etc.

containerd is a member of CNCF with ['graduated'](https://landscape.cncf.io/?selected=containerd) status.
Expand Down
13 changes: 13 additions & 0 deletions test/ollama/container-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"metadata": {
"name": "tinyllama"
},
"image": {
"image": "registry.ollama.ai/library/tinyllama:latest"
},
"command": [
"top"
],
"log_path": "tinyllama.0.log",
"linux": {}
}
10 changes: 10 additions & 0 deletions test/ollama/pod-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"metadata": {
"name": "tinyllama-sandbox",
"namespace": "default",
"attempt": 1,
"uid": "hdishd83djaidwnduwk28bcsb"
},
"log_directory": "/tmp",
"linux": {}
}

0 comments on commit cf02466

Please sign in to comment.