Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOQUSCloud lambda node16 update #1068

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ded3232
Updating lambda funcs, adding testing lambda job state machine
boverhof Jun 24, 2022
f7e9305
Fake job queue, subscription, for testing
boverhof Jul 5, 2022
770f398
Merge remote-tracking branch 'upstream/master' into boverhof_cdk2_dep…
boverhof Jul 5, 2022
49370af
Add 'fake-job' as an Application
boverhof Jul 6, 2022
c1c1307
Updates for session start,stop,kill
boverhof Jul 13, 2022
7e48c2a
Recursive list on $username/session/ and $username/session/create/ pr…
boverhof Jul 20, 2022
abeaaa5
Add user-data description
boverhof Jul 22, 2022
86be996
Merge remote-tracking branch 'upstream/master' into boverhof_cdk2_dep…
boverhof Jul 22, 2022
b3c6d12
Contextualize instance on Tags ( replacing user-data )
boverhof Aug 1, 2022
fd97493
CloudWatch VM metrics for queue peeks and job finish
boverhof Aug 2, 2022
5d429ea
Add region to CW client
boverhof Aug 2, 2022
ac6c57a
syntax error
boverhof Aug 2, 2022
7718d6b
Fix metrics
boverhof Aug 2, 2022
57bb30c
Move queue peek metric increment
boverhof Aug 2, 2022
a375f5f
Move peeks to just after sqs pop
boverhof Aug 2, 2022
7511e7f
Add dimension state 'empty' or 'start' to metric pop
boverhof Aug 2, 2022
cc96149
Change metric name to make it dimensional
boverhof Aug 2, 2022
d52eed1
Fixed state dimension
boverhof Aug 2, 2022
56972a7
Using MessageAttributes
boverhof Aug 3, 2022
e5fc047
Add Alerts for service failures
boverhof Aug 3, 2022
344dabc
Updates to foqusException
boverhof Aug 4, 2022
73d9479
Added couple asserts
boverhof Aug 12, 2022
c4d8307
Add log msgs and remove old log config
boverhof Aug 17, 2022
fcb924f
Fix for bug #1010 nodeVarList
boverhof Aug 24, 2022
9991deb
Update lambdas
boverhof Aug 24, 2022
c53c3ec
Updates to fix desktop UI with new FOQUS Cloud
boverhof Aug 24, 2022
a4f35cb
Merge remote-tracking branch 'upstream/master' into boverhof_cdk2_dep…
boverhof Aug 25, 2022
72e3099
Update version and aws-sdk
boverhof Aug 25, 2022
44ab439
update aws-sdk
boverhof Aug 25, 2022
98bf44f
Forgot to add post-session-stop
boverhof Aug 25, 2022
f135236
Merge remote-tracking branch 'origin/boverhof_cdk2_deploy_06.24.2022'…
boverhof Aug 25, 2022
4003f60
Update version/description
boverhof Aug 25, 2022
96c38cc
2022-09-29T17:46:19.270Z 96c56e0a-e4e3-4510-9d59-ea368ea087b2 ERROR (…
boverhof Sep 29, 2022
83d3dbe
Update UUID and debug packages
boverhof Sep 29, 2022
ec7be40
Merge remote-tracking branch 'upstream/master' into boverhof_node16_u…
boverhof Sep 29, 2022
8ea068f
Merge remote-tracking branch 'upstream/master' into boverhof_node16_u…
boverhof Oct 11, 2022
eb96026
Merge remote-tracking branch 'upstream/master' into boverhof_node16_u…
boverhof Oct 11, 2022
001ad3e
Remove duplicate method
boverhof Nov 8, 2022
e5d747f
black
boverhof Nov 8, 2022
b8b11cd
Merge branch 'master' into boverhof_node16_update_08.25.2022
boverhof Nov 8, 2022
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
2 changes: 1 addition & 1 deletion cloud/aws/node/delete-simulation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use AWS.DynamoDB'
console.log('Loading function');
const AWS = require('aws-sdk');
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
var validate = require('uuid-validate');

/*
Expand Down
10 changes: 5 additions & 5 deletions cloud/aws/node/delete-simulation/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "delete-simulation",
"version": "1.0.0",
"description": "Returns array of simulations",
"version": "2.0.0",
"description": "Delete simulation",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"uuid": "^3.2.1",
"uuid-validate": ""
"aws-sdk": "",
"uuid": "^8.3.2",
"uuid-validate": ">=0.0.3"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
1 change: 0 additions & 1 deletion cloud/aws/node/dynamo-stream-trigger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
'use strict';
'use AWS.S3'
'use AWS.DynamoDB'
'use uuid'
const assert = require('assert');
const log = require("debug")("dynamo-stream-trigger")
const AWS = require('aws-sdk');
Expand Down
8 changes: 3 additions & 5 deletions cloud/aws/node/dynamo-stream-trigger/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "dynamo-stream-trigger",
"version": "1.0.0",
"version": "2.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"debug": ">=4.1.1",
"node-lambda": "^0.16.0",
"uuid": "^3.2.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
1 change: 0 additions & 1 deletion cloud/aws/node/foqus-fake-job-runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @see https://github.com/motdotla/node-lambda-template
*/
'use strict';
'use uuid'
const AWS = require('aws-sdk');
const sqs = new AWS.SQS();
const sns = new AWS.SNS();
Expand Down
7 changes: 3 additions & 4 deletions cloud/aws/node/foqus-fake-job-runner/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "foqus-fake-job-runner",
"version": "1.0.0",
"version": "2.0.0",
"description": "for testing, Grabs job off SQS, sends job update notifications",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"uuid": "^3.2.1",
"debug": ">=4.1.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
1 change: 0 additions & 1 deletion cloud/aws/node/foqus-fake-job-runner/running.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @see https://github.com/motdotla/node-lambda-template
*/
'use strict';
'use uuid'
const AWS = require('aws-sdk');
const sqs = new AWS.SQS();
const sns = new AWS.SNS();
Expand Down
1 change: 0 additions & 1 deletion cloud/aws/node/foqus-fake-job-runner/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @see https://github.com/motdotla/node-lambda-template
*/
'use strict';
'use uuid'
const AWS = require('aws-sdk');
const sqs = new AWS.SQS();
const sns = new AWS.SNS();
Expand Down
1 change: 0 additions & 1 deletion cloud/aws/node/foqus-fake-job-runner/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @see https://github.com/motdotla/node-lambda-template
*/
'use strict';
'use uuid'
const AWS = require('aws-sdk');
const sqs = new AWS.SQS();
const sns = new AWS.SNS();
Expand Down
6 changes: 3 additions & 3 deletions cloud/aws/node/foqus-sns-update/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "foqus-sns-update",
"version": "1.0.0",
"description": "",
"version": "2.0.0",
"description": "Central Message Processor for front and backends",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0"
"aws-sdk": ""
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
8 changes: 4 additions & 4 deletions cloud/aws/node/get-session-list/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "get-session-list",
"version": "1.0.0",
"description": "Creates a new Turbine Session in S3 bucket under user",
"version": "2.0.0",
"description": "List of session resources (GUIDs)",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"debug": ">=4.1.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
8 changes: 4 additions & 4 deletions cloud/aws/node/get-session-result-page/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "get-session-result-page",
"version": "1.0.0",
"description": "Returns Simulation Flowsheet",
"version": "2.0.0",
"description": "Returns page of session results",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"debug": ">=4.1.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
8 changes: 4 additions & 4 deletions cloud/aws/node/get-session/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "get-session",
"version": "1.0.0",
"description": "Return all FOQUS jobs in a session",
"version": "2.0.0",
"description": "Returns FOQUS jobs (GUIDs) in a session",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"debug": ">=4.1.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
8 changes: 4 additions & 4 deletions cloud/aws/node/get-simulation-input-file/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "get-simulation-input",
"version": "1.0.0",
"description": "Returns Simulation Flowsheet",
"version": "2.0.0",
"description": "Returns staged-in simulation/{name}/input/{resource}",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"debug": ">=4.1.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
5 changes: 3 additions & 2 deletions cloud/aws/node/get-simulation-list/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "get-simulation-list",
"version": "1.0.0",
"version": "2.0.0",
"description": "Returns array of simulations",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
9 changes: 1 addition & 8 deletions cloud/aws/node/http-basic-authorizer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
'use strict';
'use AWS.DynamoDB'
'use uuid'
const AWS = require('aws-sdk');
//const table_name = "FOQUS_Resources";
const table_name = process.env.FOQUS_DYNAMO_TABLE_NAME;
Expand Down Expand Up @@ -139,12 +138,6 @@ var generateDeny = function(principalId, resource) {
return generatePolicy(principalId, 'Deny', resource);
}

function decodeBase64(str) {
return new Buffer(str, 'base64').toString();
}



var credentialsRegExp = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9\-\._~\+\/]+=*) *$/;

/**
Expand Down Expand Up @@ -188,7 +181,7 @@ function userFromBasicAuthString(header) {
*/

function decodeBase64(str) {
return new Buffer(str, 'base64').toString();
return new Buffer.from(str, 'base64').toString();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions cloud/aws/node/http-basic-authorizer/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "http-basic-authorizer",
"version": "1.0.0",
"version": "2.0.0",
"description": "Basic HTTP Custom Authorizer",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"debug": ">=4.1.1"
"aws-sdk": "",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
3 changes: 1 addition & 2 deletions cloud/aws/node/post-session-append/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
'use strict';
'use AWS.S3'
'use AWS.DynamoDB'
'use uuid'
const log = require("debug")("post-session-append")
const AWS = require('aws-sdk');
//const s3 = require('s3');
const fs = require('fs');
const dirPath = "./tmp";
const path = require('path');
const abspath = path.resolve(dirPath);
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const s3_bucket_name = process.env.SESSION_BUCKET_NAME;
const s3_sim_bucket_name = process.env.SIMULATION_BUCKET_NAME;
const tablename = process.env.FOQUS_DYNAMO_TABLE_NAME;
Expand Down
10 changes: 5 additions & 5 deletions cloud/aws/node/post-session-append/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "post-session-append",
"version": "1.0.0",
"description": "Adds a job array to a Turbine Session in S3 bucket under user",
"version": "2.0.0",
"description": "Adds an array of Jobs to a Session",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"uuid": "^3.2.1",
"debug": ">=4.1.1"
"aws-sdk": "",
"uuid": "^8.3.2",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
4 changes: 2 additions & 2 deletions cloud/aws/node/post-session-create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* @see https://github.com/motdotla/node-lambda-template
*/
'use strict';
'use uuid'
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');

exports.handler = function(event, context, callback) {
const done = (err, res) => callback(null, {
statusCode: err ? '400' : '200',
Expand Down
6 changes: 3 additions & 3 deletions cloud/aws/node/post-session-create/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "post-session-create",
"version": "1.0.0",
"description": "Creates a new Turbine Session in S3 bucket under user",
"version": "2.0.0",
"description": "Returns a new GUID for use as a Session resource",
"main": "index.js",
"dependencies": {
"uuid": "^3.2.1"
"uuid": "^8.3.2"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
3 changes: 1 addition & 2 deletions cloud/aws/node/post-session-kill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
'use strict';
'use AWS.SNS'
'use uuid'
const log = require("debug")("post-session-kill")
const AWS = require('aws-sdk');
//const s3 = require('s3');
Expand All @@ -19,7 +18,7 @@ const dirPath = "./tmp";
const path = require('path');
const abspath = path.resolve(dirPath);
//const s3_bucket_name = process.env.SESSION_BUCKET_NAME;
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const foqus_update_topic = process.env.FOQUS_UPDATE_TOPIC;

// post-session-start:
Expand Down
8 changes: 4 additions & 4 deletions cloud/aws/node/post-session-kill/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "post-session-kill",
"version": "1.0.0",
"version": "2.0.0",
"description": "Kill jobs in Turbine Session",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"uuid": "^3.2.1",
"debug": ">=4.1.1"
"aws-sdk": "",
"uuid": "^8.3.2",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
3 changes: 1 addition & 2 deletions cloud/aws/node/post-session-result/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
*/
'use strict';
'use AWS.S3'
'use uuid'
const log = require("debug")("post-session-result")
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const AWS = require('aws-sdk');
const tableName = process.env.FOQUS_DYNAMO_TABLE_NAME;
const s3_bucket_name = process.env.SESSION_BUCKET_NAME;
Expand Down
10 changes: 5 additions & 5 deletions cloud/aws/node/post-session-result/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "post-session-result",
"version": "1.0.0",
"description": "Creates a new Turbine Session generator result page in S3 bucket under user, returns page number",
"version": "2.0.0",
"description": "Creates a Turbine Session result page in S3 bucket under user, returns page number",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"uuid": "^3.2.1",
"debug": ">=4.1.1",
"aws-sdk": "",
"uuid": "^8.3.2",
"debug": ">=4.3.4",
"collections": ">=5.1.11"
},
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions cloud/aws/node/post-session-start/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
'use strict';
'use AWS.S3'
'use uuid'
const assert = require('assert');
const log = require("debug")("post-session-start")
const AWS = require('aws-sdk');
Expand All @@ -22,7 +21,7 @@ const dirPath = "./tmp";
const path = require('path');
const abspath = path.resolve(dirPath);
const s3_bucket_name = process.env.SESSION_BUCKET_NAME;
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const foqus_update_topic = process.env.FOQUS_UPDATE_TOPIC;
const s3 = new AWS.S3();
const sns = new AWS.SNS();
Expand Down
10 changes: 5 additions & 5 deletions cloud/aws/node/post-session-start/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "post-session-start",
"version": "1.0.0",
"description": "Moves jobs in Turbine Session to the Queue",
"version": "2.0.0",
"description": "Changes state of jobs in a Session to submit state (queued)",
"main": "index.js",
"dependencies": {
"aws-sdk": "^2.606.0",
"uuid": "^3.2.1",
"debug": ">=4.1.1"
"aws-sdk": "",
"uuid": "^8.3.2",
"debug": ">=4.3.4"
},
"scripts": {
"setup": "./node_modules/.bin/node-lambda setup",
Expand Down
Loading