Setup for Local Development¶
Installation¶
First, see our Local Deployment guide for instructions on how to install the latest release with Kubernetes with Helm 3.
Local Dev Configuration¶
The local deployment guide explains how to deploy Browsertrix with latest published images.
However, if you are developing locally, you will need to use your local images instead.
We recommend the following setup:
-
Copy the provided
./chart/examples/local-config.yaml
Helm configuration file to a separate filelocal.yaml
, so that local changes to it will not be accidentally committed to git.From the root directory:
-
Uncomment
backend_image
,frontend_image
, and pull policies in./chart/local.yaml
, which will ensure the local images are used: -
Build the local backend and frontend images. The exact process depends on the Kubernetes environment you've selected in your initial deployment. Environment specific build instructions are as follows:
Docker Desktop
Rebuild the local images by running
./scripts/build-backend.sh
and/or./scripts/build-frontend.sh
scripts to build the images in the local Docker.MicroK8S
MicroK8s uses its own container registry, running on port 32000.
-
Ensure the registry add-on is enabled by running
microk8s enable registry
-
Set
export REGISTRY=localhost:32000/
and then run./scripts/build-backend.sh
and/or./scripts/build-frontend.sh
to rebuild the images into the MicroK8S registry. -
In
./chart/local.yaml
, also uncomment the following lines to use the local images:
Minikube
Minikube comes with its own image builder to update the images used in Minikube.
To build the backend image, run:
To build a local frontend image, run:
K3S
K3S uses
containerd
by default. To use local images, they need to be imported after rebuilding.-
Rebuild the images with Docker by running by running
./scripts/build-backend.sh
and/or./scripts/build-frontend.sh
scripts. (Requires Docker to be installed as well). -
Serializer the images to .tar:
-
Import images into k3s containerd:
-
-
To change other options, uncomment them as needed in
./chart/local.yaml
or add additional overrides from./chart/values.yaml
.For example, to set a superuser email to
my_super_user_email@example.com
and password toMySecretPassword!
, uncomment that block and set: -
Once the images have been built and config changes made in
./chart/local.yaml
, the cluster can be re-deployed by running:
Refer back to the Local Development guide for additional information on running and debugging your local cluster.
Update the Images¶
After making any changes to backend code (in ./backend
) or frontend code (in ./frontend
), you'll need to rebuild the images as specified above, before running helm upgrade ...
to re-deploy.
Changes to settings in ./chart/local.yaml
can be deployed with helm upgrade ...
directly.
Deploying Frontend Only¶
If you are just making changes to the frontend, you can also deploy the frontend separately using a dev server for quicker iteration.