Docker image for Rubix ML Server
1.1K
Based on php:8.0-cli image.
Dockerfile linksImage tags follow PHP versions:
latest 8.0 (8.0/Dockerfile)The image uses the following versions of the Rubix ML components (the versions are fixed when image is built):
Tensor extension is included into the image to boost the performance (thanks to the awesome installer by Michele Locati).
You can configure the server by customizing environment variables.
| Environment variable | Default | Description |
|---|---|---|
HOST | 127.0.0.1 | The host address to bind the server to. Use 0.0.0.0 to bind to all interfaces. |
PORT | 8000 | The network port to run the HTTP services on. |
CERT_FILEPATH | The path to the certificate used to authenticate and encrypt the HTTP channel (you will need to copy the certificate in your Dockerfile). | |
MAX_CONCURRENT_REQUESTS | 10 | The maximum number of requests that can be handled concurrently. |
SSE_RECONNECT_BUFFER | 50 | The maximum number of events to store in the server-sent events (SSE) reconnect buffer. |
The image supports previously trained estimators only. By default, it expects a persistent model to be copied as data.model.
You can customize the file path by overriding MODEL_FILEPATH env var.
AccessLog is enabled by default and logs are written to the access.log file.
You can change the access log file path by overriding ACCESS_LOG_FILEPATH env var. Add the following line to you Dockerfile
if you want to disable the access log middleware:
ENV ACCESS_LOG_FILEPATH=
Use the following env variables to enable BasicAuthenticator middleware (only one username is supported):
| Environment variable | Default | Description |
|---|---|---|
BASIC_AUTHENTICATOR_USERNAME | Authenticator's username. | |
BASIC_AUTHENTICATOR_PASSWORD | Authenticator's password. | |
BASIC_AUTHENTICATOR_REALM | auth | The unique name given to the scope of permissions required for this server. |
Note: you need to define both username and password to enable the middleware.
Use the following env variables to enable SharedTokenAuthenticator middleware:
| Environment variable | Default | Description |
|---|---|---|
SHARED_TOKEN_AUTHENTICATOR_TOKENS | Comma separated list of secret keys (bearer tokens) used to authorize requests. | |
SHARED_TOKEN_AUTHENTICATOR_REALM | auth | The unique name given to the scope of permissions required for this server. |
Example of tokens definition:
ENV SHARED_TOKEN_AUTHENTICATOR_TOKENS=secret,another-secret
Use the following env variable to enable TrustedClients middleware:
| Environment variable | Default | Description |
|---|---|---|
TRUSTED_CLIENTS_IPS | Comma separated list of trusted client ip addresses. |
Example:
ENV TRUSTED_CLIENTS_IPS=127.0.0.1,192.168.4.1,45.63.67.15
Verbose logging is enabled by default and logs are written to the verbose.log file.
Use VERBOSE_LOG_FILEPATH env var to change the log file path or disable it (similarly to the access log).
The minimal version of the Dockerfile to run the server would be:
FROM torchello/rubix-ml-server-docker:latest
COPY my-trained-model.model data.model
The simplest customized version for Gitlab Auto DevOps would look like:
FROM torchello/rubix-ml-server-docker:latest
ENV HOST=0.0.0.0
ENV PORT=5000
COPY my-trained-model.model data.model
When using the server behind the NGINX Ingress Controller with BasicAuthenticator enabled you need to
configure External Basic Authentication as described here
(point nginx.ingress.kubernetes.io/auth-url to your server's web UI).
Feel free to provide feedback or ask questions in the RubixML Telegram channel.
Content type
Image
Digest
Size
187.9 MB
Last updated
about 5 years ago
docker pull torchello/rubix-ml-server-docker