mljar/runmercury-website

Feedback for “Secrets Management”

Closed this issue · 4 comments

Is it possible to use environment secrets in requirements.txt, e.g. to install a package from a private package repository?

--extra-index-url os.environ.get("PKGIDX_URL_KEY")
mypackage

Hi @somdipdatta,

I think there are two ways it can be done.

  1. You can install package in the notebook, just add code cell with pip command, something like below:
import sys
!{sys.executable} -m pip install git+https://{token}@gitprovider.com/user/project.git@{version}`
  1. We need to fix the order of package installation and secrets provision in the current code and then secrets will work in the requirements.txt. Current code:
    https://github.com/mljar/mercury/blob/909fb3fd1186fc4cefac086232183a2ebd80fc08/mercury/apps/nbworker/nb.py#L324-L325
    I think we can fix this today and update workers code, I will let you know.

@apjanusz could you please take a look at this issue?

Hi @somdipdatta,

We fixed the problem and updated workers so everything should work.
I tested it with private github repo using github token and everything worked. All you have to do is create a secret and include it in your requirements.txt as ${secret_name}. In moment i will update docs :)

Peace

@pplonski @apjanusz Thanks for your quick action. I just tried it out, works as described!

@somdipdatta no problem :) Here's a link to our docs: https://runmercury.com/docs/pip-install-requirements/
God bless you!