3d6418184f
### Changelog
- added support for pulling base images from AWS, Docker, GCP
registries.
- removed unnecessary conversion in build_api.py.
- synced serialize implementation in TypeScript and Python.
- added Cursor Pylance config (side-effect, can delete if unwanted).
### Examples
**TypeScript**
```ts
import { Template } from 'e2b'
// Generic Docker registry
Template().fromRegistry('ubuntu:22.04', {
username: 'jirka',
password: 'password',
})
// AWS ECR registry
Template().fromAWSRegistry('ubuntu:22.04', {
accessKeyId: '123',
secretAccessKey: '456',
region: 'eu-west-1',
})
// GCP GCR registry from file path
Template().fromGCPRegistry('ubuntu:22.04', {
serviceAccountJSON: './service_account.json',
})
// GCP GCR registry from object
Template().fromGCPRegistry('ubuntu:22.04', {
serviceAccountJSON: { project_id: '123', private_key_id: '456' },
})
```
**Python**
```py
from e2b import Template
# Generic Docker registry
Template().from_registry(
image="ubuntu:22.04",
username="jirka",
password="password",
)
# AWS ECR registry
Template().from_aws_registry(
image="ubuntu:22.04",
access_key_id="123",
secret_access_key="456",
region="eu-west-1",
)
# GCP GCR registry from file path
Template().from_gcp_registry(
image="ubuntu:22.04",
service_account_json="./service_account.json",
)
# GCP GCR registry from object
Template().from_gcp_registry(
image="ubuntu:22.04",
service_account_json={"project_id": "123", "private_key_id": "456"},
)
```
88 lines
2.5 KiB
JSON
88 lines
2.5 KiB
JSON
{
|
|
"search.exclude": {
|
|
"**/.git": true,
|
|
"**/.svn": true,
|
|
"**/.hg": true,
|
|
"**/CVS": true,
|
|
"**/.DS_Store": true,
|
|
"lib/**": true,
|
|
".next/**": true,
|
|
"**/.next/**": true,
|
|
"**/.venv/**": true,
|
|
"**/.turbo/**": true,
|
|
"**/poetry.lock/**": true,
|
|
"**/__pycache__/**": true,
|
|
"**/.vercel/**": true,
|
|
".vscode/**": true,
|
|
".git/**": true,
|
|
"**/node_modules/**": true,
|
|
"**/package-lock.json": true,
|
|
"**/yarl.lock": true
|
|
},
|
|
"files.watcherExclude": {
|
|
"**/.git": true,
|
|
"**/.svn": true,
|
|
"**/.hg": true,
|
|
"**/CVS": true,
|
|
"**/.DS_Store": true,
|
|
"lib/**": true,
|
|
"**/poetry.lock/**": true,
|
|
"**/.turbo/**": true,
|
|
"**/.vercel/**": true,
|
|
"**/.venv/**": true,
|
|
"**/__pycache__/**": true,
|
|
"**/.next/**": true,
|
|
".next/**": true,
|
|
".vscode/**": true,
|
|
".git/**": true,
|
|
"**/node_modules/**": true,
|
|
"**/package-lock.json": true,
|
|
"**/yarl.lock": true
|
|
},
|
|
"typescript.tsdk": "node_modules/typescript/lib",
|
|
"css.validate": false,
|
|
"tailwindCSS.validate": true,
|
|
"editor.formatOnSave": true,
|
|
"editor.codeActionsOnSave": {
|
|
"source.fixAll.eslint": "explicit"
|
|
},
|
|
"eslint.validate": [
|
|
"javascript",
|
|
"typescript"
|
|
],
|
|
"debug.javascript.codelens.npmScripts": "never",
|
|
"editor.codeLens": true,
|
|
"editor.suggest.localityBonus": true,
|
|
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
"npm.packageManager": "pnpm",
|
|
"python.formatting.provider": "black",
|
|
"[python]": {
|
|
"editor.defaultFormatter": "ms-python.black-formatter"
|
|
},
|
|
"python.autoComplete.extraPaths": [
|
|
"./**",
|
|
"./packages/python-sdk/**",
|
|
"./packages/python-sdk/.venv/bin/python",
|
|
],
|
|
"python.defaultInterpreterPath": "./packages/python-sdk/.venv/bin/python",
|
|
"python.analysis.extraPaths": [
|
|
"./**",
|
|
"./packages/python-sdk/**",
|
|
"./packages/python-sdk/.venv/bin/python"
|
|
],
|
|
// Disable Pylint and use just Pylance
|
|
"python.linting.enabled": false,
|
|
"python.analysis.typeCheckingMode": "basic",
|
|
"cursorpyright.analysis.extraPaths": [
|
|
"./**",
|
|
"./packages/python-sdk/**",
|
|
"./packages/python-sdk/.venv/bin/python"
|
|
],
|
|
"cursorpyright.analysis.typeCheckingMode": "basic",
|
|
// "python.analysis.pylanceLspClientEnabled": true,
|
|
// "python.analysis.inlayHints.functionReturnTypes": true,
|
|
// "python.analysis.inlayHints.pytestParameters": true,
|
|
// "python.analysis.inlayHints.variableTypes": true,
|
|
// "python.analysis.autoImportCompletions": true,
|
|
// "python.analysis.completeFunctionParens": true
|
|
} |