Sign inSign up

torchello/rubix-ml-server-docker

By torchello

•Updated about 5 years ago

Docker image for Rubix ML Server

Image
1

1.1K

torchello/rubix-ml-server-docker repository overview

⁠Docker image for Rubix ML Server

Based on php:8.0-cli image.

Image tags follow PHP versions:

⁠Rubix ML component versions

The image uses the following versions of the Rubix ML components (the versions are fixed when image is built):

ComponentVersion
Server⁠^1.0
Tensor⁠^3.0
ML⁠^1.2

⁠Tensor extension

Tensor extension is included into the image to boost the performance (thanks to the awesome installer⁠ by Michele Locati⁠).

⁠HTTP Server configuration

You can configure the server by customizing environment variables.

Environment variableDefaultDescription
HOST127.0.0.1The host address to bind the server to. Use 0.0.0.0 to bind to all interfaces.
PORT8000The network port to run the HTTP services on.
CERT_FILEPATHThe path to the certificate used to authenticate and encrypt the HTTP channel (you will need to copy the certificate in your Dockerfile).
MAX_CONCURRENT_REQUESTS10The maximum number of requests that can be handled concurrently.
SSE_RECONNECT_BUFFER50The maximum number of events to store in the server-sent events (SSE) reconnect buffer.
⁠Trained estimator

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.

⁠Server middleware

⁠Access log

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=
⁠Basic authenticator

Use the following env variables to enable BasicAuthenticator middleware⁠ (only one username is supported):

Environment variableDefaultDescription
BASIC_AUTHENTICATOR_USERNAMEAuthenticator's username.
BASIC_AUTHENTICATOR_PASSWORDAuthenticator's password.
BASIC_AUTHENTICATOR_REALMauthThe 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.

⁠Shared token authenticator

Use the following env variables to enable SharedTokenAuthenticator middleware⁠:

Environment variableDefaultDescription
SHARED_TOKEN_AUTHENTICATOR_TOKENSComma separated list of secret keys (bearer tokens) used to authorize requests.
SHARED_TOKEN_AUTHENTICATOR_REALMauthThe unique name given to the scope of permissions required for this server.

Example of tokens definition:

ENV SHARED_TOKEN_AUTHENTICATOR_TOKENS=secret,another-secret
⁠Trusted clients

Use the following env variable to enable TrustedClients middleware⁠:

Environment variableDefaultDescription
TRUSTED_CLIENTS_IPSComma 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

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).

⁠How to use?

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
⁠Gitlab Auto DevOps

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
⁠Ingress and basic authentication

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).

⁠Support

Feel free to provide feedback or ask questions in the RubixML Telegram channel⁠.

Tag summary

Content type

Image

Digest

Size

187.9 MB

Last updated

about 5 years ago

docker pull torchello/rubix-ml-server-docker