cog icon indicating copy to clipboard operation
cog copied to clipboard

How do you set environment variables?

Open themire opened this issue 1 year ago • 4 comments

There is a page listing out all the environment variables but no reference in the docs about cog.yaml about where and how these should be included.

I've tried to figure it out from old PRs but couldn't find anything conclusive.

themire avatar Apr 19 '24 10:04 themire

Thanks for reporting. Cog's support for env/secrets at build time and run time is not yet well documented.

Can you share a bit more detail about what you're trying to accomplish?

If you want to set environment variables when running a model (not building), you can pass the -e flag to cog predict or cog run. See https://github.com/replicate/cog/pull/1253

If you want to inject secrets into your built image, see https://github.com/replicate/cog/blob/main/docs/private-package-registry.md

zeke avatar Apr 19 '24 16:04 zeke

Thanks. I am trying to trying to set the WEBHOOK_AUTH_TOKEN as documented here.

themire avatar Apr 20 '24 06:04 themire

I see. Are you running Cog on your own infrastructure and wanting to be able to send webhooks?

zeke avatar Apr 23 '24 16:04 zeke

Yes I am. The webhooks are all working fine. I just would like to be able to set this WEBHOOK_AUTH_TOKEN for extra security at my webhook endpoint.

themire avatar Apr 25 '24 09:04 themire