openfaas-incubator / python3-debian

Template for Python3 on Debian for data-science / compiled pip modules
MIT License
4 stars 10 forks source link

Modified Dockerfile to run as non-root #8

Open padiazg opened 5 years ago

padiazg commented 5 years ago

Signed-off-by: Patricio Diaz padiazg@gmail.com

This is a WIP to solve issue #7

I need to test the native build toolchain aspect to assure it accomplishes all the requirements.

alexellis commented 5 years ago

Hi, is this still WIP?

padiazg commented 5 years ago

I tested this template using this:

handler.py

import numpy as np
import json

def handle(req):
    e = np.random.random((2,2))
    l = e.tolist()
    return json.dumps(l)

requirements.txt

numpy

Deployed using

$ faas-cli up --skip-push

After calling it from the UI got

[
  [
    0.18303540222696302,
    0.3272620080124268
  ],
  [
    0.3718849181724705,
    0.2596801229379512
  ]
]

So I think we can remove the WIP label