Skip to content
Rachel-Alcraft edited this page Apr 18, 2023 · 87 revisions

Releasing BMA to the Azure Website from UCL

An extra note on 32bit vs 64 bit versions: 32_64

Using VisualStudio version 2019 ...

Prior to release:.
  • Agree staging release and production release dates, with a week between them to allow for acceptance testing.
  • Update the Release Notes
  • Update the version number in the 3 prepare scripts:

Release Updates

  • Test the release: the regression tests are in the bmaclient solution

BioModelAnalyzer/sln/bmaclient/bmaclient.sln

  • Rebuild-all in debug x86
  • in the folder Tests, Right-click (build) and select "Run Tests", or select Test from the main menu bar.
  • The Tests must be run before the rest of the release is prepared as they are run on the debug build.

Note that the regression tests won't work once the Backend has been created for release due to some version circularity still being resolved.


Tag the release:
  • Check in all code
  • Pull to master
  • Tag the version - from the git command line:

git tag v1.13.2 (or whatever version) (n.b. to checkout a specific tag not in a branch call git checkout tags/v1.12.2 )

git push origin --tags

  • Create a "release" through the github web interface
    • On the Releases page Draft a new release
    • Create it from the tag and the code is automatically attached

Create the release:
  • Github now contains a good clean ready to release version. You can clone this version into 2 clean directories, e.g. vCLIENT and vSERVER. Note this is not necessary as you can release both from the same repo installation, but when publishing to Azure a build is automatically run - this way you can ensure that the same version is published to staging and production by having nothing else built between times.

For BOTH versions run the preparitory scripts:

.\PrepareRepository.ps1

.\build.ps1

.\run.ps1

  • The run script will start a local client/server version on local host 8224.
  • if there are execution problems run this
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

For vCLIENT

  • You want to make that the client runs. To do this:
    • Open sln/bmaclient/bmaclient.sln
    • Run (ctrl-F5) bma.client in Release mode.
    • The client is hosted on localhost 33584

Navigate to deployment, make sure the version and directory are correct in the ps1 files (see image above) - the scripts automatically update the version in all the appropriate files.

> deployment>.\PrepareClient.ps1
> deployment>.\PrepareStandalone.ps1

For vSERVER

  • You want to make that the server runs. To do this:
    • Open sln/BackendFunctions/BackendFunctions.sln, clean and rebuild.
    • Run (ctrl-F5) BackendFunctions in Release mode, clean and rebuild.
    • The server will run on 7071, you can check it is running with: TestAPI

Navigate to deployment, make sure the version and directory are correct in the ps1 files (see image above) - the scripts automatically update the version in all the appropriate files.

deployment>.\PrepareServer.ps1

A note on the Function App services - there is a menu option CORS - when creating a Function App this needs to have the setting *. For all fwd hosts it says that javascript functins can be forwarded to it form anywhere.

For vCLIENT and vSERVER

They work together - by default, the client web.config is set to

<add key="BackEndUrl" value="http://localhost:7071"/>

It can be changed to test the staging or production servers if necessary with either of

Production <add key="BackEndUrl" value="https://bmafunctionscore.azurewebsites.net"/>

Staging <add key="BackEndUrl" value="https://bmafunctionscore-tst.azurewebsites.net"/>

Free 32-bit <add key="BackEndUrl" value="https://bmafreetest.azurewebsites.net/"/>


Attach the msi file:

The msi file is the installer than can be downloaded from the web for a standalone installation.

  • Add the msi file to the candidate release. The msi file was build by the script PrepareStandalone.ps1 and can be found in the directory:
    • src/bma.client/installer/bma.install.msi
    • Check the timestamp is as you expect.
  • Drag this into the Assets section of your release notes on the github website.

Testing the release:
  • Check the bma.install.msi works
    • First uninstall the existing one (if it is a later version of the one installed it is fine but if you have been testing it may not be).
    • dbl-click on src/bma.client.installer/bma.install.msi
    • The application will run on local host 8224
  • The Client/Server should work, in release, as per the instructions in "Create the Release".
  • All versions - standalone and Client/Server should be acceptance tested with the following tests (##TODO##)

Pushing the release to staging:

!!! Make sure you use the test versions of the publish profiles !!!

First vSERVER

  • Open BioModelAnalyzer/sln/BackendFunctions/BackendFunctions.sln

Is it a 32 bit version? (free).

Or in fact, it is possible that all deployed versions need this, although it will not run locally so you need to change between the 2.

If so then you need to make an additional change to the settings.
For the project BioCheckAnalyzer_Standart
Right-click "Manage Nuget settings"
Go to Installed
REMOVE Microsoft.Z3 leaving Microsoft.Z3.x86 only (versions 4.11.2)
Then build this in debug
Then build this in release

NOTE it is possible that yo need the x86 version anyway - test the z3.dll by running ToyModelUnbstable and then Further testing - a z3 popup will alert you to errors.
...continue...
  • Go to the Publish page -> Build/Publish BackendFunctions
  • Obtain the publish profile credentials either from Azure, or from the private UCL repository BmaCredentials. The publish profiles are stored in the folder of the confidential BmaCredentials repo
PublishProfiles/
             BackEnd/
                  Production = bmafunctionscore.PublishSettings
                  Staging = bmafunctionscore_tst.PublishSettings
                  Free32Bit = bmafree_functions.PublishSettings

BmaCredentials/PublishProfiles/bmafunctionscoretest.PublishSettings

  • The file should be changed to use "Web Deploy.pubxml" (it comes as Zip deploy by default).
  • Press the "Publish" button.
  • Once it says "successfully published, check this is correct with the function: ServerVersion
  • _Optionally _make the staging version write to the logger - to be decided, if so, update the local.settings.json file with the UCL credentials from the private UCL repository:

BmaCredentials/BackendJson/local.setings.json

  • Copy over the contents of this file onto the local.settings.json file on the Azure server: Dashboard/bmafunctionscoretest/App Server Editor (preview) (press Go)

Finally vCLIENT(which includes the standalone version).

  • Open BioModelAnalyzer/sln/bmaclient/bmaclient.sln
  • Go to the Publish page -> Build/Publish bma.client
  • Obtain the publish profile credentials either from Azure, or from the private UCL repository BmaCredentials.

The publish profiles are stored in the folder of the confidential BmaCredentials repo

PublishProfiles/
             WebApp/
                  Production = bmainterface.PublishSettings
                  Staging = bmainterface(tst).PublishSettings
                  Free32Bit = bmafree_webapp.PublishSettings
  • The file should be changed to use "Web Deploy.pubxml" (I think this is the default for this one).
  • Press the "Publish" button.
  • It automatically opens the client web api: Staging BMA
  • This will overwrite a config file with the publically available file for standalone testing in the public github repo. The UCL credentials are in the private UCL repository:

BmaCredentials/WebConfigs/staging_web.config

  • Copy over the contents of this file onto the web.config file on the Azure server: Dashboard/bmainterfacetest/App Server Editor (preview) (press Go)
    • onto the file Web.config (it saves automatically).

Assuming all is well in acceptance testing, this same build will simply be pushed to production in 1 week with no further changes.


Acceptance testing #1: Staging:
  • The staging version can be found here: BMA Staging

  • Users emailed to inform about the release, with a request to feedback any problems within 1 week.

  • The standalone version should work and not have Z3 errors, in the bmaconsole app try the following:

biocheckconsole.exe -model C:\UCL\github\BmaIssues\47_Popup\ionchannelBug.json -engine FIXPOINT -log

Note you may need to give your c/program files permissions to write for the log creation

  • The client web app should work and not give z3 errors, run ToyModelUnstable/Further Testing

Pushing the release to production:

Very similar to the push to staging, but !!! make sure you use the production versions of the publish profiles !!!

First the vSERVER

  • Open BioModelAnalyzer/sln/BackendFunctions/BackendFunctions.sln
  • Go to the Publish page -> Build/Publish BackendFunctions
  • Obtain the publish profile credentials either from Azure, or from the private UCL repository BmaCredentials.

BmaCredentials/PublishProfiles/bmafunctionscore.PublishSettings

  • The file should be changed to use "Web Deploy.pubxml" (it comes as Zip deploy by default).
  • Press the "Publish" button.
  • Once it says "successfully published, check this is correct with the function: ServerVersion
  • Ensure it writes to the logger - update the local.settings.json file with the UCL credentials from the private UCL repository:

BmaCredentials/BackendJson/local.setings.json

  • Copy over the contents of this file onto the local.settings.json file on the Azure server: Dashboard/bmafunctionscore/App Server Editor (preview) (press Go)

Finally the vCLIENT(which includes the standalone version).

  • Open BioModelAnalyzer/sln/bmaclient/bmaclient.sln
  • Go to the Publish page -> Build/Publish bma.client
  • Obtain the publish profile credentials either from Azure, or from the private UCL repository BmaCredentials.

BmaCredentials/PublishProfiles/bmainterface.PublishSettings

  • The file should be changed to use "Web Deploy.pubxml" (I think this is the default for this one).
  • Press the "Publish" button.
  • It automatically opens the client web api: Production BMA
  • This will overwrite a config file with the publically available file for standalone testing in the public github repo. The UCL credentials are in the private UCL repository:

BmaCredentials/WebConfigs/production_web.config

  • Copy over the contents of this file onto the web.config file on the Azure server: Dashboard/bmainterface/App Server Editor (preview) (press Go)
    • onto the file Web.config (it saves automatically).

Acceptance testing #2: Production:

A sanity check to be performed for final acceptance testing

  • ##TODO## release confirmed by email?
  • Run through the same tests as acceptance staging - note these are for the dev, there should be user's own acceptance too.

Clone this wiki locally