Enable multi-worker in MLflow container (#8)
Browse files- .github/workflows/ci-cd.yaml +1 -1
- README.md +2 -12
.github/workflows/ci-cd.yaml
CHANGED
@@ -77,7 +77,7 @@ jobs:
|
|
77 |
-p 8080:8080 \
|
78 |
-v $ML_MODEL_PATH:/opt/ml/model \
|
79 |
-e PYTHONPATH="/opt/ml/model:$PYTHONPATH" \
|
80 |
-
-e GUNICORN_CMD_ARGS="--timeout 60 -k gevent
|
81 |
"entity-extraction" &
|
82 |
working-directory: mlflow
|
83 |
- name: Wait until container is up
|
|
|
77 |
-p 8080:8080 \
|
78 |
-v $ML_MODEL_PATH:/opt/ml/model \
|
79 |
-e PYTHONPATH="/opt/ml/model:$PYTHONPATH" \
|
80 |
+
-e GUNICORN_CMD_ARGS="--timeout 60 -k gevent" \
|
81 |
"entity-extraction" &
|
82 |
working-directory: mlflow
|
83 |
- name: Wait until container is up
|
README.md
CHANGED
@@ -69,7 +69,7 @@ docker run --rm \
|
|
69 |
-p 8080:8080 \
|
70 |
-v $ML_MODEL_PATH:/opt/ml/model \
|
71 |
-e PYTHONPATH="/opt/ml/model:$PYTHONPATH" \
|
72 |
-
-e GUNICORN_CMD_ARGS="--timeout 60 -k gevent
|
73 |
"entity-extraction"
|
74 |
```
|
75 |
|
@@ -78,17 +78,7 @@ docker run --rm \
|
|
78 |
> error is seen, refer to
|
79 |
> https://forums.docker.com/t/docker-errors-dockerexception-error-while-fetching-server-api-version-connection-aborted-filenotfounderror-2-no-such-file-or-directory-error-in-python/135637/5
|
80 |
|
81 |
-
The container runs Gunicorn server inside to serve incoming requests
|
82 |
-
|
83 |
-
> [!WARNING]
|
84 |
-
> The number of gunicorn worker process MUST be **1** (`--workers=1`) to prevent multiple workers from downloading a
|
85 |
-
> HanLP pre-trained model to the same location, which results in runtime error in Docker container. In **native**
|
86 |
-
> environment, this error can be
|
87 |
-
>
|
88 |
-
> ```console
|
89 |
-
> OSError: [Errno 39] Directory not empty: '/root/.hanlp/mtl/close_tok_pos_ner_srl_dep_sdp_con_electra_small_20210304_135840'
|
90 |
-
> -> '/root/.hanlp/mtl/close_tok_pos_ner_srl_dep_sdp_con_electra_small_20210111_124159'
|
91 |
-
> ```
|
92 |
|
93 |
Example query:
|
94 |
|
|
|
69 |
-p 8080:8080 \
|
70 |
-v $ML_MODEL_PATH:/opt/ml/model \
|
71 |
-e PYTHONPATH="/opt/ml/model:$PYTHONPATH" \
|
72 |
+
-e GUNICORN_CMD_ARGS="--timeout 60 -k gevent" \
|
73 |
"entity-extraction"
|
74 |
```
|
75 |
|
|
|
78 |
> error is seen, refer to
|
79 |
> https://forums.docker.com/t/docker-errors-dockerexception-error-while-fetching-server-api-version-connection-aborted-filenotfounderror-2-no-such-file-or-directory-error-in-python/135637/5
|
80 |
|
81 |
+
The container runs Gunicorn server inside to serve incoming requests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
Example query:
|
84 |
|