@computesdk/sandbox0 1.0.28 → 1.0.30
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/README.md +4 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -22738,6 +22738,20 @@ async function createSandbox(config, options) {
|
|
|
22738
22738
|
}
|
|
22739
22739
|
var _provider = defineProvider({
|
|
22740
22740
|
name: "sandbox0",
|
|
22741
|
+
sizes: (_config, profile) => {
|
|
22742
|
+
if (profile.memoryMiB > 16 * 1024) {
|
|
22743
|
+
return {
|
|
22744
|
+
status: "unsupported",
|
|
22745
|
+
reason: "Sandbox0 documents a 16 GiB platform memory limit and lists no larger public shape."
|
|
22746
|
+
};
|
|
22747
|
+
}
|
|
22748
|
+
const memoryMiB = Math.max(profile.memoryMiB, profile.vcpus * 2048);
|
|
22749
|
+
return {
|
|
22750
|
+
status: "supported",
|
|
22751
|
+
nativeOptions: { memory: memoryMiB },
|
|
22752
|
+
...memoryMiB === profile.memoryMiB ? {} : { resolved: { vcpus: profile.vcpus, memoryMiB } }
|
|
22753
|
+
};
|
|
22754
|
+
},
|
|
22741
22755
|
methods: {
|
|
22742
22756
|
instances: {
|
|
22743
22757
|
create: createSandbox,
|
|
@@ -22981,7 +22995,7 @@ var _provider = defineProvider({
|
|
|
22981
22995
|
getInstance: (sandbox) => sandbox
|
|
22982
22996
|
},
|
|
22983
22997
|
volume: {
|
|
22984
|
-
create: async (config,
|
|
22998
|
+
create: async (config, _options) => {
|
|
22985
22999
|
const client = createClient(config);
|
|
22986
23000
|
const volume = await client.volumes.create({ backend: "s0fs", accessMode: "RWO" });
|
|
22987
23001
|
return { id: volume.id, native: volume };
|