https://prefect.io logo
Title
r

Ruslan

06/28/2021, 2:23 PM
Hi! Where can I find examples how to use private github wtorage in prefect? I can-t understand how to use secrets. Seems like it doesn’t pass. Public repos work, but private no
flow.storage = GitHub(secrets=["github"],
                      repo="corp/etl",
                      path="flows/flow.py")
and error:
Repo 'corp/etl' not found. Check that it exists (and is spelled correctly), and that you have configured the proper credentials for accessing it.
when I try to use param as in docs memtion i get error
TypeError: __init__() got an unexpected keyword argument 'access_token_secret'
k

Kevin Kho

06/28/2021, 2:39 PM
Hi @Ruslan, are you on Cloud or Server?
But it should be
flow.storage = GitHub(repo="my_org/repo_name",
                      path="prefect_flows/flows/flow.py",
                      ref="trunk",
                    access_token_secret="GITHUB_ACCESS_TOKEN",)
Where
GITHUB_ACCESS_TOKEN
is a secret that contains the access token
r

Ruslan

06/28/2021, 4:15 PM
As i mentioned your code style return this error while registering flow
TypeError: __init__() got an unexpected keyword argument 'access_token_secret'
You may try to use this code and get same error. No matter cloud or server you are, this code is not acceptable. does anybody have working code example?
k

Kevin Kho

06/28/2021, 4:19 PM
The example I have is from a working example. What Prefect version are you on?
r

Ruslan

06/28/2021, 4:20 PM
aahh let me try to upgrade
k

Kevin Kho

06/28/2021, 4:20 PM
The Secret name seems to have been added in 0.14.7
r

Ruslan

06/28/2021, 4:35 PM
that helped thank you Kevin! version was 0.14.5!
k

Kevin Kho

06/28/2021, 4:35 PM
Ah I see. Glad it’s working now 👍
r

Ruslan

06/28/2021, 4:49 PM
in what path prefect begin to work after downloading flow? I put folder “replicator” with my code in /root/.prefect , after that “from replicator import organizer” in flow, but get error
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named 'replicator'",)
k

Kevin Kho

06/28/2021, 4:50 PM
If you are using a LocalAgent, I believe it’s the path that you start it from. You and see this thread. They have an update on the end how they got it working
👀 1
r

Ruslan

06/28/2021, 5:23 PM
I believe it’s the path that you start it from.
exactly thank you Kevin!!
👍 1