alwaysai
Version:
The alwaysAI command-line interface (CLI)
44 lines • 2.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.appStartCliLeaf = void 0;
const alwayscli_1 = require("@alwaysai/alwayscli");
const app_1 = require("../../components/app");
const post_tracking_data_to_hubspot_1 = require("../../infrastructure/post-tracking-data-to-hubspot");
// Currently we run the "start" command as a superuser because otherwise we
// cannot connect to the NCS accelerator. It ~should~ be possible to connect to
// the NCS even without --privileged mode, but we need to do the work to set
// that up. See https://movidius.github.io/ncsdk/docker.html
exports.appStartCliLeaf = (0, alwayscli_1.CliLeaf)({
name: 'start',
namedInputs: {
'no-superuser': (0, alwayscli_1.CliFlagInput)({
description: 'If running in a container, do so as the login user instead of as the superuser "root"'
}),
volumes: (0, alwayscli_1.CliStringArrayInput)({
description: 'Volumes to be mounted by Docker. e.g. --volumes /home/user/dir1:/root/dir1 /home/user/dir2:/root/dir2'
}),
'env-vars': (0, alwayscli_1.CliStringArrayInput)({
description: 'Environment variables to be set within the Docker container. e.g. --env-vars LOG_LEVEL=INFO'
})
},
escapedInput: (0, alwayscli_1.CliStringArrayInput)({
placeholder: '<args>',
description: 'Arguments passed directly to the application'
}),
description: 'Run this application\'s "start" script',
async action(_, opts, escaped) {
const appStartRequest = (0, app_1.appStartComponent)({
noSuperuser: opts['no-superuser'],
volumes: opts.volumes,
env_vars: opts['env-vars'],
args: escaped
});
const hubSpotTrackingRequest = (0, post_tracking_data_to_hubspot_1.postTrackingDataToHubspot)('started_app', true);
const [exitCode] = await Promise.all([
appStartRequest,
hubSpotTrackingRequest
]);
process.exit(exitCode);
}
});
//# sourceMappingURL=start.js.map