import Kernel from '@onkernel/sdk';
const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});
const deployment = await client.deployments.create({
entrypoint_rel_path: 'src/app.py',
env_vars: { FOO: 'bar' },
file: fs.createReadStream('path/to/file'),
region: 'aws.us-east-1a',
version: '1.0.0',
});
console.log(deployment.id);{
"id": "rr33xuugxj9h0bkf1rdt2bet",
"status": "queued",
"region": "aws.us-east-1a",
"created_at": "2023-11-07T05:31:56Z",
"status_reason": "Deployment in progress",
"entrypoint_rel_path": "src/app.py",
"env_vars": {},
"updated_at": "2023-11-07T05:31:56Z"
}Create a new deployment.
import Kernel from '@onkernel/sdk';
const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});
const deployment = await client.deployments.create({
entrypoint_rel_path: 'src/app.py',
env_vars: { FOO: 'bar' },
file: fs.createReadStream('path/to/file'),
region: 'aws.us-east-1a',
version: '1.0.0',
});
console.log(deployment.id);{
"id": "rr33xuugxj9h0bkf1rdt2bet",
"status": "queued",
"region": "aws.us-east-1a",
"created_at": "2023-11-07T05:31:56Z",
"status_reason": "Deployment in progress",
"entrypoint_rel_path": "src/app.py",
"env_vars": {},
"updated_at": "2023-11-07T05:31:56Z"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
App deployment data
App deployment request. Provide either file+entrypoint_rel_path or source.
ZIP file containing the application source directory
Relative path to the entrypoint of the application
"src/app.py"
Version of the application. Can be any string.
"1.0.0"
Source from which to fetch application code.
Show child attributes
Region for deployment. Currently we only support "aws.us-east-1a"
"aws.us-east-1a""aws.us-east-1a"
Allow overwriting an existing app version
false
Map of environment variables to set for the deployed application. Each key-value pair represents an environment variable.
Show child attributes
Deployment created successfully
Deployment record information.
Unique identifier for the deployment
"rr33xuugxj9h0bkf1rdt2bet"
Current status of the deployment
queued, in_progress, running, failed, stopped "queued"
Deployment region code
"aws.us-east-1a""aws.us-east-1a"
Timestamp when the deployment was created
Status reason
"Deployment in progress"
Relative path to the application entrypoint
"src/app.py"
Environment variables configured for this deployment
Show child attributes
Timestamp when the deployment was last updated