UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

47 lines 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDockerComposeFileContents = void 0; const yaml_1 = require("yaml"); function getDockerComposeFileContents(cmd) { var _a, _b, _c; const alwaysai = { build: cmd.build }; if (cmd.privileged) { alwaysai['privileged'] = cmd.privileged; } if (cmd.user) { alwaysai['user'] = cmd.user; } if (cmd.ports) { alwaysai['ports'] = cmd.ports; } else { alwaysai['network_mode'] = 'host'; } if (((_a = cmd.targetHardware) === null || _a === void 0 ? void 0 : _a.includes('jetson')) || ((_b = cmd.targetHardware) === null || _b === void 0 ? void 0 : _b.includes('x86-trt'))) { alwaysai['runtime'] = 'nvidia'; } if ((_c = cmd.targetHardware) === null || _c === void 0 ? void 0 : _c.includes('jetson')) { alwaysai['ipc'] = 'host'; if (cmd.volumes) { cmd.volumes.push('/tmp/argus_socket:/tmp/argus_socket'); } else { cmd.volumes = ['/tmp/argus_socket:/tmp/argus_socket']; } } if (cmd.volumes) { alwaysai['volumes'] = cmd.volumes; } if (cmd.workdir) { alwaysai['working_dir'] = cmd.workdir; } if (cmd.restart) { alwaysai['restart'] = cmd.restart; } return (0, yaml_1.stringify)({ services: { alwaysai } }); } exports.getDockerComposeFileContents = getDockerComposeFileContents; //# sourceMappingURL=docker-compose-cmd.js.map