dask / dask/dask-cloudprovider
Broken cloud init if ENV contains double quote
- Dominant language
- Python
- Stars
- 147
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the issue**:
Scheduler will be shutdown by guest OS if any ENVs contain `"`
**Minimal Complete Verifiable Example**:
```python
GCPCluster(
env_vars={"ANY_VAR": '"'}
)
```
The cloud init will contains:
```
...
# Run container:
- 'docker run ... -e GCP_ANY_VAR=""" ...'
...
```
while it should escape `"` propely:
```
...
# Run container:
- 'docker run ... -e GCP_ANY_VAR="\"" ...'
...
```
To fix the problem we have to:
1. Properly refactor the command rendering in cloud-init:
https://github.com/dask/dask-cloudprovider/blob/736842d87779d398273da4aa85681cf072842eb0/dask_cloudprovider/generic/cloud-init.yaml.j2#L59
2. There should be proper error logging to show that cloud init does not pass
**Environment**:
- Dask version: 2024.12.1
- Python version: 3.11
- Operating System: WSL
- Install method (conda, pip, source): poetry
Contributor guide
Assessment
This issue has not been assessed yet.