Repository: bentoml/BentoML

Issue:
bug: docker env option does not support `,`
### Describe the bug

Setting environment variables with non word or `-` characters results in an error, this prohibits a large range of valid environment variables to be set without a custom build.

```
docker:
	env:
		- NVIDIA_DRIVER_CAPABILITIES=compute,utility
```

results in 

```
poetry run bentoml build ml-serving-experiments-bento:latest
  + Exception Group Traceback (most recent call last):
  |   File "projects/my-project/.venv/bin/bentoml", line 8, in <module>
  |     sys.exit(cli())
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
  |     return self.main(*args, **kwargs)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
  |     rv = self.invoke(ctx)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
  |     return ctx.invoke(self.callback, **ctx.params)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
  |     return __callback(*args, **kwargs)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml_cli/utils.py", line 254, in wrapper
  |     return func(*args, **kwargs)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml_cli/utils.py", line 225, in wrapper
  |     return_value = func(*args, **kwargs)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml_cli/utils.py", line 182, in wrapper
  |     return func(*args, **kwargs)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml_cli/bentos.py", line 276, in build
  |     build_bentofile(bentofile, build_ctx=build_ctx, version=version)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/simple_di/__init__.py", line 139, in _
  |     return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml/bentos.py", line 389, in build_bentofile
  |     build_config = BentoBuildConfig.from_yaml(f)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml/_internal/bento/build_config.py", line 779, in from_yaml
  |     return bentoml_cattr.structure(yaml_content, cls)
  |   File "projects/my-project/.venv/lib/python3.9/site-packages/cattrs/converters.py", line 309, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure bentoml._internal.bento.build_config.BentoBuildConfig>", line 54, in structure_BentoBuildConfig
  |     if errors: raise __c_cve('While structuring ' + 'BentoBuildConfig', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring BentoBuildConfig (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure bentoml._internal.bento.build_config.DockerOptions-2>", line 57, in structure_DockerOptions
    |     return __cl(
    |   File "<attrs generated init bentoml._internal.bento.build_config.DockerOptions>", line 5, in __init__
    |     _setattr(self, 'env', __attr_converter_env(env))
    |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml/_internal/bento/build_config.py", line 116, in _convert_env
    |     raise BentoMLException(
    | bentoml.exceptions.BentoMLException: All value in `env` list must follow format ENV=VALUE
    |
    | During handling of the above exception, another exception occurred:
    |
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure bentoml._internal.bento.build_config.BentoBuildConfig>", line 35, in structure_BentoBuildConfig
    |     res['docker'] = __c_structure_docker(o['docker'], __c_type_docker)
    |   File "<cattrs generated structure bentoml._internal.bento.build_config.DockerOptions-2>", line 60, in structure_DockerOptions
    |     except Exception as exc: raise __c_cve('While structuring ' + 'DockerOptions', [exc], __cl)
    | cattrs.errors.ClassValidationError: While structuring DockerOptions (1 sub-exception)
    | Structuring class BentoBuildConfig @ attribute docker
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "<cattrs generated structure bentoml._internal.bento.build_config.DockerOptions-2>", line 57, in structure_DockerOptions
      |     return __cl(
      |   File "<attrs generated init bentoml._internal.bento.build_config.DockerOptions>", line 5, in __init__
      |     _setattr(self, 'env', __attr_converter_env(env))
      |   File "projects/my-project/.venv/lib/python3.9/site-packages/bentoml/_internal/bento/build_config.py", line 116, in _convert_env
      |     raise BentoMLException(
      | bentoml.exceptions.BentoMLException: All value in `env` list must follow format ENV=VALUE
```

### To reproduce

Add


```
docker:
	env:
		- NVIDIA_DRIVER_CAPABILITIES=compute,utility
```

to bentofile.yaml

### Expected behavior

NVIDIA_DRIVER_CAPABILITIES=compute,utility

is a valid `env` value

### Environment

bentoml: 1.0.10
python: 3.9.14
os: MacOS 12.6


Discussion:

Resolving patch:
diff --git a/src/bentoml/_internal/bento/build_config.py b/src/bentoml/_internal/bento/build_config.py
--- a/src/bentoml/_internal/bento/build_config.py
+++ b/src/bentoml/_internal/bento/build_config.py
@@ -111,7 +111,7 @@ def _convert_env(
     if isinstance(env, list):
         env_dict: dict[str, str | None] = {}
         for envvar in env:
-            match = re.match(r"^(\w+)=([\w-]+)$", envvar)
+            match = re.match(r"^(\w+)=([\w\-,]+)$", envvar)
             if not match:
                 raise BentoMLException(
                     "All value in `env` list must follow format ENV=VALUE"


Test patch: