SAFE-template icon indicating copy to clipboard operation
SAFE-template copied to clipboard

Move default deployment to Linux OS

Open Akash-Mair opened this issue 4 years ago • 3 comments

Linux based apps are cheaper to run. We can create a recipe on how to move to Windows OS.

Akash-Mair avatar Sep 29 '21 09:09 Akash-Mair

I'm fully in favour of this - Linux is around 4x cheaper than Windows on App Service.

This would need update to Farmer and some minor changes to the template e.g. port number but otherwise not a lot. @theimowski what do you think?

The only other things we need to change are:

  • Logging: We can't use the app service logging extension any more
  • App Insights: We'll need to explicitly hook into AI in the server rather than the code-free approach now. This is a one-liner but needs doing.

isaacabraham avatar Oct 04 '21 09:10 isaacabraham

Fine with me 👍

theimowski avatar Dec 07 '21 20:12 theimowski

Other observation we've learned recently:

  1. Only one free Linux service plan per region / subscription. Unlimited free on Windows.

isaacabraham avatar Jan 14 '22 15:01 isaacabraham

Two changes are required to get the app working on a Linux app service:

  • Explicitly specify the .NET version in the Farmer web app
  • Remove the URL and port in Saturn so it uses a default one instead (which is 5000)

The second change also requires further changes to keep things working in the dev environment (replacing port 8085 with 5000 in launchSettings.json and webpack.config.js). The port number also needs to be updated in SAFE docs.

theprash avatar Sep 06 '22 15:09 theprash

I have a new PR #528 (which I propose we use instead of #498) which makes the changes described in my previous comment but doesn't actually set Linux as the OS.

I'll open a PR to update the docs. We might need to mention in the docs that there are 2 possible ports depending on your SAFE template version.

theprash avatar Sep 06 '22 16:09 theprash

Do we definitely want to enable Linux by default given the restriction to just one free Linux instance? The good news is that after my PR, the recipe to switch to Linux is a 1-line change.

Another option is we stick to Windows as a default but add it explicitly in Farmer rather than relying on an implicit default. That way it might more obvious how to switch to Linux and we wouldn't even need a recipe.

theprash avatar Sep 06 '22 16:09 theprash