operator-framework / operator-sdk

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
https://sdk.operatorframework.io
Apache License 2.0
7.24k stars 1.74k forks source link

Error: must in project root dir: stat ./tmp/build/Dockerfile: no such file or directory #685

Closed debianmaster closed 5 years ago

debianmaster commented 5 years ago

Bug Report

odk = operatorsdk-alias

What did you do?

$ odk new odoo-operator --type=ansible --kind=Odoo --api-version=odoo.test.io/v1alpha1
Create odoo-operator/tmp/init/galaxy-init.sh
Create odoo-operator/tmp/build/Dockerfile
Create odoo-operator/tmp/build/test-framework/Dockerfile
Create odoo-operator/tmp/build/go-test.sh
Rendering Ansible Galaxy role [odoo-operator/roles/Odoo]...
Cleaning up odoo-operator/tmp/init
Create odoo-operator/watches.yaml
Create odoo-operator/deploy/rbac.yaml
Create odoo-operator/deploy/crd.yaml
Create odoo-operator/deploy/cr.yaml
Create odoo-operator/deploy/operator.yaml
Run git init ...
Initialized empty Git repository in /Users/jjonagam/odk/odoo-operator/.git/
Run git init done

$ odk build quay.io/debianmaster/odoo-operator
Error: must in project root dir: stat ./tmp/build/Dockerfile: no such file or directory

What did you expect to see? docker image needs be built

What did you see instead? Under which circumstances? Error: must in project root dir: stat ./tmp/build/Dockerfile: no such file or directory

Environment

$ odk --version
operator-sdk version 0.0.7
debianmaster commented 5 years ago

same issue for v0.1.0 release too

debianmaster commented 5 years ago

odk build quay.io/debianmaster/odoo-operator 2018/11/01 14:16:31 must run command in project root dir: stat ./build/Dockerfile: no such file or directory

$ pwd
/Users/jjonagam/odk/odoo-operator
debianmaster commented 5 years ago

Also if i run odk local up it works but seeing this error i have installed both
pip install ansible-runner , pip install ansible-runner-http

358081
ERRO[0053] error from ansible-runner: exit status 1      component=runner job=692795177509358081 name=example namespace=default
ERRO[0053] did not receive playbook_on_stats event
INFO[0055] dropping event that is not a JobEvent         component=eventapi job=3360049555043144551
ERRO[0055] error from ansible-runner: exit status 1      component=runner job=3360049555043144551 name=example namespace=default
ERRO[0055] did not receive playbook_on_stats event
INFO[0057] dropping event that is not a JobEvent         component=eventapi job=1859530510564194602
ERRO[0057] error from ansible-runner: exit status 1      component=runner job=1859530510564194602 name=example namespace=default
ERRO[0057] did not receive playbook_on_stats event
INFO[0059] dropping event that is not a JobEvent         component=eventapi job=2270335754326433320
ERRO[0059] error from ansible-runner: exit status 1      component=runner job=2270335754326433320 name=example namespace=default
ERRO[0059] did not receive playbook_on_stats event
INFO[0061] dropping event that is not a JobEvent         component=eventapi job=3620944955363878112
ERRO[0061] error from ansible-runner: exit status 1      component=runner job=3620944955363878112 name=example namespace=default
ERRO[0061] did not receive playbook_on_stats event
INFO[0063] dropping event that is not a JobEvent         component=eventapi job=1884032942271309034
ERRO[0063] error from ansible-runner: exit status 1      component=runner job=1884032942271309034 name=example namespace=default
ERRO[0063] did not receive playbook_on_stats event
INFO[0065] dropping event that is not a JobEvent         component=eventapi job=2342211497725001116
ERRO[0065] error from ansible-runner: exit status 1      component=runner job=2342211497725001116 name=example namespace=default
ERRO[0065] did not receive playbook_on_stats event
INFO[0067] dropping event that is not a JobEvent         component=eventapi job=380128425796981413
ERRO[0067] error from ansible-runner: exit status 1      component=runner job=380128425796981413 name=example namespace=default
ERRO[0067] did not receive playbook_on_stats event
INFO[0069] dropping event that is not a JobEvent         component=eventapi job=3808456979038405264
^CINFO[0069] Exiting
debianmaster commented 5 years ago

this issue is only on mac. !

lilic commented 5 years ago

cc @shawn-hurley ^

shawn-hurley commented 5 years ago

I notice in the steps that you do not change directory into the operator after it is created. That might be the problem. Can you please double check this?

For the second issue, it looks like to me your ansible is failing(ansible-runner exit status 1). We are working on better ways to surface these errors but operator-sdk is running your ansible, and everything is working, but the ansible that is being run is failing. One way to check this is to look at /tmp/ansible-runner/..../artifacts/stdout this file will be where the ansible output is, and you should be able to see where it is failing.

debianmaster commented 5 years ago

@shawn-hurley sorry i missed in issue but i did change directory.

i'll look for /tmp/ansible-runner/..../artifacts/stdout next time i run

shawn-hurley commented 5 years ago

I am unable to reproduce this error. Can you please give a more detailed environment if this is still an issue. I have followed your new command the exact same and was able to create the image with the same build command.

If you are attempting to build an operator generated with the old sdk command, but now with a new command, then yes you will see the issue with ./build/Dockerfile. You will have to follow the migration guide.

I am going to close this issue, please open it back up with more detail if the above does not answer your question Thanks!