Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cli: open ./template/python: no such file or directory error #99

Closed
theodesp opened this issue Sep 14, 2017 · 6 comments
Closed

Cli: open ./template/python: no such file or directory error #99

theodesp opened this issue Sep 14, 2017 · 6 comments

Comments

@theodesp
Copy link

I'm trying to build a python example using the tutorial https://blog.alexellis.io/first-faas-python-function/ and the moment I call:

$ faas-cli -action build -f ./stack.yml

I get:

open ./template/python: no such file or directory error

is there anything that I miss?

Expected Behaviour

$ faas-cli -action build -f ./stack.yml
...

Successfully tagged faas-hello-python:latest  
Image: faas-hello-python built.  

Current Behaviour

➜  functions cat stack.yml
provider:
  name: faas
  gateway: http://localhost:8080

functions:
  hello-python:
    lang: python
    handler: ./hello-python
    image: faas-hello-python
➜  functions cat hello-python/handler.py
def handle(req):
    print("Hello! You said: " + req)
    %
➜  functions faas-cli -action build -f ./stack.yml
Building: hello-python.
Clearing temporary build folder: ./build/hello-python/
Preparing ./hello-python/ ./build/hello-python/function
2017/09/14 08:57:26 open ./template/python: no such file or directory

Possible Solution

Steps to Reproduce (for bugs)

Context

I was trying to follow the tutorial steps from here:
https://blog.alexellis.io/first-faas-python-function/

Your Environment

  • Docker version docker version (e.g. Docker 17.0.05 ):
➜  functions docker version
Client:
 Version:      17.06.2-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 20:12:06 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.2-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 19:59:19 2017
 OS/Arch:      linux/amd64
 Experimental: true
  • Are you using Docker Swarm or Kubernetes (FaaS-netes)?
    Docker swarm
  • Operating System and version (e.g. Linux, Windows, MacOS):
➜  functions uname -a
Darwin C02SG3FQFVH6 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
  • Link to your project or a code example to reproduce issue:
@austinfrey
Copy link
Contributor

@theodesp I was unable to reproduce, using the commands you had listed. There have been some updates to the cli recently though, what version are you using? faas-cli version

and you might also try running the below commands to see if you have better luck.

$ mkdir hello-python && cd hello-python
$ faas-cli new --lang python --name hello-python
$ faas-cli build -f ./hello-python.yml

@rgee0
Copy link
Contributor

rgee0 commented Sep 14, 2017

@theodesp I managed to replicate but only through running the faas-cli command in the wrong place.

The blog post suggests using the user's home directory so the lay out of files should be:

~/functions
├── hello-python
│   └── handler.py
└── stack.yml

The faas-cli -action build -f ./stack.yml command from the blog should then be run from the functions directory.

Could you provide a directory listing of ~/functions after you have tried the build command? The templates should be being downloaded and unzipped to the working directory. The error above suggests that may not have happened.

@rgee0
Copy link
Contributor

rgee0 commented Sep 14, 2017

Derek add label: Support Question

@ghost ghost added the Support Question label Sep 14, 2017
@alexellis
Copy link
Member

As long as you don't have a template folder already, the templates are always downloaded every time you run a "build" or "new" command via the CLI.

@alexellis
Copy link
Member

Here's an example:

$ faas-cli new --lang python --name test1
2017/09/14 12:28:40 No templates found in current directory.
2017/09/14 12:28:40 Attempting to expand templates from master.zip
Found "template/"
....

@alexellis
Copy link
Member

Closing the issue. If anyone has more information feel free to re-open / comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants