5 min read

.NET 6 version of LAIKA is here

.NET 6 version of LAIKA is here
Photo by Sean Oulashin / Unsplash

Dear LAIKA users, developers and administrators. Our team is happy to announce that new release of platform that is based on .NET 6 was tested, checked and released.

We are so happy to introduce a new LAIKA 3 release that is fully .NET 6 based. It is better, faster and contains a lot of significant advantages.

It's extremely important to update the .NET Core 3.1 to .NET 6 since the official support of .NET Core 3.1 ends at December 13, 2022. It means that after that .NET Core 3.1 will not get any updates including security updates which is not safe in terms of the possible security issues.

Photo by AltumCode / Unsplash

Changes

We updated version of framework from .NET Core 3.1 to .NET 6 not only to extend support period of the framework, but also to perform a lot of important changes inside the platform.

Here is a change log of the most important changes:

  1. Latest version of .NET 6 is used. It's a LTS release which means that runtime and SDK will be supported  till November 12, 2024.
  2. All project files for all LAIKA applications and services were upgraded to .NET 6.
  3. Almost all 3rd party packages were updated to the latest versions to increase stability, performance and security of the platform.
  4. Outdated hosting components such as libuv or RedHat Linux Transport were removed. This change will provide better performance in high-load scenarios especially for Linux-based installations (both VM and Kubernetes based).
  5. Application startup approach was standartized and optimized for all applications. For old versions of .NET Core 2.1/3.1 we applied a set of fixes and workarounds to provide better performance in high-load conditions, but currently it's better to use a default approach since it works better.
  6. New build script for local Docker images was implemented to achieve better perfomance during build process (avaiable for both Linux and MacOS, also in Windows using WSL2). It could be useful for LAIKA development in cases when you plan to use local environment based on Docker.
  7. Docker compose files were updated and currently allows to run local LAIKA environment inside Docker by executing of a single command (applicable for Windows, Linux and MacOS). MongoDB payload was created to initialize LAIKA databases in such scenario.
  8. Overall performance of the solution was improved. According to the synthetic tests of LAIKA team LAIKA performs in 9% in average, up to 30-40% faster in some specific scenarios. It may vary in both sides depending on your specific business and use-cases.
  9. Perfomance improvements for build process (whole solution could be built from scratch in less that 40 seconds).
  10. Performance improvements in terms of Docker image build process (especially in terms of restore operation).
  11. Linux packages were updated in Dockerfiles, outdated packages were removed.
  12. Ubuntu 20.04 LTS Focal Fossa (focal) is used as a base layer for Docker images.
  13. Starting from this release LAIKA could be built and executed on Apple Silicon (Apple M1), so you could build your development environment using the latest Apple Macs.

“Talk is cheap. Show me the code.”
― Linus Torvalds
Photo by Mohammad Rahmani / Unsplash

Update of the installations

Update of VM installation

To run new version of LAIKA platform on Windows Server you have to download and install Hosting Bundle for .NET 6. You could download it here for the version of SDK described in global.json or the latest Hosting Bundle/Runtime release (it will be compatible with your binaries).

After that perform usual build and deployment process. You could remove previously installed .NET Core Hosting Bundle and Runtime if it is not needed anymore and it is recommended approach to be sure that correct version of runtime is used.

Update of auto-scaling cluster installation and images

IMPORTANT: If you're using just binary Docker images from LAIKA Docker repository you could skip this part. They will be upgraded automatically. This section is important if you're building Docker images from the source code on your project.

.NET 6 release contains important changes in terms of images creation and lot of improvements both in terms of build process and packages used.

IMPORTANT: If you're using Dockerfiles from LAIKA source code repository just follow the steps below. If you storing it somewhere else as a part of CI/CD process please update your copies with files from LAIKA source code repositories.

Perform the following steps:

  1. Change build image to mcr.microsoft.com/dotnet/sdk:6.0-focal
  2. Change application image to mcr.microsoft.com/dotnet/aspnet:6.0-focal
  3. Add the following line to your CI/CD pipeline after checkout and before build process:
find . -name '*.csproj' -o -name '*.sln' -o -name 'nuget.config' | sort | tar cf dotnet-restore.tar -T - 2> /dev/null

This step will create dotnet-restore.tar file that later will be used as a source of csproj files during restore step inside build image. It allows Docker to cache restore results and will speedup the build process. After that add additional step to your pipeline that removes dotnet-restore.tar file after successful build.

Update of the custom code

IMPORTANT: It's highly recommended to perform upgrade of your custom code to .NET 6 to use it together with LAIKA. Luckily .NET Core 3.1 to .NET 6 has a straightforward upgrade path.

An official upgrade guide from 3.1 to 6 contains all of the necessary information. Please follow it to migrate your applications.

Quick checklist:

  1. Update SDK version in global.json file
  2. Update TargetFramework in your csproj files
  3. Update referenced Microsoft libraries to 6.0.x
  4. Update the rest of the NuGet packages to latest versions where it's possible
  5. Remove bin and obj folders
  6. Update base images for your Docker images and review the contents of your Dockerfiles to use Ubuntu 20.04 LTS Focal Fossa (focal) instead of Ubuntu 18.04 LTS
  7. Remove extra references of Microsoft libraries inside your csproj files
  8. Carefully review Breaking changes in .NET 5 and Breaking changes in .NET 6
  9. You may try Minimal Hosting Model for your application but LAIKA stays with full-featured Program.cs and Startup.cs for better control

Update of Development Environment

This section is applicable if you are running your own devleopment environment and want to upgrade it for the next LAIKA release. To update existing development environment on your local machine you have to perform the following steps:

  1. Install new .NET 6 SDK
  2. Install Node.js 18
  3. Install Visual Studio 2022 (optional step)

Please let us know if you need more details.

Conclusion

The .NET 6 is gread update of framework it is not only extend the support period and provides a lot of new features to developers. It is also contains a lot of improvements. And as a result new LAIKA 3 becomes better in terms of stability, maintenance and performance. We introduced a lot of changes in this update: we updated stability, updated 3rd party components, introduced local Docker environment, improved build process and improved performance (in some specific cases in 9-60%). We happy to announce that to wide audience and hope that you will like the new release of our platform.