runpod-sdk 1.2.0-beta.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +53 -200
- package/dist/index.cjs +247 -0
- package/dist/index.d.cts +127 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +208 -0
- package/package.json +55 -28
- package/dist/package.json +0 -24
- package/dist/src/graphql/client.d.ts +0 -22
- package/dist/src/graphql/client.js +0 -75
- package/dist/src/graphql/client.js.map +0 -1
- package/dist/src/graphql/generated/index.d.ts +0 -742
- package/dist/src/graphql/generated/index.js +0 -347
- package/dist/src/graphql/generated/index.js.map +0 -1
- package/dist/src/graphql/generated/operations.d.ts +0 -428
- package/dist/src/graphql/generated/operations.js +0 -2
- package/dist/src/graphql/generated/operations.js.map +0 -1
- package/dist/src/graphql/generated/sdk.d.ts +0 -31
- package/dist/src/graphql/generated/sdk.js +0 -232
- package/dist/src/graphql/generated/sdk.js.map +0 -1
- package/dist/src/graphql/generated/types.d.ts +0 -4281
- package/dist/src/graphql/generated/types.js +0 -2
- package/dist/src/graphql/generated/types.js.map +0 -1
- package/dist/src/index.d.ts +0 -170
- package/dist/src/index.js +0 -252
- package/dist/src/index.js.map +0 -1
- package/dist/src/pods/generated-gpu-types.d.ts +0 -299
- package/dist/src/pods/generated-gpu-types.js +0 -148
- package/dist/src/pods/generated-gpu-types.js.map +0 -1
- package/dist/src/pods/index.d.ts +0 -122
- package/dist/src/pods/index.js +0 -242
- package/dist/src/pods/index.js.map +0 -1
- package/schema.gql +0 -161
package/dist/src/pods/index.js
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { getSdk } from '../graphql/generated/index.js';
|
|
2
|
-
import { GpuTypes, getGpuDisplayName, GPU_TYPES_LIST } from './generated-gpu-types.js';
|
|
3
|
-
// Re-export for convenience
|
|
4
|
-
export { GpuTypes, getGpuDisplayName, GPU_TYPES_LIST };
|
|
5
|
-
export class PodManager {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
this.sdk = getSdk(client.graphqlClient);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Create a pod (on-demand or interruptible)
|
|
12
|
-
* @param config Pod configuration
|
|
13
|
-
* @returns Promise<Pod>
|
|
14
|
-
*/
|
|
15
|
-
async create(config) {
|
|
16
|
-
// Client-side validation (fail fast)
|
|
17
|
-
if (!config.name?.trim()) {
|
|
18
|
-
throw new Error('Pod name is required');
|
|
19
|
-
}
|
|
20
|
-
if (!config.imageName) {
|
|
21
|
-
throw new Error('Image name is required');
|
|
22
|
-
}
|
|
23
|
-
if (!config.gpuTypeId) {
|
|
24
|
-
throw new Error('GPU type ID is required');
|
|
25
|
-
}
|
|
26
|
-
if (config.interruptible) {
|
|
27
|
-
if (!config.bidPerGpu || config.bidPerGpu <= 0) {
|
|
28
|
-
throw new Error('bidPerGpu is required for interruptible pods');
|
|
29
|
-
}
|
|
30
|
-
return this._createInterruptible(config);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return this._createOnDemand(config);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
async _createOnDemand(config) {
|
|
37
|
-
const input = {
|
|
38
|
-
name: config.name.trim(),
|
|
39
|
-
imageName: config.imageName,
|
|
40
|
-
gpuTypeId: config.gpuTypeId,
|
|
41
|
-
gpuCount: config.gpuCount || 1,
|
|
42
|
-
volumeInGb: config.volumeInGb || 10,
|
|
43
|
-
volumeMountPath: config.volumeMountPath || '/workspace',
|
|
44
|
-
containerDiskInGb: config.containerDiskInGb || 5,
|
|
45
|
-
env: config.env ? Object.entries(config.env).map(([key, value]) => ({ key, value })) : undefined,
|
|
46
|
-
ports: config.ports,
|
|
47
|
-
dockerArgs: config.dockerArgs
|
|
48
|
-
};
|
|
49
|
-
const result = await this.sdk.CreateOnDemandPod({ input });
|
|
50
|
-
if (!result.podFindAndDeployOnDemand) {
|
|
51
|
-
throw new Error('Failed to create pod');
|
|
52
|
-
}
|
|
53
|
-
return result.podFindAndDeployOnDemand;
|
|
54
|
-
}
|
|
55
|
-
async _createInterruptible(config) {
|
|
56
|
-
const input = {
|
|
57
|
-
name: config.name.trim(),
|
|
58
|
-
imageName: config.imageName,
|
|
59
|
-
gpuTypeId: config.gpuTypeId,
|
|
60
|
-
gpuCount: config.gpuCount || 1,
|
|
61
|
-
volumeInGb: config.volumeInGb || 10,
|
|
62
|
-
volumeMountPath: config.volumeMountPath || '/workspace',
|
|
63
|
-
containerDiskInGb: config.containerDiskInGb || 5,
|
|
64
|
-
bidPerGpu: config.bidPerGpu,
|
|
65
|
-
env: config.env ? Object.entries(config.env).map(([key, value]) => ({ key, value })) : undefined,
|
|
66
|
-
ports: config.ports,
|
|
67
|
-
dockerArgs: config.dockerArgs
|
|
68
|
-
};
|
|
69
|
-
const result = await this.sdk.CreateInterruptablePod({ input });
|
|
70
|
-
if (!result.podRentInterruptable) {
|
|
71
|
-
throw new Error('Failed to create interruptible pod');
|
|
72
|
-
}
|
|
73
|
-
return result.podRentInterruptable;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated Use create() instead
|
|
77
|
-
*/
|
|
78
|
-
async createOnDemand(config) {
|
|
79
|
-
return this.create({ ...config, interruptible: false });
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Use create() instead
|
|
83
|
-
*/
|
|
84
|
-
async createInterruptable(config) {
|
|
85
|
-
return this.create({ ...config, interruptible: true });
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get a specific pod by ID
|
|
89
|
-
* @param podId Pod ID
|
|
90
|
-
* @returns Promise<Pod>
|
|
91
|
-
*/
|
|
92
|
-
async get(podId) {
|
|
93
|
-
if (!podId?.trim()) {
|
|
94
|
-
throw new Error('Pod ID is required');
|
|
95
|
-
}
|
|
96
|
-
const result = await this.sdk.GetPod({ podId: podId.trim() });
|
|
97
|
-
if (!result.pod) {
|
|
98
|
-
throw new Error(`Pod ${podId} not found`);
|
|
99
|
-
}
|
|
100
|
-
return result.pod;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* List all pods for the current user
|
|
104
|
-
* @param filters Optional filters
|
|
105
|
-
* @returns Promise<Pod[]>
|
|
106
|
-
*/
|
|
107
|
-
async list(filters) {
|
|
108
|
-
const result = await this.sdk.ListMyPods();
|
|
109
|
-
if (!result.myself?.pods) {
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
let pods = result.myself.pods.filter((pod) => pod !== null && pod !== undefined);
|
|
113
|
-
// Apply filters
|
|
114
|
-
if (filters?.status) {
|
|
115
|
-
pods = pods.filter((pod) => pod.desiredStatus === filters.status);
|
|
116
|
-
}
|
|
117
|
-
if (filters?.podType) {
|
|
118
|
-
pods = pods.filter((pod) => pod.podType === filters.podType);
|
|
119
|
-
}
|
|
120
|
-
return pods;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Stop a running pod
|
|
124
|
-
* @param podId Pod ID
|
|
125
|
-
* @returns Promise<Pod>
|
|
126
|
-
*/
|
|
127
|
-
async stop(podId) {
|
|
128
|
-
if (!podId?.trim()) {
|
|
129
|
-
throw new Error('Pod ID is required');
|
|
130
|
-
}
|
|
131
|
-
const result = await this.sdk.StopPod({ podId: podId.trim() });
|
|
132
|
-
if (!result.podStop) {
|
|
133
|
-
throw new Error(`Failed to stop pod ${podId}`);
|
|
134
|
-
}
|
|
135
|
-
return result.podStop;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Resume a stopped pod
|
|
139
|
-
* @param podId Pod ID
|
|
140
|
-
* @param gpuCount Number of GPUs to resume with
|
|
141
|
-
* @returns Promise<Pod>
|
|
142
|
-
*/
|
|
143
|
-
async resume(podId, gpuCount = 1) {
|
|
144
|
-
if (!podId?.trim()) {
|
|
145
|
-
throw new Error('Pod ID is required');
|
|
146
|
-
}
|
|
147
|
-
if (gpuCount < 1) {
|
|
148
|
-
throw new Error('GPU count must be at least 1');
|
|
149
|
-
}
|
|
150
|
-
const result = await this.sdk.ResumePod({ podId: podId.trim(), gpuCount });
|
|
151
|
-
if (!result.podResume) {
|
|
152
|
-
throw new Error(`Failed to resume pod ${podId}`);
|
|
153
|
-
}
|
|
154
|
-
return result.podResume;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Terminate a pod (permanent deletion)
|
|
158
|
-
* @param podId Pod ID
|
|
159
|
-
* @returns Promise<void>
|
|
160
|
-
*/
|
|
161
|
-
async terminate(podId) {
|
|
162
|
-
if (!podId?.trim()) {
|
|
163
|
-
throw new Error('Pod ID is required');
|
|
164
|
-
}
|
|
165
|
-
await this.sdk.TerminatePod({ podId: podId.trim() });
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Wait for pod to reach a specific status
|
|
169
|
-
* @param podId Pod ID
|
|
170
|
-
* @param targetStatus Target status to wait for
|
|
171
|
-
* @param timeoutMs Timeout in milliseconds (default: 5 minutes)
|
|
172
|
-
* @returns Promise<Pod>
|
|
173
|
-
*/
|
|
174
|
-
async waitForStatus(podId, targetStatus, timeoutMs = 300000) {
|
|
175
|
-
const start = Date.now();
|
|
176
|
-
while (Date.now() - start < timeoutMs) {
|
|
177
|
-
const pod = await this.get(podId);
|
|
178
|
-
if (pod.desiredStatus === targetStatus) {
|
|
179
|
-
return pod;
|
|
180
|
-
}
|
|
181
|
-
// Wait 5 seconds between checks
|
|
182
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
183
|
-
}
|
|
184
|
-
throw new Error(`Timeout waiting for pod ${podId} to reach status ${targetStatus}`);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Convenience method - wait for pod to be running
|
|
188
|
-
* @param podId Pod ID
|
|
189
|
-
* @param timeoutMs Timeout in milliseconds
|
|
190
|
-
* @returns Promise<Pod>
|
|
191
|
-
*/
|
|
192
|
-
async waitForReady(podId, timeoutMs) {
|
|
193
|
-
return this.waitForStatus(podId, 'RUNNING', timeoutMs);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Get pod runtime information (ports, GPU utilization, etc.)
|
|
197
|
-
* @param podId Pod ID
|
|
198
|
-
* @returns Promise<Pod['runtime']>
|
|
199
|
-
*/
|
|
200
|
-
async getRuntime(podId) {
|
|
201
|
-
const pod = await this.get(podId);
|
|
202
|
-
return pod.runtime;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Check if pod is running
|
|
206
|
-
* @param podId Pod ID
|
|
207
|
-
* @returns Promise<boolean>
|
|
208
|
-
*/
|
|
209
|
-
async isRunning(podId) {
|
|
210
|
-
const pod = await this.get(podId);
|
|
211
|
-
return pod.desiredStatus === 'RUNNING';
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Get pod cost per hour
|
|
215
|
-
* @param podId Pod ID
|
|
216
|
-
* @returns Promise<number>
|
|
217
|
-
*/
|
|
218
|
-
async getCostPerHour(podId) {
|
|
219
|
-
const pod = await this.get(podId);
|
|
220
|
-
return pod.costPerHr;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* List available GPU types
|
|
224
|
-
* @returns Promise<GpuType[]>
|
|
225
|
-
*/
|
|
226
|
-
async listGpuTypes() {
|
|
227
|
-
const result = await this.sdk.ListGpuTypes();
|
|
228
|
-
if (!result.gpuTypes) {
|
|
229
|
-
return [];
|
|
230
|
-
}
|
|
231
|
-
return result.gpuTypes
|
|
232
|
-
.filter((gpu) => gpu !== null && gpu !== undefined)
|
|
233
|
-
.map((gpu) => ({
|
|
234
|
-
id: gpu.id || '',
|
|
235
|
-
displayName: gpu.displayName || '',
|
|
236
|
-
memoryInGb: gpu.memoryInGb || 0,
|
|
237
|
-
secureCloud: gpu.secureCloud || false,
|
|
238
|
-
communityCloud: gpu.communityCloud || false
|
|
239
|
-
}));
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
//# sourceMappingURL=index.js.map
|
|
@@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B,MAAM,CAAC,CAAC,GAAQ,EAAkB,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,CAAC;aACvE,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC;YAClB,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE;YAChB,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,EAAE;YAClC,UAAU,EAAE,GAAG,CAAC,UAAU,IAAI,CAAC;YAC/B,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,KAAK;YACrC,cAAc,EAAE,GAAG,CAAC,cAAc,IAAI,KAAK;SAC5C,CAAC,CAAC,CAAA;IACP,CAAC;CACF"}
|
package/schema.gql
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
# Public-facing RunPod GraphQL Schema
|
|
2
|
-
# Contains only operations exposed in the JavaScript SDK
|
|
3
|
-
|
|
4
|
-
scalar DateTime
|
|
5
|
-
scalar JSON
|
|
6
|
-
scalar JSONObject
|
|
7
|
-
|
|
8
|
-
type Query {
|
|
9
|
-
# User profile
|
|
10
|
-
myself: User
|
|
11
|
-
|
|
12
|
-
# Pod operations
|
|
13
|
-
pod(input: PodInput!): Pod
|
|
14
|
-
|
|
15
|
-
# GPU information
|
|
16
|
-
gpuTypes: [GpuType!]!
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
type Mutation {
|
|
20
|
-
# Pod lifecycle
|
|
21
|
-
podFindAndDeployOnDemand(input: PodFindAndDeployOnDemandInput!): Pod
|
|
22
|
-
podRentInterruptable(input: PodRentInterruptableInput!): Pod
|
|
23
|
-
podStop(input: PodInput!): Pod
|
|
24
|
-
podResume(input: PodResumeInput!): Pod
|
|
25
|
-
podTerminate(input: PodInput!): String
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
# Core types for public SDK
|
|
29
|
-
type User {
|
|
30
|
-
id: String
|
|
31
|
-
email: String
|
|
32
|
-
machineQuota: Int
|
|
33
|
-
currentSpendPerHr: Float
|
|
34
|
-
spendLimit: Float
|
|
35
|
-
referralEarned: Float
|
|
36
|
-
pods: [Pod!] # Missing field for ListMyPods query
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
type Pod {
|
|
40
|
-
id: String!
|
|
41
|
-
name: String!
|
|
42
|
-
desiredStatus: String!
|
|
43
|
-
imageName: String
|
|
44
|
-
env: [String] # String array based on dev API
|
|
45
|
-
machineId: String
|
|
46
|
-
memoryInGb: Float
|
|
47
|
-
vcpuCount: Float
|
|
48
|
-
volumeInGb: Float
|
|
49
|
-
volumeMountPath: String
|
|
50
|
-
podType: String
|
|
51
|
-
costPerHr: Float!
|
|
52
|
-
gpuCount: Int
|
|
53
|
-
containerDiskInGb: Int
|
|
54
|
-
ports: String
|
|
55
|
-
volumeKey: String
|
|
56
|
-
containerRegistryAuthId: String
|
|
57
|
-
|
|
58
|
-
# Runtime information
|
|
59
|
-
runtime: PodRuntime
|
|
60
|
-
machine: PodMachine
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
type PodRuntime {
|
|
64
|
-
uptimeInSeconds: Int
|
|
65
|
-
ports: [PodRuntimePort]
|
|
66
|
-
gpus: [PodRuntimeGpu]
|
|
67
|
-
container: PodRuntimeContainer
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
type PodRuntimePort {
|
|
71
|
-
ip: String
|
|
72
|
-
isIpPublic: Boolean
|
|
73
|
-
privatePort: Int
|
|
74
|
-
publicPort: Int
|
|
75
|
-
type: String
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
type PodRuntimeGpu {
|
|
79
|
-
id: String
|
|
80
|
-
gpuUtilPercent: Int
|
|
81
|
-
memoryUtilPercent: Int
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type PodRuntimeContainer {
|
|
85
|
-
cpuPercent: Int
|
|
86
|
-
memoryPercent: Int
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
type PodMachine {
|
|
90
|
-
podHostId: String
|
|
91
|
-
gpuDisplayName: String
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
type GpuType {
|
|
95
|
-
id: String!
|
|
96
|
-
displayName: String!
|
|
97
|
-
memoryInGb: Int!
|
|
98
|
-
secureCloud: Boolean!
|
|
99
|
-
communityCloud: Boolean!
|
|
100
|
-
lowestPrice(input: GpuLowestPriceInput!): LowestPrice
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type LowestPrice {
|
|
104
|
-
gpuName: String # Missing field
|
|
105
|
-
stockStatus: String
|
|
106
|
-
uninterruptablePrice: Float
|
|
107
|
-
minimumBidPrice: Float
|
|
108
|
-
rentedCount: Int
|
|
109
|
-
totalCount: Int
|
|
110
|
-
availableGpuCounts: [Int]
|
|
111
|
-
maxUnreservedGpuCount: Int # Missing field
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
# Input types
|
|
115
|
-
input PodInput {
|
|
116
|
-
podId: String!
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
input PodResumeInput {
|
|
120
|
-
podId: String!
|
|
121
|
-
gpuCount: Int!
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
input PodFindAndDeployOnDemandInput {
|
|
125
|
-
name: String!
|
|
126
|
-
imageName: String!
|
|
127
|
-
gpuTypeId: String!
|
|
128
|
-
gpuCount: Int
|
|
129
|
-
volumeInGb: Int
|
|
130
|
-
volumeMountPath: String
|
|
131
|
-
containerDiskInGb: Int
|
|
132
|
-
env: [EnvironmentVariableInput]
|
|
133
|
-
ports: String
|
|
134
|
-
dockerArgs: String
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
input PodRentInterruptableInput {
|
|
138
|
-
name: String!
|
|
139
|
-
imageName: String!
|
|
140
|
-
gpuTypeId: String!
|
|
141
|
-
gpuCount: Int
|
|
142
|
-
volumeInGb: Int
|
|
143
|
-
volumeMountPath: String
|
|
144
|
-
containerDiskInGb: Int
|
|
145
|
-
bidPerGpu: Float!
|
|
146
|
-
env: [EnvironmentVariableInput]
|
|
147
|
-
ports: String
|
|
148
|
-
dockerArgs: String
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
input EnvironmentVariableInput {
|
|
152
|
-
key: String!
|
|
153
|
-
value: String!
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
input GpuLowestPriceInput {
|
|
157
|
-
gpuCount: Int!
|
|
158
|
-
secureCloud: Boolean
|
|
159
|
-
minMemoryInGb: Int
|
|
160
|
-
totalDisk: Int
|
|
161
|
-
}
|