Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions create-a-container/bin/create-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ async function main() {
container.hostname,
container.username,
);
const cores = approvedResources.cpus || 4;
const memory = approvedResources.memory || 4096;
const swap = approvedResources.swap || 0;
const rootfsSize = approvedResources.rootfs || 50;
const { RESOURCE_DEFAULTS } = ResourceRequest;
const cores = approvedResources.cpus || RESOURCE_DEFAULTS.cpus;
const memory = approvedResources.memory || RESOURCE_DEFAULTS.memory;
const swap = approvedResources.swap || RESOURCE_DEFAULTS.swap;
const rootfsSize = approvedResources.rootfs || RESOURCE_DEFAULTS.rootfs;
console.log(`Resources: cores=${cores}, memory=${memory}MB, swap=${swap}MB, rootfs=${rootfsSize}GB`);

const isDocker = isDockerImage(container.template);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const RESOURCE_OPTIONS = [
},
] as const;

const DEFAULTS: EffectiveResources = { memory: 4096, swap: 0, cpus: 4, rootfs: 50 };
const DEFAULTS: EffectiveResources = { memory: 8192, swap: 0, cpus: 4, rootfs: 50 };

interface ResourcesSectionProps {
siteId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const RESOURCE_LABELS: Record<string, string> = {
};

const RESOURCE_DEFAULTS: Record<string, number> = {
memory: 4096,
memory: 8192,
swap: 0,
cpus: 4,
rootfs: 50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const RESOURCE_LABELS: Record<string, string> = {
};

const RESOURCE_DEFAULTS: Record<string, number> = {
memory: 4096,
memory: 8192,
swap: 0,
cpus: 4,
rootfs: 50,
Expand Down
2 changes: 1 addition & 1 deletion create-a-container/models/resourcerequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { Model } = require('sequelize');
* Requests at or below these values are auto-approved for non-admin users.
*/
const RESOURCE_DEFAULTS = {
memory: 4096, // MB
memory: 8192, // MB
swap: 0, // MB
cpus: 4,
rootfs: 50, // GB
Expand Down
2 changes: 1 addition & 1 deletion create-a-container/utils/dummy-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DummyApi {
cfg = {
net0: `name=eth0,hwaddr=${DummyApi._fakeMac()},ip=dhcp,bridge=${this.node.networkBridge || 'vmbr0'}`,
cores: 4,
memory: 4096,
memory: 8192,
rootfs: `local:vm-${vmid}-disk-0,size=50G`,
};
this.configs.set(vmid, cfg);
Expand Down
Loading