hundreds-policeman-70711
03/18/2025, 11:13 PM@pypi_base
decorator and the metaflow-netflixext package? When running this locally, I seem to be running into all sorts of issues getting this to work.hundreds-rainbow-67050
03/18/2025, 11:16 PMhundreds-policeman-70711
03/18/2025, 11:33 PM@pypi_base
decorator I would need to use the --environment=pypi
parameter based on Metaflow's docs, but that results in an error message:
Metaflow 2.15.4+netflix-ext(1.2.3) executing AnalyticsFlow for user:patricktravis
Incompatible environment:
The pypi_base decorator requires --environment=conda
When using the --environment=conda
parameter, there seems to be an issue grabbing my conda environment version. I raised an issue here, but I think it could potentially be a bug?
But pretty much I'm just running:
python analytics_flow.py --environment=conda run
dry-beach-38304
03/19/2025, 12:03 AMdry-beach-38304
03/19/2025, 12:04 AMdry-beach-38304
03/19/2025, 12:05 AMhundreds-policeman-70711
03/19/2025, 12:16 AM--environment=pypi
?
Metaflow 2.15.4+netflix-ext(1.2.3) executing AnalyticsFlow for user:patricktravis
Incompatible environment:
The pypi_base decorator requires --environment=conda
dry-beach-38304
03/19/2025, 1:43 AM--environment=conda
== `--environment=pypi`(and I really mean that 🙂 : https://github.com/Netflix/metaflow/blob/master/metaflow/plugins/pypi/pypi_environment.py#L4). I did not do that in the extension.hundreds-policeman-70711
03/19/2025, 4:01 AMBootstrapping Conda environment... (this could take a few minutes)
Resolving 1 environment ...
dry-beach-38304
03/19/2025, 6:44 AMdry-beach-38304
03/19/2025, 6:45 AMhundreds-policeman-70711
03/19/2025, 1:33 PMimport urllib
from google.auth import default
from google.auth.transport.requests import Request
def refresh_access_token() -> str:
credentials, _ = default()
credentials.refresh(Request())
return credentials.token
GCP_ARTIFACT_REGISTRY_ACCESS_TOKEN = refresh_access_token()
@pypi_base(
python="3.11",
extra_indices=[
urllib.parse.quote(
f"https://{GCP_ARTIFACT_REGISTRY_ACCESS_TOKEN}@my/artifact/registry/url",
safe=""
)
],
packages={"my_package": "0.2.5"}
)
hundreds-policeman-70711
03/19/2025, 1:33 PMhundreds-rainbow-67050
03/19/2025, 1:59 PMhundreds-policeman-70711
03/19/2025, 2:12 PMgcloud auth login
poetry config http-basic.my-source oauth2accesstoken $(gcloud auth print-access-token)
hundreds-rainbow-67050
03/19/2025, 2:17 PMhundreds-rainbow-67050
03/19/2025, 2:19 PMpip install xyz --extra-index-url=<your_generated_url>
hundreds-rainbow-67050
03/19/2025, 2:25 PMextra-index-url = <https://oauth2accesstoken>:$(gcloud auth print-access-token)@your-repository-url/simple/
hundreds-policeman-70711
03/19/2025, 4:21 PMdry-beach-38304
03/19/2025, 4:22 PMdry-beach-38304
03/19/2025, 4:22 PMdry-beach-38304
03/19/2025, 4:23 PMdry-beach-38304
03/19/2025, 4:23 PMhundreds-policeman-70711
03/19/2025, 4:29 PMhundreds-policeman-70711
03/19/2025, 4:31 PMhundreds-policeman-70711
03/19/2025, 4:42 PMfrom daily_aggregates.utils.utils import read_config
and I'm getting a ModuleNotFound error:
ModuleNotFoundError: No module named 'daily_aggregates'
I guess my question then becomes, is the flow package not automatically included in the @pypi_base
install?dry-beach-38304
03/19/2025, 4:53 PMhundreds-policeman-70711
03/19/2025, 4:58 PManalytics_flow.py
Structure:hundreds-policeman-70711
03/19/2025, 5:26 PMsrc
to the path in each step dynamically:
sys.path.insert(0, "src")
hundreds-policeman-70711
03/19/2025, 5:37 PMhundreds-policeman-70711
03/19/2025, 6:57 PM