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.
- Install the Azure CLI and sign in.
- Use uv to create barebones environment:
uv init --bare. This creates apyproject.tomlthat you can add packages to. - Add nhp_aci to your environment,
uv add git+https://github.com/The-Strategy-Unit/nhp_aci. You should see nhp_aci now listed in thepyproject.toml - Create an environment using your
pyproject.tomlwithuv venvand then activate it with.venv\Scripts\activate - To install from the
pyproject.toml, useuv sync
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.
Once you have installed nhp_aci and got a valid .env files, you should be able to run the following commands:
nhp_aci runnhp_aci statusnhp_aci clean
for each of these commands, append -h to see the usage.
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.
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.
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.