Redis Data Connectors
proxiML now supports Redis data connectors, letting your jobs read and write your own Redis server without exposing its credentials or address to job code. Configure the connection once at the region level, attach it to a job, and your code connects to a local proxiML hostname while proxiML authenticates to your server.
How It Works
PostgreSQL data connectors shipped on Wednesday, and today we are following up with Redis. As with all data connectors, the connector is a region-scoped CloudBender resource that records where your Redis server lives and how to authenticate to it. proxiML:
- Stores the connection's credentials, encrypted at rest, and never returns them through the proxiML API.
- When a job using the connector starts, runs a private connection proxy between the job and your server and injects the configured authentication.
- Gives the job a local hostname,
CONNECTOR_ID.proximl.internal, instead of your server's real address. The job's network egress is fenced to the connector, so it can only reach Redis through it.
Your job code contains no credentials and no knowledge of your server's network location.
Supported Authentication
A Redis connector supports two auth methods:
Username and Password -- The connector authenticates to your server using Redis ACL (AUTH <user> <password>). If you leave the username blank, it authenticates to the default user using the bare requirepass password instead, which covers pre-ACL deployments.
Certificate -- The connector presents a client certificate over a mutual TLS (mTLS) connection.
Both methods support an optional CA Certificate and a Use TLS toggle (on by default). When TLS is enabled, the connector encrypts the connection to your server and verifies its certificate against the CA certificate you provide, or against the system certificate store when you leave it blank. Certificate auth always requires TLS, so the toggle is locked on for it.
We have one more connector type in the works -- HTTP, announced on Monday -- which adds API key and OAuth authentication for HTTP APIs.
Using the Web Platform
Select View Region from the action menu of the region your Redis server is reachable from, then click the Add button on the Data Connectors toolbar.
- Name -- A unique name for the connector (lowercase letters, digits, and hyphens).
- Type --
Redis. - Host -- The hostname or IP address of your Redis server.
- Port -- The port your server listens on. Defaults to
6379. - Use TLS -- Encrypt the connection to your server. On by default and locked on for Certificate auth.
- CA Certificate -- Optional PEM-encoded CA certificate. Shown when TLS is enabled. Pins the CA to verify your server's certificate against; when left blank the system certificate store is used.
- Database -- Optional. The Redis logical database index your jobs should use, such as
0. - Auth Method --
Username and Password(prompts for a username and password) orCertificate(prompts for your client certificate and client private key in PEM format).
The connector is saved when you click Submit. When editing an existing connector, leave a secret field blank to keep its current value, or enter a new value to rotate it. The connector type and auth method cannot be changed after creation.
Using the SDK
Create an ACL-authenticated connector:
connector = await proximl.cloudbender.data_connectors.create(
provider_uuid="PROVIDER_ID",
region_uuid="REGION_ID",
name="redis-cache",
type="redis",
host="redis.internal.example.com",
port=6379,
database="0",
auth_type="password",
username="appuser",
password="PASSWORD",
)
For a legacy single-password deployment, omit the username:
connector = await proximl.cloudbender.data_connectors.create(
provider_uuid="PROVIDER_ID",
region_uuid="REGION_ID",
name="redis-legacy",
type="redis",
host="redis.internal.example.com",
port=6379,
database="0",
auth_type="password",
password="REQUIREPASS_VALUE",
)
Or one that authenticates with a client certificate:
connector = await proximl.cloudbender.data_connectors.create(
provider_uuid="PROVIDER_ID",
region_uuid="REGION_ID",
name="redis-mtls",
type="redis",
host="redis.internal.example.com",
port=6380,
database="0",
auth_type="certificate",
ca_certificate=open("ca.crt").read(),
client_certificate=open("client.crt").read(),
client_private_key=open("client.key").read(),
)
Then enable the connector for your project (from the Data Connectors section of the project page) and attach it to a job by its ID:
job = await proximl.jobs.create(
name="redis-job",
type="training",
gpu_type="rtx3090",
gpu_count=1,
data=dict(connectors=[connector.id]),
)
Inside the job, connect to the connector's local hostname with no credentials:
import redis
r = redis.Redis(
host="redis-cache-0123456789abcdef.proximl.internal",
port=6379,
db=0,
)
r.set("key", "value")
assert r.get("key") == b"value"
Use the connector's actual ID (shown in the Data Connectors grid, returned by create, or listed with data_connectors.list) in place of the placeholder above. The connector performs the real authentication to your server, and the logical database is the one configured on the connector.
Using the CLI
# List connectors in a region (ID, NAME, TYPE, HOST, AUTH_TYPE, PROTOCOL)
trainml cloudbender data_connector list --provider PROVIDER_ID --region REGION_ID
# Create an ACL-authenticated connector (TLS on by default)
trainml cloudbender data_connector create redis-cache \
--provider PROVIDER_ID --region REGION_ID \
--type redis --host redis.internal.example.com --port 6379 --database 0 \
--auth-type password --username appuser --password "PASSWORD"
# Plaintext upstream: disable TLS with --no-tls
trainml cloudbender data_connector create redis-plaintext \
--provider PROVIDER_ID --region REGION_ID \
--type redis --host redis.internal.example.com --port 6379 \
--no-tls --auth-type password --username appuser --password "PASSWORD"
# Create a certificate-authenticated connector
trainml cloudbender data_connector create redis-mtls \
--provider PROVIDER_ID --region REGION_ID \
--type redis --host redis.internal.example.com --port 6380 --database 0 \
--auth-type certificate \
--ca-certificate-file ca.crt \
--client-certificate-file client.crt \
--client-private-key-file client.key
# Rotate a password without re-entering the other settings
trainml cloudbender data_connector edit redis-cache \
--provider PROVIDER_ID --region REGION_ID \
--password "NEW_PASSWORD"
# Remove a connector
trainml cloudbender data_connector remove redis-cache \
--provider PROVIDER_ID --region REGION_ID
Security Notes
- Credentials are encrypted at rest with the same passphrase scheme proxiML uses for other secrets, and secret fields are never returned by the proxiML API.
- The job's network egress is restricted to its connectors, so a job can only talk to your Redis server through the authenticated connector.
- With TLS enabled (the default), the connection to your server is encrypted and its certificate is verified -- against the CA certificate you provide, or the system certificate store when you leave it blank.
See the CloudBender reference for the full data connector field reference, and look for the HTTP connector announcement on Monday.