Skip to content

Commit f3a2bb0

Browse files
committed
chore: drop coglet-alpha selection
Map coglet-alpha and coglet wheel selections to cog-dataclass and remove the pinned coglet-alpha install path. Update dockerfile generators, wheel parsing, CI runtime matrix, and integration-test conditions to reflect the removal.
1 parent a44702a commit f3a2bb0

File tree

9 files changed

+40
-75
lines changed

9 files changed

+40
-75
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
strategy:
211211
fail-fast: false
212212
matrix:
213-
runtime: [cog, cog-dataclass, coglet-alpha, cog-rust, cog-dataclass-rust]
213+
runtime: [cog, cog-dataclass, cog-rust, cog-dataclass-rust]
214214
steps:
215215
- uses: actions/checkout@v6
216216
with:
@@ -246,9 +246,6 @@ jobs:
246246
cog-dataclass)
247247
echo "COG_WHEEL=cog-dataclass" >> $GITHUB_ENV
248248
;;
249-
coglet-alpha)
250-
echo "COG_WHEEL=coglet-alpha" >> $GITHUB_ENV
251-
;;
252249
cog-rust)
253250
RUST_WHEEL=$(ls dist/coglet-*-cp310-abi3-*.whl | head -1)
254251
echo "Found Rust coglet wheel: $RUST_WHEEL"

architecture/05-build-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ The `COG_WHEEL` environment variable controls which wheel is installed:
195195
|-------|--------|
196196
| (unset) | Embedded `cog` wheel (default) |
197197
| `cog` | Embedded `cog` wheel |
198-
| `coglet` / `coglet-alpha` | Experimental runtime (temporary compatibility) |
198+
| `coglet` | Experimental runtime (temporary compatibility) |
199199
| `https://...` | Download wheel from URL |
200200
| `/path/to/file.whl` | Use local wheel file |
201201

integration-tests/concurrent/concurrent_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ func TestConcurrentPredictions(t *testing.T) {
3131
t.Skip("skipping slow test in short mode")
3232
}
3333

34-
// Skip for coglet-alpha runtime - it has a known bug with concurrent async predictions
35-
// that causes predictions to return empty output. This is in the released version and
36-
// cannot be fixed without a new release.
37-
if cogWheel := os.Getenv("COG_WHEEL"); cogWheel == "coglet-alpha" {
38-
t.Skip("skipping: coglet-alpha has a known bug with concurrent async predictions")
39-
}
40-
4134
// Create a temp directory for our test project
4235
tmpDir, err := os.MkdirTemp("", "cog-concurrent-test-*")
4336
if err != nil {

integration-tests/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestIntegration(t *testing.T) {
2929
// condition provides custom conditions for testscript.
3030
// Supported conditions:
3131
// - linux/linux_amd64/amd64: platform guards for specialized tests.
32-
// - coglet_alpha: true when COG_WHEEL=coglet-alpha (old Go coglet)
32+
// - coglet_alpha: deprecated (always false)
3333
// - cog_dataclass: true when COG_WHEEL=cog-dataclass (Python 3.10+ only)
3434
// - cog_rust: true when COG_WHEEL=cog and COGLET_RUST_WHEEL is set
3535
// - cog_dataclass_rust: true when COG_WHEEL=cog-dataclass and COGLET_RUST_WHEEL is set
@@ -55,7 +55,7 @@ func condition(cond string) (bool, error) {
5555
case "linux_amd64":
5656
value = runtime.GOOS == "linux" && runtime.GOARCH == "amd64"
5757
case "coglet_alpha":
58-
value = cogWheel == "coglet-alpha"
58+
value = false
5959
case "cog_dataclass":
6060
value = cogWheel == "cog-dataclass"
6161
case "cog_rust":

pkg/dockerfile/fast_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (g *FastGenerator) generateMonobase(lines []string, tmpDir string) ([]strin
216216
var envs []string
217217

218218
envs = append(envs, []string{
219-
"ENV R8_COG_VERSION=" + PinnedCogletURL,
219+
"ENV R8_COG_VERSION=cog-dataclass",
220220
}...)
221221

222222
torchVersion, ok := g.Config.TorchVersion()

pkg/dockerfile/standard_generator.go

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const StripDebugSymbolsCommand = "find / -type f -name \"*python*.so\" -not -nam
4747
const CFlags = "ENV CFLAGS=\"-O3 -funroll-loops -fno-strict-aliasing -flto -S\""
4848
const PrecompilePythonCommand = "RUN find / -type f -name \"*.py[co]\" -delete && find / -type f -name \"*.py\" -exec touch -t 197001010000 {} \\; && find / -type f -name \"*.py\" -printf \"%h\\n\" | sort -u | /usr/bin/python3 -m compileall --invalidation-mode timestamp -o 2 -j 0"
4949
const STANDARD_GENERATOR_NAME = "STANDARD_GENERATOR"
50-
const PinnedCogletURL = "https://github.com/replicate/cog-runtime/releases/download/v0.1.0-beta10/coglet-0.1.0b10-py3-none-any.whl" // Pinned coglet URL to avoid API dependency
5150

5251
type StandardGenerator struct {
5352
Config *config.Config
@@ -475,8 +474,6 @@ func (g *StandardGenerator) installCog() (string, error) {
475474
switch wheelConfig.Source {
476475
case wheels.WheelSourceCog:
477476
installLines, err = g.installEmbeddedCogWheel()
478-
case wheels.WheelSourceCogletAlpha:
479-
installLines, err = g.installCogletAlpha()
480477
case wheels.WheelSourceCogDataclass:
481478
installLines, err = g.installEmbeddedCogDataclassWheel()
482479
case wheels.WheelSourceURL:
@@ -493,18 +490,13 @@ func (g *StandardGenerator) installCog() (string, error) {
493490

494491
// Optionally install Rust coglet wheel alongside cog
495492
// This allows testing the Rust HTTP server implementation
496-
// WARNING: Cannot install Rust coglet when using coglet-alpha
497493
if rustWheelPath := os.Getenv("COGLET_RUST_WHEEL"); rustWheelPath != "" {
498-
if wheelConfig != nil && wheelConfig.Source == wheels.WheelSourceCogletAlpha {
499-
fmt.Fprintf(os.Stderr, "WARNING: COGLET_RUST_WHEEL is set but COG_WHEEL=coglet-alpha. Rust coglet cannot be installed alongside coglet-alpha (Go implementation). Skipping Rust coglet installation.\n")
500-
} else {
501-
rustInstall, err := g.installRustCogletWheel(rustWheelPath)
502-
if err != nil {
503-
return "", fmt.Errorf("failed to install Rust coglet wheel: %w", err)
504-
}
505-
if rustInstall != "" {
506-
installLines += "\n" + rustInstall
507-
}
494+
rustInstall, err := g.installRustCogletWheel(rustWheelPath)
495+
if err != nil {
496+
return "", fmt.Errorf("failed to install Rust coglet wheel: %w", err)
497+
}
498+
if rustInstall != "" {
499+
installLines += "\n" + rustInstall
508500
}
509501
}
510502

@@ -545,23 +537,6 @@ func (g *StandardGenerator) installEmbeddedCogDataclassWheel() (string, error) {
545537
return strings.Join(lines, "\n"), nil
546538
}
547539

548-
// installCogletAlpha installs coglet from the pinned URL (default for cog_runtime: true)
549-
func (g *StandardGenerator) installCogletAlpha() (string, error) {
550-
// We need fast-* compliant Python version to reconstruct coglet venv PYTHONPATH
551-
if !CheckMajorMinorOnly(g.Config.Build.PythonVersion) {
552-
return "", fmt.Errorf("Python version must be <major>.<minor>")
553-
}
554-
cmds := []string{
555-
"ENV R8_COG_VERSION=coglet",
556-
"ENV R8_PYTHON_VERSION=" + g.Config.Build.PythonVersion,
557-
// Uninstall cog first to avoid conflicts with coglet's cog shim package.
558-
// Some base images (e.g. r8.im/cog-base) have cog pre-installed, which conflicts
559-
// with coglet's cog compatibility shim that provides the same module paths.
560-
"RUN pip uninstall -y cog 2>/dev/null || true && pip install " + PinnedCogletURL,
561-
}
562-
return strings.Join(cmds, "\n"), nil
563-
}
564-
565540
// installWheelFromURL installs a wheel from a URL (when COG_WHEEL=https://...)
566541
func (g *StandardGenerator) installWheelFromURL(url string) (string, error) {
567542
// Set coglet env vars if this looks like a coglet wheel

pkg/dockerfile/standard_generator_test.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ predict: predict.py:Predictor
925925
}
926926

927927
func TestCOGWheelDefaultCogRuntimeTrue(t *testing.T) {
928-
// Default behavior with cog_runtime: true should use coglet-alpha (PinnedCogletURL)
928+
// Default behavior with cog_runtime: true should use cog-dataclass
929929
tmpDir := t.TempDir()
930930

931931
yaml := `
@@ -947,10 +947,11 @@ predict: predict.py:Predictor
947947
_, actual, _, err := gen.GenerateModelBaseWithSeparateWeights(t.Context(), "r8.im/replicate/cog-test")
948948
require.NoError(t, err)
949949

950-
// Should contain coglet-alpha/PinnedCogletURL install with cog uninstall prefix
951-
require.Contains(t, actual, "RUN pip uninstall -y cog 2>/dev/null || true && pip install "+PinnedCogletURL)
952-
require.Contains(t, actual, "ENV R8_COG_VERSION=coglet")
953-
require.Contains(t, actual, "ENV R8_PYTHON_VERSION=3.11")
950+
// Should contain the embedded cog-dataclass wheel install
951+
require.Contains(t, actual, "/tmp/cog_dataclass-")
952+
require.Contains(t, actual, ".whl")
953+
require.NotContains(t, actual, "'pydantic>=1.9,<3'")
954+
require.NotContains(t, actual, "R8_COG_VERSION=coglet")
954955
}
955956

956957
func TestCOGWheelEnvCog(t *testing.T) {
@@ -987,7 +988,7 @@ predict: predict.py:Predictor
987988
}
988989

989990
func TestCOGWheelEnvCogletAlpha(t *testing.T) {
990-
// COG_WHEEL=coglet-alpha should use PinnedCogletURL even without cog_runtime: true
991+
// COG_WHEEL=coglet-alpha should map to cog-dataclass
991992
t.Setenv("COG_WHEEL", "coglet-alpha")
992993

993994
tmpDir := t.TempDir()
@@ -1010,10 +1011,11 @@ predict: predict.py:Predictor
10101011
_, actual, _, err := gen.GenerateModelBaseWithSeparateWeights(t.Context(), "r8.im/replicate/cog-test")
10111012
require.NoError(t, err)
10121013

1013-
// Should contain coglet-alpha/PinnedCogletURL install with cog uninstall prefix
1014-
require.Contains(t, actual, "RUN pip uninstall -y cog 2>/dev/null || true && pip install "+PinnedCogletURL)
1015-
require.Contains(t, actual, "ENV R8_COG_VERSION=coglet")
1016-
require.Contains(t, actual, "ENV R8_PYTHON_VERSION=3.11")
1014+
// Should contain the embedded cog-dataclass wheel install
1015+
require.Contains(t, actual, "/tmp/cog_dataclass-")
1016+
require.Contains(t, actual, ".whl")
1017+
require.NotContains(t, actual, "'pydantic>=1.9,<3'")
1018+
require.NotContains(t, actual, "R8_COG_VERSION=coglet")
10171019
}
10181020

10191021
func TestCOGWheelEnvURL(t *testing.T) {

pkg/wheels/wheels.go

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ type WheelSource int
8080
const (
8181
// WheelSourceCog uses the embedded cog wheel (default when cog_runtime: false)
8282
WheelSourceCog WheelSource = iota
83-
// WheelSourceCogletEmbedded uses the embedded coglet wheel
84-
WheelSourceCogletEmbedded
85-
// WheelSourceCogletAlpha uses the PinnedCogletURL (default when cog_runtime: true)
86-
WheelSourceCogletAlpha
8783
// WheelSourceCogDataclass uses the embedded cog-dataclass wheel (pydantic-less)
8884
WheelSourceCogDataclass
8985
// WheelSourceURL uses a custom URL
@@ -97,10 +93,6 @@ func (s WheelSource) String() string {
9793
switch s {
9894
case WheelSourceCog:
9995
return "cog"
100-
case WheelSourceCogletEmbedded:
101-
return "coglet"
102-
case WheelSourceCogletAlpha:
103-
return "coglet-alpha"
10496
case WheelSourceCogDataclass:
10597
return "cog-dataclass"
10698
case WheelSourceURL:
@@ -128,8 +120,7 @@ const CogWheelEnvVar = "COG_WHEEL"
128120
// ParseCogWheel parses a COG_WHEEL value and returns the appropriate WheelConfig.
129121
// Supported values:
130122
// - "cog" - Embedded cog wheel
131-
// - "coglet" - Embedded coglet wheel
132-
// - "coglet-alpha" - PinnedCogletURL
123+
// - "coglet" - Deprecated (maps to cog-dataclass)
133124
// - "cog-dataclass" - Embedded cog-dataclass wheel (pydantic-less)
134125
// - "https://..." or "http://..." - Direct wheel URL
135126
// - "/path/to/file.whl" or "./path/to/file.whl" - Local wheel file
@@ -145,9 +136,9 @@ func ParseCogWheel(value string) *WheelConfig {
145136
case "cog":
146137
return &WheelConfig{Source: WheelSourceCog}
147138
case "coglet":
148-
return &WheelConfig{Source: WheelSourceCogletEmbedded}
139+
return &WheelConfig{Source: WheelSourceCogDataclass}
149140
case "coglet-alpha":
150-
return &WheelConfig{Source: WheelSourceCogletAlpha}
141+
return &WheelConfig{Source: WheelSourceCogDataclass}
151142
case "cog-dataclass":
152143
return &WheelConfig{Source: WheelSourceCogDataclass}
153144
}
@@ -164,17 +155,20 @@ func ParseCogWheel(value string) *WheelConfig {
164155
// GetWheelConfig returns the WheelConfig based on COG_WHEEL env var and cog_runtime flag.
165156
// Priority:
166157
// 1. COG_WHEEL env var (if set, overrides everything)
167-
// 2. cog_runtime: true -> coglet-alpha (PinnedCogletURL)
158+
// 2. cog_runtime: true -> cog-dataclass (coglet-alpha removed)
168159
// 3. cog_runtime: false (default) -> embedded cog wheel
169160
func GetWheelConfig(cogRuntimeEnabled bool) *WheelConfig {
170161
envValue := os.Getenv(CogWheelEnvVar)
162+
if strings.EqualFold(envValue, "coglet-alpha") || strings.EqualFold(envValue, "coglet") {
163+
return &WheelConfig{Source: WheelSourceCogDataclass}
164+
}
171165
if config := ParseCogWheel(envValue); config != nil {
172166
return config
173167
}
174168

175169
// Default based on cog_runtime flag
176170
if cogRuntimeEnabled {
177-
return &WheelConfig{Source: WheelSourceCogletAlpha}
171+
return &WheelConfig{Source: WheelSourceCogDataclass}
178172
}
179173
return &WheelConfig{Source: WheelSourceCog}
180174
}

pkg/wheels/wheels_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func TestWheelSourceString(t *testing.T) {
2020
expected string
2121
}{
2222
{WheelSourceCog, "cog"},
23-
{WheelSourceCogletAlpha, "coglet-alpha"},
2423
{WheelSourceCogDataclass, "cog-dataclass"},
2524
{WheelSourceURL, "url"},
2625
{WheelSourceFile, "file"},
@@ -68,15 +67,20 @@ func TestParseCogWheel(t *testing.T) {
6867
input: "Cog",
6968
expected: &WheelConfig{Source: WheelSourceCog},
7069
},
70+
{
71+
name: "coglet keyword",
72+
input: "coglet",
73+
expected: &WheelConfig{Source: WheelSourceCogDataclass},
74+
},
7175
{
7276
name: "coglet-alpha keyword",
7377
input: "coglet-alpha",
74-
expected: &WheelConfig{Source: WheelSourceCogletAlpha},
78+
expected: &WheelConfig{Source: WheelSourceCogDataclass},
7579
},
7680
{
7781
name: "coglet-alpha uppercase",
7882
input: "COGLET-ALPHA",
79-
expected: &WheelConfig{Source: WheelSourceCogletAlpha},
83+
expected: &WheelConfig{Source: WheelSourceCogDataclass},
8084
},
8185
{
8286
name: "cog with whitespace",
@@ -186,7 +190,7 @@ func TestGetWheelConfig(t *testing.T) {
186190
name: "default with cog_runtime true",
187191
envValue: "",
188192
cogRuntimeEnabled: true,
189-
expected: &WheelConfig{Source: WheelSourceCogletAlpha},
193+
expected: &WheelConfig{Source: WheelSourceCogDataclass},
190194
},
191195

192196
// Env var overrides cog_runtime
@@ -200,7 +204,7 @@ func TestGetWheelConfig(t *testing.T) {
200204
name: "env coglet-alpha overrides cog_runtime false",
201205
envValue: "coglet-alpha",
202206
cogRuntimeEnabled: false,
203-
expected: &WheelConfig{Source: WheelSourceCogletAlpha},
207+
expected: &WheelConfig{Source: WheelSourceCogDataclass},
204208
},
205209
{
206210
name: "env URL overrides cog_runtime",

0 commit comments

Comments
 (0)