Thriving ecosystem and superior automation

Hello,
I am porting my ServiceStack applications from .NET Framework to .NET 5.0 especially to be able to host on Linux systems mainly for cost savings. I am happy I am using the ServiceStack framework, it is quite painless to upgrade :grinning:
I am reading on this page:
https://docs.servicestack.net/netcore#linux-cost-savings

In addition to the [Linux] thriving ecosystem and superior automation…

Can anyone give me some pointers I can research?
Or do you mean essentially Docker? (https://docs.servicestack.net/deploy-netcore-docker-aws-ecs)

We’ve got 2 additional approaches documented for publishing multiple .NET Core Apps on a single instance:

Although @layoric is currently working on making deployments a lot nicer in the next release where you’ll be able to mix in a couple of popular deployment configurations into your project to get GitHub Actions to perform Docker App deployments.

Using rsync as above would be a little more efficient as your Apps would be running without a Docker container overhead, but the utility of using Docker allows for a higher level of automation and makes it easier to setup a custom infrastructure configuration used by your Apps with docker compose.

1 Like

Linux and Docker have a lot of tooling that can be taken advantage of when it comes to operating environment as well as dev command line/bash tooling over Windows native environments for hosting which are also more expensive.

From a hosting perspective, Docker removes a lot of annoying pain points when it comes to shifting between slightly different environments (CI vs prod for example) and the problems that can trip you up. If you aren’t familiar with Linux tooling it can seem a bit foreign to start with but is a skill set well worth learning (and persevering) as even .NET is getting better to use with Linux for a while now.

Although containers do have overheads (like IO penalties), they are generally are a good choice. Being able to use common Linux bash tools can make a lot small automation tasks a lot simpler than PowerShell or other Windows specific tools which is part of that statement.

If you haven’t yet got a CI (Continuous Integration) environment, I’d strongly recommend checking out GitHub Actions. They are very composable + maintainable way of automating your CI process that sits right with your code which does make things easier to manage/think about.

GitHub Container Repository is still in beta but is free for now, though it is missing some of the more mature features of other providers if you are thinking of using docker (eg image life cycle policy).

2 Likes

Thank you both this is helpful. I have lot of reading to do and a new world to discover.

I was also looking at the following possibility as something to look for when moving to Linux:

Let’s take for example this:


It is a .NET wrapper for a library Ghostscript (to convert PDF as Images)
There is a pull request for a .NET Core wrapper.
What I was thinking is a .NET 5.0 wrapper to a Linux Ghostscript.EXE (I read Ghostscript is supplied as part of every major Linux distribution).

Another example is this wrapper
https://www.nuget.org/packages/NReco.PdfGenerator.LT
When running on Linux it would use a Linux installed “wkhtmltopdf.exe”

Linux would have a lot of tools / programs like this (I thought it was what you mean by ecosystem)
And we could write simple .NET Core wrappers around them (creating an API) and be able to use them in our ServiceStack applications running on Linux.

I was personally referring to the ecosystem around managing infrastructure & deployments, load balancers, reverse proxies, inc. infrastructure software like MySql, PostgreSQL, Redis, etc. all have first-class support & run best on Linux.

As for specific linux utilities, if they’re not installed by default they’re all (depending on your distro) just an apt, yum, dpkg or rpm install away. If you’re using Docker you’ve essentially got to do this to install all the software your Docker App makes use of.

I’m assuming NReco.PdfGenerator.LT is just a pretty C# API wrapper around WkHtmlToPdf which is just executing the external process via shell commands. If you need to do this a lot you might be interested in ServiceStack’s cross-platform ProcessUtils.cs Process/Shell APIs which is used extensively in https://gist.cafe to execute code & projects in 23 different languages.

Thank you, I will move to Linux sooner than later now!
I like your code to run an Async Process, very useful. Thank you!