.. _client-envs: Client Environment Variables ============================= The Scaleout Edge Python client can be configured through environment variables. These are defined in ``scaleout-util`` and apply when running a client via the :ref:`scaleout-cli` or the Python SDK. Variables that turn something on or off accept ``true``, ``false``, ``1``, ``0``, ``yes``, ``no``, ``on`` and ``off``, in any case. An empty variable gives the default. For any other value, the client logs a warning and uses the default. .. list-table:: :header-rows: 1 :widths: 40 15 45 * - Variable - Default - Description * - ``SCALEOUT_ARCHIVE_DIR`` - ``.scaleout/package_archive`` - Directory where the client stores downloaded compute package archives. * - ``SCALEOUT_AUTH_SCHEME`` - ``Bearer`` - HTTP authentication scheme used in the ``Authorization`` header when calling the API. * - ``SCALEOUT_CONNECT_API_SECURE`` - ``true`` - Deprecated: trust the deployment's certificate with ``SCALEOUT_TLS_CA_PATH`` instead (see :ref:`client-tls-trust`). Set to ``false`` to turn certificate verification off for REST API requests. * - ``SCALEOUT_GRPC_SECURE`` - *(unset)* - Deprecated: leave it unset, or set ``SCALEOUT_TLS_MODE=required`` to always use TLS. Whether the edge client uses TLS for its gRPC connection to the combiner (``true``/``false``). * - ``SCALEOUT_GRPC_ROOT_CERT_PATH`` - *(unset)* - Deprecated: set ``SCALEOUT_TLS_CA_PATH`` to the same file instead. Path to a CA certificate (PEM) trusted for the gRPC connection to the combiner only. * - ``SCALEOUT_TLS_CA_PATH`` - *(unset)* - Path to the CA certificate (PEM) that signed the deployment's certificate. For a self-signed certificate, the certificate itself. Used for every connection to the deployment. When unset, the system's CA certificates are used. ``scaleout get-ca`` can save the file (see :ref:`client-tls-trust`). Same as ``scaleout --tls-ca``. * - ``SCALEOUT_TLS_MODE`` - ``auto`` - Whether the client may connect without TLS. ``auto``, the default, uses TLS when the deployment does. ``required`` uses TLS for every connection and refuses an ``http://`` deployment URL. Same as ``scaleout --tls-mode``. * - ``SCALEOUT_TLS_CERT_PATH`` - *(unset)* - Path to a client certificate (PEM), for a deployment that requires one. It is sent on every connection to the deployment. Set it together with ``SCALEOUT_TLS_KEY_PATH``. If the certificate has an extended key usage extension, it must include client authentication (``clientAuth``). Same as ``scaleout --tls-cert``. * - ``SCALEOUT_TLS_KEY_PATH`` - *(unset)* - Path to the unencrypted private key (PEM) of the client certificate. Same as ``scaleout --tls-key``. * - ``SCALEOUT_CUSTOM_URL_PREFIX`` - *(empty)* - URL prefix prepended to all API requests. Useful when the API is hosted under a sub-path. * - ``SCALEOUT_PACKAGE_EXTRACT_DIR`` - ``package`` - Directory where the client extracts the downloaded compute package. * - ``SCALEOUT_GRACEFUL_GRPC_HANDLING`` - ``true`` - Whether the client handles gRPC disconnections gracefully and attempts reconnection (``true``/``false``). * - ``SCALEOUT_CHECK_COMPATIBILITY`` - ``true`` - Whether the client checks version compatibility with the server on connect (``true``/``false``). * - ``SCALEOUT_CLIENT_STATUS_REPORTING`` - ``true`` - Whether the client sends status updates to the server during commands (``true``/``false``). * - ``SCALEOUT_CLIENT_SEND_TELEMETRY`` - ``true`` - Whether the client sends telemetry data, CPU and memory usage (``true``/``false``). * - ``SCALEOUT_CLIENT_TASK_POLLING_INTERVAL`` - ``5`` - Interval in seconds between task polling requests from the client to the server. Lower values may reduce task start latency but increase API load. * - ``SCALEOUT_VENV_DIR`` - ``.scaleout/venvs`` - Directory where the client creates virtual environments from the compute package's ``python_env.yaml``. Usage example ------------- Set variables before starting the client: .. only:: html .. tabs:: .. code-tab:: bash :caption: Unix/MacOS export SCALEOUT_PACKAGE_EXTRACT_DIR=/tmp/package export SCALEOUT_CLIENT_TASK_POLLING_INTERVAL=10 scaleout client start --api-url --token .. code-tab:: powershell :caption: Windows (PowerShell) $env:SCALEOUT_PACKAGE_EXTRACT_DIR="/tmp/package" $env:SCALEOUT_CLIENT_TASK_POLLING_INTERVAL="10" scaleout client start --api-url --token .. code-tab:: bat :caption: Windows (CMD) set SCALEOUT_PACKAGE_EXTRACT_DIR=/tmp/package set SCALEOUT_CLIENT_TASK_POLLING_INTERVAL=10 scaleout client start --api-url --token .. only:: latex or rinoh **Unix/MacOS:** .. code-block:: bash export SCALEOUT_PACKAGE_EXTRACT_DIR=/tmp/package export SCALEOUT_CLIENT_TASK_POLLING_INTERVAL=10 scaleout client start --api-url --token **Windows (PowerShell):** .. code-block:: powershell $env:SCALEOUT_PACKAGE_EXTRACT_DIR="/tmp/package" $env:SCALEOUT_CLIENT_TASK_POLLING_INTERVAL="10" scaleout client start --api-url --token **Windows (CMD):** .. code-block:: bat set SCALEOUT_PACKAGE_EXTRACT_DIR=/tmp/package set SCALEOUT_CLIENT_TASK_POLLING_INTERVAL=10 scaleout client start --api-url --token .. _client-tls-trust: Trusting a self-signed or private-CA certificate ------------------------------------------------ The client always verifies the deployment's certificate, on every connection. To connect to a deployment with a self-signed certificate, or a certificate from a private CA, give the client the CA certificate to trust: - **Self-signed certificate:** the certificate is its own CA certificate. ``scaleout get-ca`` saves it. - **Private CA:** pass the CA's root certificate. ``scaleout get-ca`` saves it when the server sends it, or when the server's certificate names a URL to download it from. Otherwise, ask whoever runs the CA for it. The server's own certificate does not work in its place. .. code-block:: bash scaleout get-ca https:// ca.pem scaleout --tls-ca ca.pem client start --api-url https:// --token The ``--tls-*`` options belong to the top-level ``scaleout`` command and come before the subcommand. A command-line option overrides the matching environment variable. ``scaleout get-ca`` prints the CA certificate's SHA-256 fingerprint. Compare it with the one the deployment's operator gives before trusting the file. When verification fails, the client says why and shows these commands. .. note:: Boolean variables accept ``true`` or ``false`` (case-insensitive). .. seealso:: :ref:`scaleout-cli` for the full list of ``scaleout client`` commands. .. meta:: :description lang=en: Reference for all environment variables supported by the Scaleout Edge Python client. :keywords: environment variables, client configuration, Scaleout Edge, federated learning