Shubham Jha
11/07/2024, 3:17 PMcredentials.yml
mlflow:
tracking_uri: ${oc.env:MLFLOW_TRACKING_URI}
username: ${oc.env:MLFLOW_TRACKING_USERNAME}
password: ${oc.env:MLFLOW_TRACKING_PASSWORD}
ERROR:
Exception: MLflow tracking URI not found in credentials.
This works perfectly fine when testing in local env with manually passing the credentials to envars
, something like
export MLFLOW_TRACKING_USERNAME=username
.
more info on kedro way Hall
11/07/2024, 3:17 PMLaurens Vijnck
11/07/2024, 3:42 PMShubham Jha
11/07/2024, 3:45 PMLaurens Vijnck
11/07/2024, 3:48 PMLaurens Vijnck
11/07/2024, 3:48 PMShubham Jha
11/07/2024, 3:54 PMcontainer_definitions = jsonencode([
{
name = local.image_name,
image = "${aws_ecr_repository.main.repository_url}:${var.artifactory_source_tag}",
cpu = var.cpu
memory = var.memory
essential = true
environment = [
{ name : "MLFLOW_TRACKING_URI", value : "<https://www.genericdomain.com>" }
]
secrets = [
{
name = "MLFLOW_TRACKING_USERNAME",
valueFrom = data.aws_ssm_parameter.mlflow_tracking_server_username.arn
},
{
name = "MLFLOW_TRACKING_PASSWORD",
valueFrom = data.aws_ssm_parameter.mlflow_tracking_server_password.arn
}
]
Laurens Vijnck
11/07/2024, 4:01 PMLaurens Vijnck
11/07/2024, 4:02 PMShubham Jha
11/07/2024, 4:12 PMShubham Jha
11/07/2024, 4:21 PMimport omegaconf
from omegaconf import OmegaConf
st.write(omegaconf.__version__)
# Set a test environment variable
os.environ["TEST_VARIABLE"] = "test_value"
cfg = OmegaConf.create({"value": "${oc.env:TEST_VARIABLE}"})
# Try to access
try:
st.write(f"Resolved value: {cfg.value}")
except Exception as e:
st.write(f"Error: {e}")
I got the desired output confirming these are working properly:
2.3.0
Resolved value: test_value
Shubham Jha
11/07/2024, 6:15 PM2.3.0
Resolved value: test_value
prod env:
2.3.0
Error: Unsupported interpolation type oc.env full_key: value object_type=dict
The test variable defined and called in the script is not being recognized in the prod environment while the directory structure, settings.py, etc are all configured in same manner.
Any idea what do I need to change @Laurens Vijnck?
Thanks for your help so far