openfaas / faas-cli

Official CLI for OpenFaaS
https://www.openfaas.com/
Other
796 stars 226 forks source link

Dockerfile is unavailable or not supported #878

Closed asencis closed 3 years ago

asencis commented 3 years ago

I'm following the guide for publishing an existing flask application through OpenFAAS.

However, when running the command:

faas-cli new --lang dockerfile $FN

I receive the following error:

Dockerfile is unavailable or not supported

I'm following the guide here: https://www.openfaas.com/blog/openfaas-flask/

asencis commented 3 years ago

Closing issue.

It seems I need to pull down all the available templates 🤦‍♂️

alexellis commented 3 years ago

This happens if you first pull a custom template, then you must explicitly pull the "default" templates. Otherwise this works out of the box.

alexellis commented 3 years ago

/msg: enduser

derek[bot] commented 3 years ago

Thank you for your interest in OpenFaaS. This project is maintained and made available for hobbyists and commercial users alike, so we need to balance our time across everyone's needs. Whilst we are excited in your interest in using OpenFaaS, we would also ask you to take a look at our contribution guide on Setting expectations, support and SLAs.

Commercial users can purchase support in order to get dedicated help from OpenFaaS Ltd, or they can book ad-hoc consulting hours to get an engineer to dedicate time to helping them.

If that is not a good fit for you at this time, please check out the OpenFaaS GitHub Sponsors options which are priced for practitioners like yourself. Organisations can also sponsor through their GitHub billing relationship.

When you become a sponsor as an indvidual, it will show this on your issues and PRs, so that the community can see that you are supporting our work, and can prioritise your needs.

If you are receiving this message after having received hands-on support from the OpenFaaS community, please join GitHub Sponsors to say thank you for our time.

Thank you for supporting OpenFaaS.

asencis commented 3 years ago

@alexellis Yeh. We discovered the need to pull after a while of digging. It might be worth highlighting this in the https://www.openfaas.com/blog/openfaas-flask/ blog, but other than this OpenFaaS is working really well! Thank you 🥇

One thing we have found tho - is that what we can do with req within the handler() function for the python3-flask-template is a little bit mysterious. Might it be worth us adding something to the documentation for Flask?

alexellis commented 3 years ago

There is documentation in the repo, have you checked out its docs yet?

https://github.com/openfaas/python-flask-template/

alexellis commented 3 years ago

I can't see any issues with the blog post because it has an explicit command faas-cli template store pull python3-flask ? What am I missing?

asencis commented 3 years ago

Hi @alexellis ,

Thanks for your reply.

So - the issue is with the section "Running an existing Flask app" -> and the command faas-cli new --lang dockerfile $FN. We didn't know we had to pull down this image - we assumed that it was some sort of default - but adding the line faas-cli template store pull dockerfile, would be so beneficial to this blog? Maybe? (Not sure that this is the exact line) I think yes, we're new to all this, so this is all very unfamilar. The notion of the faas store isn't quite in our language as yet. But worth stating explicitly for dev teams in our situation.

RE: with the req object, we're not sure what we can do with this. Can we treat this exactly like a flask request object...we're looking an we assume not - as it's a bytes str. So we're very confused as to what we can do with it in the "traditional" flask sense... any prompts somewhere would be amazing!

alexellis commented 3 years ago

It is because you already had alternative templates in place. Try it in a new directory and you'll see it work immediately.

alex@alex-nuc8:/tmp$ export FN=test
alex@alex-nuc8:/tmp$ faas-cli new --lang dockerfile $FN
Folder: test created.
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

Function created in folder: test
Stack file written: test.yml
alex@alex-nuc8:/tmp$ 

Feel free to ask questions on Slack. We don't use the issue tracker for technical support, but for tracking what work we're doing and for issues with a repro.