Hey there! Happy New Year everyone! I have a ques...
# flyte-support
b
Hey there! Happy New Year everyone! I have a question about Flyte Decks. It's possible that we'd like to use this feature to display training/inference distributions and other plots related to our workflows, but I'm having trouble getting a simple example up and running. I followed this tutorial, for reference: https://docs.flyte.org/projects/cookbook/en/stable/auto/core/flyte_basics/deck.html Here's the relevant parts of my workflow:
Copy code
@task(disable_deck=False)
def display_distribution():
    from sklearn.datasets import load_iris
    import matplotlib.pyplot as plt
    import plotly.express as px

    li = load_iris()
    iris_df = pd.DataFrame(data=li['data'],columns=li['feature_names'])
    fig = px.histogram(iris_df['sepal length (cm)'])

    deck = flytekit.Deck("Petal Distribution", fig.to_html())
    deck.append(fig.to_html())
    flytekit.current_context().default_deck.append(fig.to_html())

    return

@workflow
@setup_wf(before=init_wf)
def demo_spark3_model_workflow():
    demo_model_obj = init_model_object()
    message = sub_workflow.simple_sub_wf(num_his=5)
    print_sub_wf_message(message=message)
    display_distribution()
In the
display_distribution
task, I'm loading the iris dataset, creating a plotly histogram, then sending the html of that figure to the Flyte default deck as well as a custom deck, as outlined in the tutorial. When I deploy and run this workflow, it completes the run with no errors but I'm not able to see a "Deck" button anywhere like in the tutorial (attached is a screenshot to show that). I'm wondering if this feature has been changed or deprecated? Any insight on this is much appreciated!
h
Hey @brief-leather-11096, this feature certainly has not be deprecated. In fact, as I understand, there are a few things we have discussed adding recently. Do you know what version of FlyteConsole you're running?
And other components - FlytePropeller / FlyteAdmin?
cc @glamorous-carpet-83516 any ideas?
g
Hmm, what’s version of Flytekit you’re running
b
@hallowed-mouse-14616 @glamorous-carpet-83516 Thanks for the replies.. checking on the versions
@hallowed-mouse-14616 @glamorous-carpet-83516 We have these lines in our dockerfile base image:
Copy code
RUN pip3 install flytekit>=0.30.3
RUN pip3 install --no-deps flytekitplugins-spark
g
0.30.3 is pretty old version, could you try 1.2.7
b
Agreed. I can check to see if we have a reason to be using that version rather than the newer ones. I'll follow up if I'm able to try out a newer version
Hi @glamorous-carpet-83516 @hallowed-mouse-14616! Just following up on this. I was able to upgrade out flytekit version to 1.2.7, but I'm not able to see any Decks on our tasks still. I'm guessing it may be the flyte console version as well? For context there, I see the following version-related things in our flyteconsole kube manifests: Service:
Copy code
labels: 
    <http://app.kubernetes.io/name|app.kubernetes.io/name>: flyteconsole
    <http://helm.sh/chart|helm.sh/chart>: flyte-core-v0.1.10
Config map:
Copy code
labels: 
    <http://app.kubernetes.io/name|app.kubernetes.io/name>: flyteconsole
    <http://helm.sh/chart|helm.sh/chart>: flyte-core-v0.1.10
Deployment:
Copy code
containers:
      - image: "<http://cr.flyte.org/flyteorg/flyteconsole:v1.1.0|cr.flyte.org/flyteorg/flyteconsole:v1.1.0>"
Maybe I need to try and upgrade the flyte-core version as well as the image we're pulling? Thanks for any insight!
h
Hey Seth, so I believe this is a versioning issue. It looks like decks was first available in the Flyte v1.1.0 release. This coincides with this PR, which uses flyteconsole v1.1.6. I'm not sure which versions of propeller / admin you need for decks either, but it should be relatively safe to assume that upgrading the helm chart to at least v1.1 (maybe 1.2?) will make decks available.
b
Ok thanks @hallowed-mouse-14616, I'll try an update accordingly and get back to you!
🙏 1
152 Views