download-lb-cert: Downloads cert and key files provided by the load balancer. It atomically makes them available at /ie/workdir/ssl. setup-replica/replica_setup.rb: Creates these systemd units: - inference-engine.service: Runs an inference engine, e.g. vllm. - inference-gateway.service: Runs our inference gateway. It receives requests through the load balancer and forwards them to the inference engine. It performs TLS termination, checks API keys, ... - lb-cert-download.service: Downloads the cert and key files from the load balancer and then exits. - lb-cert-download.timer: Triggers lb-cert-download.service.
32 lines
861 B
Ruby
Executable File
32 lines
861 B
Ruby
Executable File
#!/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require_relative "../../common/lib/util"
|
|
require_relative "../lib/replica_setup"
|
|
|
|
replica_setup = ReplicaSetup.new
|
|
params = JSON.parse($stdin.read)
|
|
|
|
begin
|
|
inference_engine = params.fetch("inference_engine")
|
|
inference_engine_params = params.fetch("inference_engine_params")
|
|
model = params.fetch("model")
|
|
replica_ubid = params.fetch("replica_ubid")
|
|
ssl_crt_path = params.fetch("ssl_crt_path")
|
|
ssl_key_path = params.fetch("ssl_key_path")
|
|
gateway_port = params.fetch("gateway_port")
|
|
rescue KeyError => e
|
|
puts "Needed #{e.key} in parameters"
|
|
exit 1
|
|
end
|
|
|
|
replica_setup.prep(
|
|
inference_engine: inference_engine,
|
|
inference_engine_params: inference_engine_params,
|
|
model: model,
|
|
replica_ubid: replica_ubid,
|
|
ssl_crt_path: ssl_crt_path,
|
|
ssl_key_path: ssl_key_path,
|
|
gateway_port: gateway_port
|
|
)
|