alexellis / derek

Reduce maintainer fatigue by automating GitHub
https://github.com/alexellis/derek/blob/master/USER_GUIDE.md
MIT License
808 stars 70 forks source link

Remove Dockerfile in favour of OpenFaaS Golang template - Part 1 #97

Open alexellis opened 5 years ago

alexellis commented 5 years ago

The Dockerfile is now unnecessary - Derek was developed before the Golang templating system, so we should move the code to use the Golang template for less to maintain, more frequent watchdog updates and other fixes done in the Golang template.

faas-cli new --lang go derek

Since the Golang template uses the classic watchdog and allows for forking per request, no other changes are required to prevent os.Exit/panic handling.

The various environmental variables can be moved into there derek.yml file.

Once refactored part 2 can take place #96

alexellis commented 5 years ago

@rgee0 anything else that needs to be covered as part of this change?

vbmade2000 commented 5 years ago

If it is just about removal of Dockerfile then I can address this issue as I don't have much understanding of project and so it would be a good start for me.

alexellis commented 5 years ago

No it's not removing the file, it's migrating to the Golang template which involves removing the Dockerfile as part of the work.

cheikhshift commented 5 years ago

Is there a struct for this future Go template?

vbmade2000 commented 5 years ago

Ah Ok.

alexellis commented 5 years ago

Use the OpenFaaS CLI with the command line given above to migrate it from a stateless microservice using a Dockerfile to a function with the standard template. https://blog.alexellis.io/serverless-golang-with-openfaas/

If this is too technical for a new contributor then an existing OpenFaaS user or Derek contributor should take this on.

cheikhshift commented 5 years ago

I'll give it a shot, current contributors should also tackle this. I'll be looking at the Derek source code before making a suggestion.

Thanks for the clarification!

On Oct 27, 2018, at 4:45 PM, Alex Ellis notifications@github.com wrote:

Use the OpenFaaS CLI with the command line given above to migrate it from a stateless microservice using a Dockerfile to a function with the standard template. https://blog.alexellis.io/serverless-golang-with-openfaas/

If this is too technical for a new contributor then an existing OpenFaaS user or Derek contributor should take this on.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

alexellis commented 5 years ago

Some additional changes are going to be needed on this one. I'm going to suggest picking it up myself or having one of the maintainers do it since it will need more moving around than I expected.

cheikhshift commented 5 years ago

Sounds good, although, I have a fork you can look at currently here : https://github.com/thestrukture/derek

my attempt involved moving the go source code with suffix Handler to a new sub-level package called handler. This package is used with the FaaS handler and main function.

alexellis commented 5 years ago

The approach in your fork is very similar to what I was doing locally. Can you raise a separate PR which only creates the handler package and nothing else? (Use git mv to preserve the history of the files) that seems like a good incremental start.

cheikhshift commented 5 years ago

Sure.

Glad I can help.

alexellis commented 4 years ago

@cheikhshift are you still working on this, can you raise a PR?