Skip to content

Python package: helpers to run the New Hospital Programme (NHP) demand model using Azure Container Instances (ACI)

License

Notifications You must be signed in to change notification settings

The-Strategy-Unit/nhp_aci

Repository files navigation

NHP ACI helpers

Methods to start and run the nhp_model docker containers in Azure Container Instances (ACI).

This is predominantly an internal tool designed to help us manage our internal infrastructure.

Methods

nhp.aci.run_model.create_model_run

Takes the parameters that you want to run the model with, and what version of the model to run, then starts running the model in ACI.

Returns a dictionary containing the metadata of the model run, including the id of the model run that has just been created.

nhp.aci.status.get_current_model_runs

Gets the states of all of the currently running ACI container groups running.

If AUTO_DELETE_COMPLETED_CONTAINERS env var is set, then it will delete any ACI container instance that has successfully terminated.

nhp.aci.status.get_model_run_status

Gets the state of a specific ACI container group.

If AUTO_DELETE_COMPLETED_CONTAINERS env var is set, then it will delete any ACI container instance that has successfully terminated.

Set-up

In order to run this locally, you will need to install the Azure CLI. Once you have installed that, you will then need to sign in.

The easiest way to get started is to use uv. Create a new virtual environment (uv venv --python 3.12), then install dependencies with (uv pip install -e ".[dev]").

You will then need to create a .env file. There is a sample file (.env.sample) which you can use as a template. Speak to colleagues to get the correct values.

Running from the command line

If used with uv in the steps above, activate the venv, then you can run:

  • nhp_aci run
  • nhp_aci status
  • nhp_aci clean

for each of these commands, append -h to see the usage.

About

Python package: helpers to run the New Hospital Programme (NHP) demand model using Azure Container Instances (ACI)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages