-
Notifications
You must be signed in to change notification settings - Fork 1
Develop locally
There are some easy ways to work locally. We assume that you have a local kubernetes (like minikube
) up and running and the newest version of the application is deployed. It is recommended to use some kubernetes helper like the VSCode kubernetes extension. Garden will deploy all services to a namespace called mpci_default
. So while monitoring the cluster, you will type kubectl ... -n mpci-default
a lot. To make your life easier you can add run kubectl config set-context --current --namespace=mpci-default
.
If you only want to do frontend development, just execute kubectl port-forward -n BACKENDPOD 5000:5000
. With this it will be like you have the backend running locally. Navigate to services/frontend-image/src
and execute yarn
if you need to update dependencies. To run the frontend in development mode locally, execute yarn start
.
Have fun developing locally! If you want to run tests or lint, execute yarn test
or yarn lint
.
- Run
kubectl port-forward -n ENV YOUR_POSTGRES_POD 5432:5432
- Set the
POSTGRES_USER
andPOSTGRES_PASSWORD
env variables to right values(usingexport
etc) cd services/python-images
pip install -r requirements.txt
python server.py
You now have your backend running locally. To start the frontend as well, follow the steps above.
There is no easy way to run the scheduler locally, since it needs to execute in cluster commands.
You can swap the deployment from your minikube cluster using Telepresence and by setting the env variable IN_CLUSTER
to false
.
The local execution environment images are not deployed by Garden, because they are not required directly by any deployment. Instead by default they are always pulled from DockerHub. Here, I will use the R environment images as an example but the same also applied for the python and cuda images.
First we need to enable the scheduled Job to use local images instead of always pulling. In executor-job.yaml we need to change spec.template.spec.containers.imagePullPolicy
to IfNotPresent
.
Now to point your terminal to use the docker daemon inside minikube run this (minikube must be started):
eval $(minikube docker-env)
Now any ‘docker’ command you run in this current terminal will run against the docker inside minikube cluster. Now you can ‘build’ against the docker inside minikube. which is instantly accessible to kubernetes cluster.
Make sure to run the following command from inside services/executionenvironments/r
.
docker build . -f r-executor.Dockerfile -t milanpro/mpci_execution_r:latest
. (If needed, change path to Dockerfile)
Different ways of adding a local Docker image to Minikube are shown here.
Right now we are not aware of any way to do this with Garden - in case there is one, please change accordingly.
- Home
- Setup
- API Documentation
- Data model
- How to...
- ...add a new remote database
- ...create migrations
- ...develop locally
- ...simplified dev setup
- ...deploy on kubernetes (internal)
- ...monitor the cluster
- ...fix expired K8s certificates
- ...add new dependencies
- ...rebuild base image
- ...add a new algorithm in R
- ...add support for new language
- ...add a new node to Kubernetes cluster
- Coding Conventions
- Roadmap
- Ownership