Stop hardcoding credentials in ML pipelines - use environment variables instead

Опубликовано: 13 Декабрь 2022
на канале: Gus Cavanaugh
1,782
25

I always knew hard coding credentials in my code was a terrible idea, but I was lazy and did it anyway.

In addition to being a great way to inadvertently check sensitive information into a public git repository, it also makes deploying your code much harder. Someone has to edit my janky code to provide credentials for staging and prod environments that I don't have access to.

There are lots of ways to handle credentials - many tools have their own secrets management layer - but a simple way to get started is to use environment variables.

They are simple to setup, easy to access from Python, and lots of other tools (like the CI system you should be using) know how to read them:

In this video I show:
bad example -- hardcoded database credentials
better example -- environment variables

At Continual, we're helping ML teams apply good software engineering practices. They don't all manage credentials with environment variables, but none of them hardcode credentials like I used to do. You don't have to use env variables either, but please don't write your credentials in source code. Stay safe out there, and please test & deploy your code.


Смотрите видео Stop hardcoding credentials in ML pipelines - use environment variables instead онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Gus Cavanaugh 13 Декабрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,782 раз и оно понравилось 25 людям.