Setup and Configurations
Requirements
To setup remote development, you need an existing Data deployment.
Preparing the development Docker image
The MicroExecutor will run a simple docker image with the build tools related to your language of choice. It will then have source files mounted into its filesystem through a volume, and will then run hot reload builds.
For now, only Node.js development is supported, so use the following Dockerfile:
FROM node:18-slim
WORKDIR /app
USER node
# run application in dev mode
# retry every 30s since repository might not yet be cloned
CMD ["/bin/sh", "-c", "while true; do npm install && npm run dev || true; echo 'Retrying in 30 seconds...'; sleep 30; done"]
Data Configurations
In the code snippet below, you will find the new configurations you need to add to your Data deployment.
info
Do not just copy/paste the entire configurations block, since the kokos:
and microexecutors:
fields probably already exist and YAML does not allow duplicate keys.
You need to substitute the following values:
<YOUR-PVC-NAME>
: a name for your pvc, such as "pvc-mex-sources"<YOUR-MEX-REPO>
: the url of your dev microexecutor image repository that you built in the previous step<YOUR-MEX-TAG>
: the tag for your dev microexecutor image that you built in the previous step
kokos:
microexecutors:
- name: me-node-gibus
image:
name: <YOUR-MEX-REPO>
tag: <YOUR-MEX-TAG>
internalPort: <YOUR-MEX-PORT>
livenessProbe:
exec:
command:
- touch
- /tmp/healthy
readinessProbe:
exec:
command:
- touch
- /tmp/healthy
createVolumeClaims:
- name: <YOUR-PVC-NAME>
storage: 5Gi
storageClassName: local-path
extraVolumes:
- name: mex-sources
persistentVolumeClaim:
claimName: <YOUR-PVC-NAME>
extraVolumeMounts:
- name: mex-sources
mountPath: /app
openvscode:
extraVolumes:
- name: mex-sources
persistentVolumeClaim:
claimName: <YOUR-PVC-NAME>
extraVolumeMounts:
- name: mex-sources
mountPath: /home/kokos/mex-development