still struggling with pulling private packages fro...
# ask-metaflow
g
still struggling with pulling private packages from GCP Artifact registry. I referenced this thread and subsequent PR. still not able to get the package installed
Copy code
metaflow                              2.12.5
metaflow-netflixext                   1.2.0
error seems to be coming from here where auth_info is None even though GOOGLE_APPLICATION_CREDENTIALS is exported, and if I run the install command outside of metaflow (
/opt/homebrew/Caskroom/miniforge/base/envs/metaflow_builder_b36bf7c45bc90818c9925cc3dc77260c9a092f99_16de40ce0d9565e40a87d19d3ea4fc202f48a3d8/lib/python3.10/site-packages/pip install my-package --extra-index-url <http://us-python.dev/|us-python.dev/>...
) it works error is >
Copy code
Error downloading package for 'my-package-py3-none-any': 401 Client Error: Unauthorized for url: <https://us-python.pkg.dev/my-package-py3-none-any.whl>
    Conda ran into an error while setting up environment.:
    Could not fetch packages -- see pretty-printed errors above.
👀 1
flow:
Copy code
from metaflow import FlowSpec, step, pypi, pypi_base, kubernetes, environment

@pypi_base(
    python='3.10',
    extra_indices=[f"<https://us-python.pkg.dev/.../simple>"],
    packages={
        'keyrings.google-artifactregistry-auth': '>=1.1.1' ,
        'my-private-package': '3.4.1',
    }
)
class PrivateLibFlow(FlowSpec):
    @environment(vars={"METAFLOW_DEBUG_CONDA": "1"})
    @step
    def start(self):
        import pkg_resources
        installed_packages = pkg_resources.working_set
        installed_packages_list = sorted(["%s==%s" % (i.key, i.version) for i in installed_packages])
        print(installed_packages_list)
        from my_private_package import Something
        self.next(self.next_step)

    @pypi(
        packages={
            "gcsfs": "2024.6.0"
        }
    )
    @step
    def next_step(self):
        print("next_step")
        self.next(self.end)

    @step
    def end(self):
        print("yay!")

if __name__ == '__main__':
    PrivateLibFlow()
command:
Copy code
GOOGLE_APPLICATION_CREDENTIALS=/Users/maja/.config/gcloud/application_default_credentials.json  METAFLOW_DEBUG_CONDA=1 python3 workflows/minimal.py  --datastore=gs --environment=conda run
d
hey — whenever you get a chance, could you send me the full debug log and I can try to figure this out.
thankyou 1
q
Was this solved? I am very interested in how to get this to work as well!
d
I don’t think I heard back. I think ther eis a PR but I can’t test it. If you have a setup that would allow you to try this, I can resurect it and you can try it out and let me know.
✅ 1