Command: secret
The flexai secret
command allows for the management of secrets using the FlexAI Cloud Services secret store. Secrets are encrypted at rest and are only made available to the training runtime as an environment variable.
Secrets can be passed on to a training job using the --secret
(-S
) flag:
flexai training run <training_job_name> -u <repository_url> -b <repository_revision> -D <dataset> \
--secret <environment_variable_name_of_secret>=<secret_name> \
<entry_point_training_script.py>
flexai training run test-training-123 -u https://github.com/flexaihq/nanoGPT/ -b flexai-main -D open_web \
--secret HF_TOKEN=hf-token-dev \
train.py
Visit the training run
reference page for more information on how to use secrets —and environment variables— in training jobs.
secret create
Creates and stores a new secret in the FlexAI Cloud Services secret store. Secrets' values are not displayed when running flexai training inspect
.
flexai secret create <secret_name>
Arguments
Argument | Description | Example |
---|---|---|
secret_name | Resource name. Must follow the FCS resource naming conventions | hf-token-dev |
Flags
Flag | Type | Optional / Required | Definition | Example |
---|---|---|---|---|
-p , --value-stdin | Flag | Optional | Takes the Secret's value directly from the Standard input (stdin) instead of the default interactive prompt | See below |
By default (when the -p
flag is not present), a secret's value is entered interactively through a masked prompt.
Example
Method: Interactive prompt (Default)
flexai secret create hf-token-dev
✔ Secret Value: █
Method: stdin input -p
--value-stdin
Setting a Secret's value from an Environment Variable:
echo $HF_TOKEN | flexai secret create -p secret-from-env-var
secret delete
Deletes an existing secret from the FlexAI Cloud Services secret store.
flexai secret delete <secret_name>
Example
flexai secret delete hf-token-dev
secret list
Lists all the secrets that have been created.
flexai secret list
Example
The list
command returns a table with the secret's name, creation, and last updated ages:
flexai secret list
NAME | CREATED (AGE) | UPDATED (AGE)
-------------------+---------------+----------------
hf-token-prod | 4d | 4d
wandb | 7h | 7h
secret update
Updates an existing secret's value in the FlexAI Cloud Services secret store using a masked prompt.
flexai secret update <secret_name>
Example
flexai secret update wandb
✔ Secret Value: █