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

Enhancement: faas-cli local-run should run a build first #953

Closed
alexellis opened this issue Feb 8, 2023 · 6 comments · Fixed by #959
Closed

Enhancement: faas-cli local-run should run a build first #953

alexellis opened this issue Feb 8, 2023 · 6 comments · Fixed by #959

Comments

@alexellis
Copy link
Member

Expected Behaviour

When running faas-cli local-run, the function should be built prior to running, to ensure the latest changes are present

Current Behaviour

I'd like to run faas-cli local-build or perhaps we could consider renaming to faas-cli local?

And then have a build run using the existing cobra command/logic, followed by the current behaviour of faas-cli local-run executing after that.

Why do you need this?

I got caught out where I had run a build, changed code, then ran local-run, but didn't see my changes.

Who is this for?

Developers writing functions for OpenFaaS CE/Pro

List All Possible Solutions and Workarounds

For now I just change my command to: faas-cli build && faas-cli local-run

Which Solution Do You Recommend?

Open to input, but I think we should try to invoke the cobra command for builds for consistency.

@alexellis
Copy link
Member Author

Related to: #952

@rgee0
Copy link
Contributor

rgee0 commented Feb 17, 2023

As you start with wanting local-run to do a build then faas-cli local-run --build seems more intuitive to me. local-run then always runs locally its just a switch as to whether you want it to build first.

Contrast that with local-build going on to run the function - that doesn't seem as clear to the user what will happen, and it might become ambiguous as to how that differs from faas-cli build

@alexellis
Copy link
Member Author

Thanks for commenting @rgee0

The name "local-run" could change to something else, it's currently' an experimental command.

Why does it exist? To develop functions within Docker, without deploying to faasd / openfaas on K8s, which introduces additional delay.

For that purpose, the build will always be required and has caught me several times, including in my own development and on the community call.

The command is experimental so:

  • the name could change (suggestions?)
  • or the proposed --build flag should default to true

@rgee0
Copy link
Contributor

rgee0 commented Feb 19, 2023

Shortening the feedback loop is always welcomed, especially so if you can easily remember how to achieve it.

I wonder, if you haven't already considered it, whether faas-cli up --local would make better use of existing muscle memory. Within this mode there wouldn't be a push.

@alexellis
Copy link
Member Author

The command that scaffold uses is dev faas-cli dev

In any case, names can be iterated on, code can be moved.

Was this a feature you'd be interested in contributing partially or wholly?

@NikhilSharmaWe
Copy link
Contributor

@alexellis I would like to work on this.

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

Successfully merging a pull request may close this issue.

3 participants