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

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

Open
alexellis opened this issue Oct 27, 2018 · 12 comments
Open

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

alexellis opened this issue Oct 27, 2018 · 12 comments

Comments

@alexellis
Copy link
Owner

alexellis commented Oct 27, 2018

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
Copy link
Owner Author

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

@vbmade2000
Copy link

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
Copy link
Owner Author

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
Copy link
Contributor

Is there a struct for this future Go template?

@vbmade2000
Copy link

Ah Ok.

@alexellis
Copy link
Owner Author

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
Copy link
Contributor

cheikhshift commented Oct 27, 2018 via email

@alexellis
Copy link
Owner Author

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
Copy link
Contributor

cheikhshift commented Oct 27, 2018

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
Copy link
Owner Author

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
Copy link
Contributor

Sure.

Glad I can help.

@alexellis
Copy link
Owner Author

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

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

3 participants