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

Swagger to notebook to microservice #2

Closed
parente opened this issue Dec 3, 2015 · 8 comments
Closed

Swagger to notebook to microservice #2

parente opened this issue Dec 3, 2015 · 8 comments
Assignees

Comments

@parente
Copy link
Member

parente commented Dec 3, 2015

Demonstrate turning a Swagger spec into kernel-based microservice. Include:

  • Code that turns a Swagger API spec into a template notebook with annotations for the kernel gateway
  • A notebook with the template completely implemented
  • A Dockerfile that packages the necessary kernel, kernel gateway, and notebook together and starts a single instance of the microservice on Docker run
@parente
Copy link
Member Author

parente commented Dec 3, 2015

/cc @Lull3rSkat3r

@parente
Copy link
Member Author

parente commented Dec 15, 2015

Discussed on appear. We're going to axe the user permissions and auth from the pet store example since it starts to conflate microservice with web app backend.

We're going to put in the PR without the error codes and headers to get a MVP in. We'll keep this open to keep improving it over time.

parente added a commit that referenced this issue Dec 16, 2015
[Issue #2]: Created swagger codegen module to generate notebooks.
@parente
Copy link
Member Author

parente commented Dec 17, 2015

Tried the instructions today. Worked fine. Good work.

Other than the API completion that we talked about, what's missing is a separate UI so folks can understand how the microservice can be used. I really don't want to implement a whole pet store web site, but we have to have something that demonstrates how notebook-to-microservice = backend that can then be used to develop a frontend (be it by coding one or using some dashboarding tool).

I have no thoughts at the moment other than "write something simple ourselves". Any ideas?

@Lull3rSkat3r
Copy link
Member

So a few ideas (in order of what I think is best):

  1. The swagger-codegen module can generate a static web page for interacting with an API. We could generate this file in the gen target and add it as a parameter to the gateway to serve that file
  2. http://editor.swagger.io - I have included the swagger yaml and json files for the demo. They can be used to import into the swagger editor and that will generate a UI dynamically. I did a quick test and there are some CORS issue we would need to handle.
  3. On a similar note as the two points above, the swagger-ui project renders a page which can point to a swagger spec. This would require us to finish shutdown_all does not check VALIDATE_KG_CERT #42 and would actually lose data about the spec since we don't support all the swagger features in our parsing of the notebook.
  4. I have a bunch of postman requests which interact with the server for testing. We could pretty them up and use that as a demo (you can import collections of requests into postman

@parente
Copy link
Member Author

parente commented Dec 17, 2015

#1 sounds fine for this demo. How about just bringing it up in a second container along side the first microservice one and telling people to point their browsers at it?

@Lull3rSkat3r
Copy link
Member

Brining up another container would result in the CORS issues I was seeing in the second point.

@parente
Copy link
Member Author

parente commented Dec 17, 2015

We decided to enable the CORS headers in kernel gateway over notebook-http mode. That way we can use the public editor.swagger.io.

@parente
Copy link
Member Author

parente commented Jan 5, 2016

We enabled the CORS headers in the kernel gateway for notebook-http mode. This now works as expected on editor.swagger.io. Closing.

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

No branches or pull requests

2 participants