Skip to content

Commit

Permalink
fix: default rootfs size ram * 10
Browse files Browse the repository at this point in the history
  • Loading branch information
amalcaraz committed Jul 12, 2023
1 parent c678755 commit 868f24c
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/messages/instance/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,25 @@ export async function publish({
const timestamp = Date.now() / 1000;
const { address } = account;

const mergedResources = {
...defaultResources,
...resources,
};

const mergedEnvironment = {
...defaultExecutionEnvironment,
...environment,
};

const rootfs = {
parent: {
ref: image,
use_latest: true,
},
persistence: VolumePersistence.host,
size_mib: mergedResources.memory * 10,
};

const instanceContent: InstanceContent = {
address,
time: timestamp,
Expand All @@ -61,22 +80,9 @@ export async function publish({
variables,
requirements,
allow_amend: false,
resources: {
...defaultResources,
...resources,
},
environment: {
...defaultExecutionEnvironment,
...environment,
},
rootfs: {
parent: {
ref: image,
use_latest: true,
},
persistence: VolumePersistence.host,
size_mib: 5000,
},
resources: mergedResources,
environment: mergedEnvironment,
rootfs,
};

const message = MessageBuilder<InstanceContent, MessageType.instance>({
Expand Down

0 comments on commit 868f24c

Please sign in to comment.