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

New: Add worker service to serverless #6

Merged
merged 19 commits into from
Nov 18, 2019

Conversation

sarvaje
Copy link
Contributor

@sarvaje sarvaje commented Sep 11, 2019

No description provided.

@sarvaje
Copy link
Contributor Author

sarvaje commented Sep 24, 2019

I need to clean dependencies and '.*ignore', but I think this is ready for review

Copy link
Contributor

@utsavized utsavized left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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",
Copy link
Contributor

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?

Copy link
Contributor Author

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",
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

@@ -17,7 +17,7 @@
"scriptFile": "../dist/src/functions/azure/syncservice.js"
}
},
{
{
"name": "statusservice",
"template": {
"disabled": false,
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted!

}
});
};

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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.

@sarvaje sarvaje requested review from antross and molant September 25, 2019 15:55
@sarvaje sarvaje marked this pull request as ready for review September 25, 2019 15:55
@sarvaje sarvaje force-pushed the worker-serverless branch 24 times, most recently from 6e288e0 to fb2e3db Compare October 1, 2019 23:17
@sarvaje sarvaje force-pushed the worker-serverless branch 2 times, most recently from f594840 to d1de30e Compare October 31, 2019 21:02
@sarvaje
Copy link
Contributor Author

sarvaje commented Oct 31, 2019

move architecture.md to this repo

There is no architecure.md in the previous online scanner. I have created a task to add it.

@sarvaje
Copy link
Contributor Author

sarvaje commented Oct 31, 2019

@molant @antross this is ready for another review.

Copy link
Contributor

@utsavized utsavized left a 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.

Copy link
Member

@molant molant left a 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!

@sarvaje sarvaje merged commit 62528ec into webhintio:master Nov 18, 2019
@molant
Copy link
Member

molant commented Nov 18, 2019

image

🚀🎉🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants