Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.33k stars 437 forks source link

Custom packages not properly supported for Linux preview offer #720

Closed priyaananthasankar closed 6 years ago

priyaananthasankar commented 6 years ago

Requirements.txt

azure-functions==1.0.0a4
azure-functions-worker==1.0.0a4
grpcio==1.14.2
grpcio-tools==1.14.2
protobuf==3.6.1
six==1.11.0
nltk==3.3
gensim==3.5.0
azure-storage-blob==1.3.1
pyLDAvis==2.1.2

The above succeeds only with --build-native-deps (see Issue https://github.com/Azure/azure-functions-core-tools/issues/719 for issue with PyPI publish)

Runtime Error

2018-09-14T00:13:00.555 [Information] Executing 'Functions.TrainBook' (Reason='This function was programmatically called via the host APIs.', Id=d57d8790-d73c-44a8-9a52-2faa752b826d)
2018-09-14T00:13:00.633 [Error] Executed 'Functions.TrainBook' (Failed, Id=d57d8790-d73c-44a8-9a52-2faa752b826d)
asavaritayal commented 6 years ago

I tested publishing with a basic HTTP triggered function and the requests package but the execution fails in Azure. @ahmelsayed - did something change in the base image?

asavaritayal commented 6 years ago

It looks like custom packages are not working on Azure at all. @bala16 is investing the issue.

ahmelsayed commented 6 years ago

I can't repro this using the following

requirements.txt

azure-functions==1.0.0a4
azure-functions-worker==1.0.0a4
cycler==0.10.0
grpcio==1.14.2
grpcio-tools==1.14.2
kiwisolver==1.0.1
matplotlib==2.2.3
numpy==1.15.1
protobuf==3.6.1
pyparsing==2.2.0
python-dateutil==2.7.3
pytz==2018.5
six==1.11.0

function/__init__.py

mport logging

import azure.functions as func
import numpy as np
import random
import io
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure

def main(req: func.HttpRequest) -> func.HttpResponse:
    fig = Figure()
    axis = fig.add_subplot(1, 1, 1)

    xs = range(100)
    ys = [random.randint(1, 50) for x in xs]

    axis.plot(xs, ys)
    canvas = FigureCanvas(fig)
    output = io.BytesIO()
    canvas.print_png(output)

    return func.HttpResponse(output.getvalue(), mimetype="image/png", status_code=200)

Please share a full repro including the code.

Closing until it's actionable.

ahmelsayed commented 6 years ago

I tested on dedicated, but the issue is with consumption. I'll take a look at that

ahmelsayed commented 6 years ago

This should be fixed in West US