Skip to content
Rachel-Alcraft edited this page Dec 19, 2022 · 19 revisions

#BMA Development

Overview

The BMA project is a .Net project written for Azure. It consists of Azure Functions and a client web server - 2 seperate components - both published to Azure through Ben Hall's lab's credentials.

It should be the case that .Net can be multi-platform, but many of the projects are tied to NetFramework which is windows only, so there is a bit of entanglement in the projects. Some projects have tried to remove framework, but then others require it. There can be problems.

Adding complexity, is the standalone version of BMA. This forces the client and server to be linked as the standalone versions builds them both into one. To accomplish this, many of the code files have multiple projects building them, outputting different dlls and exes to different places. This adds to the complexity as mentioned above due to some inconsistent frameworks.

Ideally, there would be no projects building out the same files, but an organised structure of multi-platform static libraries and dlls, with only those elements that currently require framework to use it at the final stage.

The primary need for framework currently is the client as it uses a framework dependent http protocol. NetCore has replaced this with a cookie method - it could be reworked, but it is code work not just a #include change.

The other tie to windows is via some of the third party dlls used - specifically cudd and attractors. These are in the BioCheckConsole project and both explicitly #include <windows.h> the implications of not doing so are to be investigated. The linux project does not use these libraries so the functionality from these is not available there at the moment.

Visual Studio

The version currently being used is VS2019 and the scripts have been updated to reflect this.

Languages

The project is written in C#, F#, C++, C, javascript, typesript, html, css, powerscript - and I added a little bit of python for the release scripts.

Powershell Scripts

There are a set of powershell script to prepare the builds. One set are in the root directory and these should be run when a clone is first created to prepare all the files.

./PrepareRepository.ps1

./build.ps1

Then you can run the standalone version with:

./run.ps1

Check here if you have policy restriction errors: https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts

The second set of scripts prepare the build for release. More info on this is in the ReleaseDocs

Standalone version

The standalone version hosts a client/server on local host 8224.

The solution is in sln/bmaclient.sln

The standalone can be run from project bma.selfhost

This packages together client code from src/bma.client and server code from src/BioCheckAnalyzer

Console version

The console version is built as part of the standalone version for release (see release procedure). For the console version alone, the solution is sln/BioCheckConsole and includes the main project BioCheckConsole, along with BioCheckAnaylzerCommon which exposes functions to BioCheckConsole, BioCheckAnalyzer which does the main analytic work, along with external libraries Attractors and Cudd (these externals have windows ties).

Client

This is in the project sln/bmaclient and contains a complex set of projects. primarily you need to run:

  • bma.client to debug/test the client web app, which hosts on 33584 and needs a backend running, configured in the web.config to be the localhost of the server (below) by default.
  • bma.selfhost to test the integrated client-server-in-one, which hosts on 8224

When trying to make code changes:

  • The css is generally in bma.package/css/*.less for example see this banner change
  • Icons can often be be found in bma.client/images, for example see the change made to an "A" in this checkin: "A" change

Backend/Server

This is the project sln/BackendFunctions and has a similar structure of code dependencies to the console version, but using the projects with "_Standart". The projects are, from top to bottom very roughly:

Core:BackendFunctions ->BackendUtilities_Core->

Standart:BmaBioCheckAnalyzer_Standart->BioCheckAnalyzer_Standart->BioCheckAnalyzerCommon_Standart->JobsRunner_Standart

(There should also be references to z3, cudd and attractors)

When running the server for testing on your machine, run the Core/BackendFunctions project. It hosts on 7071, with the functions available in the manner of ServerVersion

The code exposes functions written in F# via some C# interfaces, ultimately to either Azure Functions via the BackendFunctions project, or in the Console and Standalone projects these same files are exposed in the non "_standart" projects.

Regression tests

The readme.md for the project has the information on testing: BMA Testing

Be aware that the regression tests can fail to run after the backend has been built so in this case get a clean build. See below.

When things go wrong

The github version should be good and reproduceable. Sometimes circular and incompatible dependencies can cause some aspects of the build not to work: e.g. after buiilding the Azure functions server project sln/BackendFunctions the regression tests sometimes no longer work. Get a clean newly cloned build and try again when such things happen. There is a ps1 script Clean.ps1 that tries to clean the build - it deletes all the obj directories - but there is something that it is missing so if you find it please update this script.

Clone this wiki locally