An All-In-One Tool for Managing Mesonets. Each directory starting with mbx-
is a standalone module that can be spun up as a docker-compose service. Each mbx-
directory is a git submodule that is pointing to another repository. To make sure submodules are up-to-date, run the following steps when cloning or pulling:
- Clone the repository:
git clone https://github.com/mt-climate-office/mesonet-in-a-box.git
- Initialize the submodules and get them up to date:
git submodule sync --recursive
git submodule update --init --remote --recursive
- Alternatively, you can run
./pull.sh
, which will both pull from the main repo, and run the above two commands.
- Run
docker network create web
- Run
docker compose up --build -d
- Install uv to manage python dependencies:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Initialize virtual environment with
uv sync
. - Configure the
mbx
command line tool by running:uv run mbx --no-check configure
.
- On home AirTable page, click the
...
next to the Montana Mesonet base and click "Duplicate base". Name the new base "mbx_copy". - Make sure you have an AirTable API token with read/write permissions to the mbx_copy base.
- Store the key as an environment variable called "AIRTABLE_API_KEY".
- Open the new base, and click the
Share
icon in the top right corner of the screen.Share publicly
>Enable shared base link (read-only)
. Copy the URL that is generated. - Edit every
id
field that is a formula type. Formulas aren't supported in AirTable > NocoDB migrations. For each table, right click the formula field > Edit Field > Change the dropdown to "Autonumber". - Go to http://localhost:8080 or whatever domain NocoDB is being hosted on and login.
- On the homepage, click
Create Base
and name itMontana Mesonet
. - In the new base, click the
Import Data
button and chooseAirTable
. - Paste in the url generated above and your API key. Uncheck
Import Secondary Views
. - Click
Import
.
- On the homepage, click
- Run
uv run mbx create-schema-from-existing
and select the "Montana Mesonet" base when prompted. This will print out a file path. Copy this path for the next step. - Run
uv run mbx clean-nc-tables the/path/you/copied.json
. This command re-creates old formulas, sets primary column values, and rolls all columns that aren't used in mesonet-in-a-box into a JSON column so that information is maintained.