Hi All, I'm having a problem running the NYCVizFlo...
# ask-metaflow
b
Hi All, I'm having a problem running the NYCVizFlow() example from the Outerbounds Sandbox, with the difference being I'm trying to run it on my own stack that I opened via CloudFormation now. I'm getting an insane amount of conda conflicts when I was able to install this environment fine locally. Not sure what the issue is. I'll attach the logs in this thread.
1
CONDA_CHANNEL=conda-forge python flow2.py --environment=conda --no-pylint run
log.txt
flow2.py
@victorious-lawyer-58417 I've seen your name pop up in some of the environment related stuff in previous posts.. perhaps you could lend a hand? :^)
v
sure! Try this:
Copy code
@conda_base(python='3.9.10', libraries={"datashader": "0.14.0", "pandas": "1.4.2", "pyarrow": "5.0.0"})
most likely you are getting conflicts since your Python version is different than the one in the sandbox. The above line should fix it
b
I'll give it a try! I also had an issue where using
@conda("test-env.yaml)
returned this:
Copy code
(base) honson@Aisan:~/metaflow$ CONDA_CHANNEL=conda-forge python flow2.py --environment=conda run
Traceback (most recent call last):
  File "/home/honson/metaflow/flow2.py", line 14, in <module>
    @conda("./test-env.yaml")
  File "/home/honson/.local/lib/python3.10/site-packages/metaflow/decorators.py", line 433, in _base_step_decorator
    raise BadStepDecoratorException(decotype.name, func)
  File "/home/honson/.local/lib/python3.10/site-packages/metaflow/decorators.py", line 33, in __init__
    deco=deco, func=func.__name__
AttributeError: 'str' object has no attribute '__name__'. Did you mean: '__ne__'?
Any ideas on this?
v
@conda
doesn't support
.yaml
definitions natively. You have to specify a
libraries=
attribute
b
oh? Does this mean the sandbox example is outdated?
What is the difference between
@conda_base
and
@conda
? is
@conda_base
applicable to the entire workflow? whereas
@conda
can be defined per step?
v
correct,
@conda_base
is applied to all steps of a flow. You can use it to define a base set of libraries that all steps need and then you can optionally add
@conda
if some steps need some extra libraries
what example refers to
@conda("test-env.yaml)
in the sandbox? 🤔
b
See screenshot of the sandbox!
For some context, I'm working on writing a guide to setup MetaFlow on AWS, but it's been a bit painful so far. I do have the UI up and running now and also the CloudFormation yaml up and running, just trying to get these examples to run on there now to "kick the tires"
v
the commented out line above
Copy code
@conda_base(libraries={"datashader": "0.14.0", "pandas": "1.4.2", "pyarrow": "5.0.0"})
class NYCVizFlow(FlowSpec):
is what you get out of the box. Could it be that
test-env
is related to your testing?
b
so, the "out of the box" sample had
conda_base
commented out in replacement for the yaml that was not something I added in there
v
great to hear that you are writing a guide! We are happy to get you over any hurdles
❤️ 1
note that it can be quite slow when you run it for the first time on your workstation (depending how fast your internet connection is) but it should be much faster in subsequent runs
b
loading...
v
note that if you are curious, you can install
mamba
as an alternative to Conda which helps make it a bit faster
b
Noted. Why does the conda environment take so long? You mentioned network speed. Is this yaml or dict not being send over through to the network to be setup "locally" on aws?
in other words, what's happening under the hood?
Looks like it works!
🙌 1
dancing 1
Thanks @victorious-lawyer-58417!
👍 1
v
there’s a lot going on behind the scenes in `@conda`: it resolves the whole dependency graph and caches all packages in your S3 bucket so all tasks are guaranteed to get the same stable environment This is why it takes a why initially. Subsequent runs use the cached environment so it’s faster