Skip to content

Commit c28bc2c

Browse files
authored
Merge pull request #220 from computesdk/feat/activate-opencomputer-sandbox
feat: activate opencomputer sandbox provider
2 parents 10564be + 2efa0c7 commit c28bc2c

6 files changed

Lines changed: 31 additions & 21 deletions

File tree

.github/workflows/sandbox-dax-benchmarks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- modal
6363
- namespace
6464
- northflank
65-
# - opencomputer
65+
- opencomputer
6666
- runloop
6767
- superserve
6868
- tenki
@@ -121,6 +121,8 @@ jobs:
121121
NORTHFLANK_TOKEN: ${{ secrets.NORTHFLANK_TOKEN }}
122122
NSC_TOKEN: ${{ secrets.NSC_TOKEN }}
123123
NORTHFLANK_PROJECT_ID: ${{ secrets.NORTHFLANK_PROJECT_ID }}
124+
OPENCOMPUTER_API_KEY: ${{ secrets.OPENCOMPUTER_API_KEY }}
125+
OPENCOMPUTER_API_URL: ${{ secrets.OPENCOMPUTER_API_URL }}
124126
RUNLOOP_API_KEY: ${{ secrets.RUNLOOP_API_KEY }}
125127
SUPERSERVE_API_KEY: ${{ secrets.SUPERSERVE_API_KEY }}
126128
TENKI_API_KEY: ${{ secrets.TENKI_API_KEY }}

.github/workflows/sandbox-tti-benchmarks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
- modal
7777
# - namespace
7878
- northflank
79-
# - opencomputer
79+
- opencomputer
8080
# - quilt
8181
# - railway
8282
- runloop
@@ -132,6 +132,8 @@ jobs:
132132
# NSC_TOKEN: ${{ secrets.NSC_TOKEN }}
133133
NORTHFLANK_TOKEN: ${{ secrets.NORTHFLANK_TOKEN }}
134134
NORTHFLANK_PROJECT_ID: ${{ secrets.NORTHFLANK_PROJECT_ID }}
135+
OPENCOMPUTER_API_KEY: ${{ secrets.OPENCOMPUTER_API_KEY }}
136+
OPENCOMPUTER_API_URL: ${{ secrets.OPENCOMPUTER_API_URL }}
135137
# QUILT_API_KEY: ${{ secrets.QUILT_API_KEY }}
136138
# QUILT_BASE_URL: ${{ secrets.QUILT_BASE_URL }}
137139
# RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}

env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ CREATEOS_SANDBOX_API_KEY=your_createos_sandbox_api_key
108108
LIGHTNING_API_KEY=your_lightning_api_key
109109

110110
######### OPENCOMPUTER ########
111-
# OPENCOMPUTER_API_KEY=your_opencomputer_api_key
112-
# OPENCOMPUTER_API_URL=https://app.opencomputer.dev
111+
OPENCOMPUTER_API_KEY=your_opencomputer_api_key
112+
OPENCOMPUTER_API_URL=https://app.opencomputer.dev
113113

114114
######### TILION ########
115115
TILION_API_KEY=your_tilion_api_key

src/sandbox/dax.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const DAX_RESOURCE_OPTIONS: Record<string, Record<string, any>> = {
3232
declaw: { templateId: 'node-large' }, // node-large template: 8 vCPU / 16 GiB RAM / 8 GiB disk
3333
superserve: { vcpu: 8, memoryMib: 16384 }, // vcpu = cores, memoryMib = MiB; overrides template defaults
3434
createos: { shape: 's-8vcpu-16gb', ephemeralDiskMb: 61440 }, // 8 vCPU, 16 GiB RAM, 60 GiB disk
35-
// opencomputer: { cpuCount: 8, memoryMB: 16384, timeout: 600_000 },
35+
opencomputer: { cpuCount: 8, memoryMB: 16384, timeout: 600_000 },
3636
};
3737

3838
function getSandboxOptionsWithResources(providerName: string, baseOptions?: Record<string, any>): Record<string, any> {

src/sandbox/providers.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { lightning } from '@computesdk/lightning';
1616
import { modal } from '@computesdk/modal';
1717
import { namespace } from '@computesdk/namespace';
1818
import { northflank } from '@computesdk/northflank';
19-
// import { opencomputer } from '@computesdk/opencomputer';
19+
import { opencomputer } from '@computesdk/opencomputer';
2020
// import { quilt } from '@computesdk/quilt';
2121
// import { railway } from '@computesdk/railway';
2222
import { runloop } from '@computesdk/runloop';
@@ -143,12 +143,15 @@ export const providers: ProviderConfig[] = [
143143
runtime: 'node',
144144
}),
145145
},
146-
// {
147-
// name: 'opencomputer',
148-
// requiredEnvVars: ['OPENCOMPUTER_API_KEY'],
149-
// createCompute: () => opencomputer({ apiKey: process.env.OPENCOMPUTER_API_KEY! }),
150-
// sandboxOptions: { timeout: 600_000 },
151-
// },
146+
{
147+
name: 'opencomputer',
148+
requiredEnvVars: ['OPENCOMPUTER_API_KEY', 'OPENCOMPUTER_API_URL'],
149+
createCompute: () => opencomputer({
150+
apiKey: process.env.OPENCOMPUTER_API_KEY!,
151+
apiUrl: process.env.OPENCOMPUTER_API_URL!,
152+
}),
153+
sandboxOptions: { timeout: 600_000 },
154+
},
152155
// {
153156
// name: 'quilt',
154157
// requiredEnvVars: ['QUILT_API_KEY', 'QUILT_BASE_URL'],

src/scale/providers.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { e2b } from '@computesdk/e2b';
44
import { isorun } from '@computesdk/isorun';
55
import { modal } from '@computesdk/modal';
66
import { northflank } from '@computesdk/northflank';
7-
// import { opencomputer } from '@computesdk/opencomputer';
7+
import { opencomputer } from '@computesdk/opencomputer';
88
import { runloop } from '@computesdk/runloop';
99
import { tensorlake } from '@computesdk/tensorlake';
1010
//import { vercel } from '@computesdk/vercel';
@@ -99,14 +99,17 @@ export const providers: BurstProviderConfig[] = [
9999
concurrencyTarget: 100_000,
100100
perRequestTimeoutMs: 120_000,
101101
},
102-
// {
103-
// name: 'opencomputer',
104-
// requiredEnvVars: ['OPENCOMPUTER_API_KEY'],
105-
// createCompute: () => opencomputer({ apiKey: process.env.OPENCOMPUTER_API_KEY! }),
106-
// concurrencyTarget: 100_000,
107-
// perRequestTimeoutMs: 120_000,
108-
// sandboxOptions: { timeout: KEEP_ALIVE_MS },
109-
// },
102+
{
103+
name: 'opencomputer',
104+
requiredEnvVars: ['OPENCOMPUTER_API_KEY', 'OPENCOMPUTER_API_URL'],
105+
createCompute: () => opencomputer({
106+
apiKey: process.env.OPENCOMPUTER_API_KEY!,
107+
apiUrl: process.env.OPENCOMPUTER_API_URL!,
108+
}),
109+
concurrencyTarget: 100_000,
110+
perRequestTimeoutMs: 120_000,
111+
sandboxOptions: { timeout: KEEP_ALIVE_MS },
112+
},
110113
// {
111114
// name: 'vercel',
112115
// requiredEnvVars: ['VERCEL_TOKEN', 'VERCEL_TEAM_ID', 'VERCEL_PROJECT_ID'],

0 commit comments

Comments
 (0)