Last modified: Apr 22, 2024

Development

Install Docker with Docker Desktop

Prerequisites Docker Desktop requires a paid license. If you don’t have a license, see Install Docker without Docker Desktop Installation ⚠️ DO NOT install Docker Desktop if you don’t have a paid license. Windows https://docs.docker.com/desktop/install/windows-install/ Mac https://docs.docker.com/desktop/install/mac-install/ Linux https://docs.docker.com/desktop/install/linux-install/ »

Installation of Traefik 2.0

Installation of traefik is done through helm, and we have a traefik helm chart for Altinn Tjenester 3.0. If there is a fresh installation of traefik 2.0 with helm 3.0, make sure that there is a folder called crds in that helm chart folder. After that it is just to install with helm, and wait for the traefik service to have a public IP before updating the Azure DNS zone with a A record. »

k6

k6 is a developer-centric, free and open-source load testing tool built for making performance testing a productive and enjoyable experience. read more about K6 here Set up k6 tests Clone the k6 tests from GitHub Repo Install docker and make sure the drive having the k6 tests is shared. Open cmd and download the latest k6 docker image docker pull loadimpact/k6 How to write k6 tests Find the area/collection where the new test has to be added. »

Logging

This page is a work-in-progress. Because we do not have details on how potential errors should be shown to the users, this is only a general overview currently. More details will be added once we have a functional understanding of how users should experience errors. Logging .Net core provides a standard logging framework that can be used to log exceptions or events to a desired logging provider (console, eventlog, azure app service, application insights). »

Install Docker without Docker Desktop on macOS

⚠️ TODO: This page is outdated. Should be updated now that Podman 5 supports the native Apple hypervisor (applehv). https://github.com/containers/podman/releases/tag/v5.0.0 Prerequisites Uninstall Docker Desktop If you have already installed Docker Desktop, you must uninstall it. You can do this either from the UI or using the command line: https://docs.docker.com/desktop/uninstall/ ⚠️ DO NOT remove files manually, as it might not uninstall Docker Desktop properly. Install Homebrew Homebrew is a package manager for macOS. »

Naming Conventions

C# The Altinn project will use Microsoft’s coding conventions as a general guideline when no other guidelines are given. Exceptions/additions to the general guideline: Implicit typing (var) should only be used when a variable is initialized with an anonymous type, which is a common scenario in LINQ query expressions. In general implicit typing makes the code more difficult to read and understand,and should be avoided. Altinn specific coding guidelines: Methods should not be more than 50 lines long When dealing with XML you should prefer XDocument to XmlDocument (especially in new methods) If/for/while/using and other structures should normally not be more than 2-3 levels deep All disposeable objects (proxies, DbCommand and so on) should be disposed by using a using block. »

Nginx loadbalancing in studio

Nginx routing The router config is stored as a configmap in our kubernetes cluster, and mounted to the pod as a .conf file. When the config needs to be changed, the changes should be done in the loadbalancer-configmap for the correct environment (dev/prod). Apply the changes, and restart the pod: Option 1: kill the pod and let the deployment spinn up a new pod. Option 2: open a shell into the pod kubectl exec -it [POD_NAME] -- sh and run the command nginx -s reload »

Nginx routing

Nginx routing The router config is stored as a configmap in our kubernetes cluster, and mounted to the pod as a .conf file. When the config needs to be changed, the changes should be done in the loadbalancer-configmap for the correct environment (dev/prod). Apply the changes, and restart the pod: Option 1: kill the pod and let the deployment spinn up a new pod. Option 2: open a shell into the pod kubectl exec -it [POD_NAME] -- sh and run the command nginx -s reload »