- Docker Engine
git- Helm
kubectl- Minikube
- Tilt
-
Clone the repository to your local machine
git clone https://github.com/virtool/dev.git -
Create a Cluster
bash scripts/init.sh
This:
- Deletes any existing cluster.
- Creates a cluster using preset resource limits.
- Enables the ingress and metrics addons for Minikube.
You can run commands from
init.shindividually if you want to customize the cluster. -
Add the cluster IP to
/etc/hosts:bash scripts/hosts.sh
This puts the IP for the Minikube cluster in
/etc/hostsforvirtool.local. This will make requests tovirtool.localon your machine route to the cluster. -
Set up HTTPS with mkcert:
# Install mkcert if not already installed mkcert -install # Create certificate for virtool.local mkcert virtool.local # Create Kubernetes TLS secret kubectl create secret tls mkcert --cert=virtool.local.pem --key=virtool.local-key.pem
This enables HTTPS for
https://virtool.localusing a locally trusted certificate. -
Start Tilt
tilt up
Tilt manages the Kubernetes development environment. It starts all necessary services (KEDA, MongoDB, OpenFGA, PostgreSQL, Redis) and the Virtool workloads and services.
You can bring all resources down with tilt down and bring them back up with tilt up.
We find it is necessary to run tilt down before minikube stop for the cluster to
stop cleanly.
Use the tilt up -- --to-edit <resource> command to live edit a resource.
This substitutes the image with one built from a local Dockerfile.
For it to work, you must have the repository cloned as a sibling directory to the dev
repository. Your parent directory should look like this and include clones of any
repositories you want to live edit:
├── dev
├── virtool
├── virtool-ui
├── workflow-create-sample
├── workflow-iimi
└── workflow-pathoscope
Some repositories are not shown in this example.
virtool/virtool
tilt up -- --to-edit backendFor virtool/virtool resources, you have to manually update the resources in Tilt to
trigger an image build.
Resources affected by the image and --to-edit backend flag:
api-jobsapi-webmigrationtask-runner
virtool/virtool-ui
tilt up -- --to-edit uiChanges to code in the virtool/virtool-ui repository will be immediately reflected
in the running UI.
Only the ui resource is affected by the --to-edit ui flag.
Workflows
Any workflow repository can be live edited with the following command:
tilt up -- --to-edit <workflow>Where workflow is one of:
build-indexcreate-samplecreate-subtractioniimipathoscopenuvs
Every time the repository changes, the image will be rebuilt.
## Update images
We provide an easy way to update the Virtool container images in the cluster.
### Tilt
Click the 'Pull' button in the top-right of the navigation bar in the Tilt UI.
### Bash
```shell
bash scripts/pull.shIf you need to start fresh, you can just run init.sh again:
bash scripts/init.sh