From 22dc2b24796d243cf161d159d69b822adc69c3cf Mon Sep 17 00:00:00 2001 From: Vanshika Dhingra Date: Tue, 5 Sep 2023 16:17:26 +0530 Subject: [PATCH 1/3] first commit --- package-lock.json | 76 +++++++++++++++++++++++++++ package.json | 1 + validation/schemas/labDescSchema.json | 5 +- 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 1e586b70..8529e5d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "rsync": "^0.6.1", "shelljs": "^0.8.4", "simple-git": "^2.31.0", + "vlabs-buildexp": "^3.1.6", "winston": "^3.8.2", "yargs": "^17.0.1" }, @@ -4247,6 +4248,45 @@ "extsprintf": "^1.2.0" } }, + "node_modules/vlabs-buildexp": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/vlabs-buildexp/-/vlabs-buildexp-3.1.6.tgz", + "integrity": "sha512-WjLavwZ1NFlCxZarqWpmZiJc9HZPUfgeWzQmbN9uzOUkKySuWiVM/yGY/o4yJVbRmimEjffl7ENrofx1Wl8qOQ==", + "dependencies": { + "@babel/cli": "^7.12.16", + "@babel/core": "^7.12.16", + "@babel/plugin-proposal-class-properties": "^7.12.13", + "@types/shelljs": "^0.8.8", + "ajv": "^8.6.0", + "ajv-errors": "^3.0.0", + "ajv-formats": "^2.1.1", + "boxen": "^4.2.0", + "chalk": "^4.1.0", + "eslint": "^8.18.0", + "eslint-plugin-only-warn": "^1.0.3", + "figures": "^3.2.0", + "fs-extra": "^9.0.0", + "glob": "7.1.6", + "googleapis": "^67.0.0", + "handlebars": "^4.7.6", + "html-to-text": "^8.0.0", + "http-server": "^14.1.1", + "jsdom": "^16.4.0", + "katex": "^0.16.3", + "marked": "^2.0.0", + "minimist": "^1.2.5", + "moment": "^2.27.0", + "prettier": "^2.0.5", + "rsync": "^0.6.1", + "shelljs": "^0.8.4", + "simple-git": "^2.31.0", + "winston": "^3.8.2", + "yargs": "^17.0.1" + }, + "bin": { + "buildexp": "npm-wrapper.js" + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -7556,6 +7596,42 @@ "extsprintf": "^1.2.0" } }, + "vlabs-buildexp": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/vlabs-buildexp/-/vlabs-buildexp-3.1.6.tgz", + "integrity": "sha512-WjLavwZ1NFlCxZarqWpmZiJc9HZPUfgeWzQmbN9uzOUkKySuWiVM/yGY/o4yJVbRmimEjffl7ENrofx1Wl8qOQ==", + "requires": { + "@babel/cli": "^7.12.16", + "@babel/core": "^7.12.16", + "@babel/plugin-proposal-class-properties": "^7.12.13", + "@types/shelljs": "^0.8.8", + "ajv": "^8.6.0", + "ajv-errors": "^3.0.0", + "ajv-formats": "^2.1.1", + "boxen": "^4.2.0", + "chalk": "^4.1.0", + "eslint": "^8.18.0", + "eslint-plugin-only-warn": "^1.0.3", + "figures": "^3.2.0", + "fs-extra": "^9.0.0", + "glob": "7.1.6", + "googleapis": "^67.0.0", + "handlebars": "^4.7.6", + "html-to-text": "^8.0.0", + "http-server": "^14.1.1", + "jsdom": "^16.4.0", + "katex": "^0.16.3", + "marked": "^2.0.0", + "minimist": "^1.2.5", + "moment": "^2.27.0", + "prettier": "^2.0.5", + "rsync": "^0.6.1", + "shelljs": "^0.8.4", + "simple-git": "^2.31.0", + "winston": "^3.8.2", + "yargs": "^17.0.1" + } + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index 9645c559..19949e82 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "rsync": "^0.6.1", "shelljs": "^0.8.4", "simple-git": "^2.31.0", + "vlabs-buildexp": "^3.1.6", "winston": "^3.8.2", "yargs": "^17.0.1" }, diff --git a/validation/schemas/labDescSchema.json b/validation/schemas/labDescSchema.json index 820656ef..4af2dd09 100644 --- a/validation/schemas/labDescSchema.json +++ b/validation/schemas/labDescSchema.json @@ -6,7 +6,10 @@ "targetAudience", "courseAlignment"], "properties": { "lab": {"type": "string"}, - "lab_display_name": {"type": "string"}, + "lab_display_name": { + "type": "string", + "default": "Default Lab Display Name" + }, "broadArea": { "type": "object", "properties": { From 3c51789452e887a0b867eade6133d0342f6be877 Mon Sep 17 00:00:00 2001 From: Vanshika Dhingra Date: Tue, 5 Sep 2023 21:10:18 +0530 Subject: [PATCH 2/3] fixed bug lab-display-name --- lab_build/exp_utils.js | 5 +++-- validation/schemas/labDescSchema.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lab_build/exp_utils.js b/lab_build/exp_utils.js index cdb5c736..273b583d 100644 --- a/lab_build/exp_utils.js +++ b/lab_build/exp_utils.js @@ -25,10 +25,11 @@ function exp_clone(e, exp_dir) { shell.mkdir("-p", path.resolve(exp_dir)); shell.rm("-rf", path.resolve(exp_dir, e_short_name)); shell.exec( - `git clone -b ${e.tag} --depth 1 ${e.repo} ${path.resolve( + `git clone -b ${e.tag} --depth 1 ${e.repo} "${path.resolve( exp_dir, e_short_name - )}` + )}"`, + {silent: false} ); } diff --git a/validation/schemas/labDescSchema.json b/validation/schemas/labDescSchema.json index 4af2dd09..137e955a 100644 --- a/validation/schemas/labDescSchema.json +++ b/validation/schemas/labDescSchema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/schema#", "type": "object", - "required": ["lab", "lab_display_name", "broadArea", "phase", "collegeName", + "required": ["lab", "broadArea", "phase", "collegeName", "baseUrl", "introduction", "objective", "targetAudience", "courseAlignment"], "properties": { From 40dc26d3b8580cc75cee3c87ab82381bf0dd01d1 Mon Sep 17 00:00:00 2001 From: Vanshika Dhingra Date: Wed, 6 Sep 2023 02:18:07 +0530 Subject: [PATCH 3/3] fixed bug deploying of experiments with deploy flag set to false --- lab_build/lab_gen.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lab_build/lab_gen.js b/lab_build/lab_gen.js index 43b815f5..1a94a9c3 100644 --- a/lab_build/lab_gen.js +++ b/lab_build/lab_gen.js @@ -64,6 +64,7 @@ function moveToDeployDir(labpath) { const elist = expList(require(path.resolve(labpath, "lab-descriptor.json"))); elist.forEach((e) => { + if (e.deploy) { log.debug(`Deploying experiment ${e["short-name"]} to ${path.resolve(deployment_path, "exp", e["short-name"])}`); shell.mkdir("-p", path.resolve(deployment_path, "exp", e["short-name"])); // shell.exec(`rsync -arv --exclude .git \ @@ -78,6 +79,7 @@ function moveToDeployDir(labpath) { `${deployment_path}/stage/exp/${e["short-name"]}/*`, `${deployment_path}/exp/${e["short-name"]}` ); + } }); // console.log(chalk`{bold DEPLOY LAB} to ${deployment_dest}/${lab_dir_name}`);