-
Notifications
You must be signed in to change notification settings - Fork 11
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
New: Add worker service to serverless #6
Conversation
1e48113
to
739275e
Compare
I need to clean dependencies and '.*ignore', but I think this is ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few sanity-check questions.
host.json
Outdated
"serviceBus": { | ||
"messageHandlerOptions": { | ||
"maxAutoRenewDuration": "00:01:00", | ||
"maxConcurrentCalls": 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These settings apply to all functions, right? Could there by any impact on the other functions, or they all ran fine? Just wanted to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That file doesn't exists in that path anymore, but yes, it would apply to all functions I think.
For know, worker has this config, and the other functions use the default values.
When everything is in the same function, we will need to figure out if each function can have their own config, because for sync
I think we can have more concurrent calls
"dependencies": { | ||
"@azure/functions": "^1.0.3", | ||
"@destinationstransfers/ntp": "^2.0.0", | ||
"@octokit/rest": "^16.28.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need any of these as dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in the root. remember that this is now a monorepo, each package has its own package.json
@@ -55,16 +40,27 @@ | |||
"private": true, | |||
"scripts": { | |||
"ava": "ava", | |||
"build": "npm run clean && npm-run-all build:* && npm run build-function-templates", | |||
"build": "yarn clean && yarn update:references && node scripts/test-all.js build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are having all the functions as packages now, instead of just being folder at the root? Why is that? Nothing wrong with it, I was just curious. Also, since the structure changes, I suppose the current pipeline will fail to deploy these functions, right? Have you tried the new structure is okay with Azure, by manually deploying these, or were you testing the workers only with existing already-deployed functions? I am asking because in my experience, the functions have been really particular about folder structures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talk a few days ago, we are turning this in a monorepo, in this case, all functions except 'workers' are going to a folder, utils are going to another and then workers.
The deployment process is something that we need to figure out, but each "function" folder ('services' and 'worker') should contains everything necessary to be deployed in azure functions. We need to think about the utils, do we need to publish it in npm? can we use it without deploy it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About utils
for now I'm referencing to the path: "@online-service/utils": "file:../utils"
so we don't need to publish it. The only think is that we need to be sure that 'utils' is compiled before use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could look into bundle everything with webpack. It should decrease the load time as there will not be hundreds of smaller files. Maybe for another update?
packages/services/functions.json
Outdated
@@ -17,7 +17,7 @@ | |||
"scriptFile": "../dist/src/functions/azure/syncservice.js" | |||
} | |||
}, | |||
{ | |||
{ | |||
"name": "statusservice", | |||
"template": { | |||
"disabled": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this file anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is the one used to build the function.json for each function. Do you want me to delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted!
} | ||
}); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need this file either, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted!
functions: | ||
sync-service: | ||
handler: dist/functions/azure/sync-service.run | ||
events: | ||
- serviceBus: | ||
- serviceBus: | ||
x-azure-settings: | ||
queueName: webhint-results | ||
name: message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about changes in this file for now. To make Serverless.yml work, step 1 was to convert everything to functions, which we are close to completing. Step to is for me to either send a PR to them, or fork our own version and update all the Azure dependencies and some logic because they are lagging behind by more than a year.
6e288e0
to
fb2e3db
Compare
f594840
to
d1de30e
Compare
There is no architecure.md in the previous online scanner. I have created a task to add it. |
6bbbd08
to
b1fd1ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship it!
No description provided.