I am trying to train my model using Bring your own container technique in sagemaker. My model training runs correctly without any issues locally. But my docker image takes env-file as an input that could change at different runs. But in sagemaker when passing the ECR image, I don't know how to pass this env-file. So instead, inside the train
script, which is called by the sagemaker, I added export KEY=value
statements to create my variables. Even that did not expose my variables. Another way I tried it was by executing RUN source file.env
while building my image. Even this approach did not work out as I got an error /bin/sh: 1: source: not found
.
I could try ENV
while building my image and that would probably work but this approach won't be flexible as my variables could change at different runs. Is there any way to pass docker run arguments from a sagemaker estimator or notebook? I checked out the documentation but I couldn't find anything.