-
Notifications
You must be signed in to change notification settings - Fork 798
Service registry lookup #231
Comments
I've been working on a design for this with the Opscode guys. I hope to post a specification here shortly and get a PR together that implements a manual service registry that we can later make more dynamic (late binding, multi-tenancy, etc.) |
@gabrtv, do you still have that spec hiding around somewhere for this issue? :) |
Standalone Service RegistryThe service registry is a wrapper to common web services for Technical OverviewThis project will be a generic wrapper for web services, giving administrators Similar to Heroku Add-ons, customers use the service registry to provision an Target MarketThe service registry aims to target the PaaS industry, where new PaaS vendors It also targets the SaaS market, where new providers are looking to get some Administrator's SpecAn administrator of the registry can manage all of the registered gateways.
Registering a GatewayAdds the gateway to the registry. The gateway is disabled by default.
Unregistering a GatewayRemoves the gateway from the registry. Any addons created with this gateway
Disabling a GatewayDisables a gateway, denying any calls to provision a new addon.
Enabling a GatewayEnables a Gateway for use.
Developer SpecA developer can manage their addons through the command line interface. You can view your current addons that are bound to your application with the
Adding an AddonAdds the addon to the application, and forces a new release.
Removing an AddonRemoves the addon from the application, and forces a new release.
Switching PlansChanges the addon credentials within the application to reflect the upgraded (or downgraded) plan's new endpoint. Forces a new release.
Opening an Addon's DashboardOpens a management page on the provider's website for the addon, giving the user administrative access to the addon.
Read Documentation on an AddonOpens documentation on how to use the addon with the application.
Registry Endpoints
Architecture Diagram
|
@bacongobbler This looks great. Let's flesh out the developer UX next. For example, how does a developer actually attach a database to an existing application using the CLI? With Heroku this looks like |
optionally, you should also be able to make this scriptable by specifying the |
Thanks for this @bacongobbler. After much chin stroking and IRC discussion, here are the next steps before we can start implementation:
Once we agree on moving forward, I suggest we start with a PostgreSQL reference implementation! |
Features to discuss before this spec is considered final. These may also be cut from the final spec (as we don't need to concern ourselves with SPOF for now):
|
Work in progress at https://github.com/bacongobbler/service-registry |
It's very much alpha in it's current state, but I have a working proof of concept where the service registry will create and delete new MySQL databases, as well as return a URI for use. Documentation (and tests!) has still yet to be written, but you can try it out and see what kind of changes you guys would like to see. Instructions on getting started:
$ git clone git://github.com/bacongobbler/service-registry.git -b develop
$ cd service-registry
$ virtualenv venv && source venv/bin/activate
$ pip install -r requirements.txt
$ python manage.py syncdb --noinput
$ python manage.py runserver
After clicking POST to save, the entry should have been created, and the new database should be created in your local MySQL service. To verify, take a look at the $ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.15 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| asdfqwerty |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
mysql> select User from mysql.user;
+------------------+
| User |
+------------------+
| root |
| root |
| |
| |
| 8w685g6qkha3spot |
| root |
+------------------+
6 rows in set (0.00 sec) For example, my uri field is now set to $ mysql -u 8w685g6qkha3spot -pqrpsgu8yk64ig97h asdfqwerty
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.6.15 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
Empty set (0.00 sec) |
So exciting! Great work :) The code's on the develop branch right? |
Sorry, the instructions imply that it's currently on the develop branch. I'll be more explicit next time. You are correct! :) |
Just tried it and it worked first time out of the box ;) What's next then? Is the plan for these endpoints to live on the official Deis API? I see that there'll be new commands for the CLI client. Will the Deis cookbook officially have recipes for certain 'built-in services'? I'd like to help with this if I can. My Danabox project (formerly Crowdbox) is actually in private beta now and I think having database support is going to help encourage people to try it out. |
I try to keep a green policy for master :)
The plan is to have this residing on the controller as a standalone web
By all means, please do! |
What's the reasoning for having a separate app? Sorry if this has been discussed elsewhere already. As a separate web app is it easy to piggyback off the API's cookie session from the CLI client? Is the idea to have it included in the official cookbook? And will there be recipes for built-in services in the cookbook? The new commands in the CLI client should be pretty straightforward. So should we start a new branch on Deis to pull all these things together? |
Good question. I think a little background where I'm coming from is necessary... I come from a cloudfoundry background, working on Stackato. Cloudfoundry's cloud_controller_ng has service discovery built in via a message bus called NATS and by using pub/sub techniques. The service registries (named service brokers in cfv2) are all separate sinatra apps, proxied together using an asynchronous proxy server. There is one service broker for each service (i.e. MongoDB, MySQL, Postgres, etc.), so each web app knows how to handle each service. It's convoluted, but it works. It has a couple advantages this way:
flynn.io is the same, in a sense. It has multiple micro apps all formed together to make one giant PaaS system, which are all discovered using discoverd, which is another service discovery system. It helps keep different offerings available on multiple servers, and in a perfect world, makes each system fully redundant (well, the service discovery is not necessarily redundant, nor is the controller). Cloudfoundry has this issue too, where they are trying to solve the problem of having no single points of failure in the cluster (currently, the message bus and the controller are SPOFs, though there may be other components that are just as likely to be a SPOF, too). Unfortunately, Deis does not have service discovery yet (looking forward to seeing this in a future release 😉), so it'd probably make more sense to integrate this into the controller for now.
The idea is the same with how you can enable or disable formation providers. You should be able to enable or disable certain service providers with a couple changes in
Yes, a new branch would be good to put all this work back into the controller. dibs on |
…SON response that includes MySQL URI. deis#231
…SON response that includes MySQL URI. deis#231
…SON response that includes MySQL URI. deis#231
That makes sense about isolating service discovery, you can't make the service-discoverer the same as one of the services that it is trying to discover. So I made @bacongobbler's dibbed 231-service-registry branch with a basic integration of the service registry into the controller. Just wondering if it's the right direction to be heading in? Sorry about the 3 commits. I forgot to remove the '.git' folder when copying in the service-registry repo and git thought it was a submodule ಠ_ಠ Still to do:
|
I like your approach, but if we're following Deis' current design pattern, the service code should be integrated back into the
Tack on "add tests" to that list!
Yes. It should be the same access controls. You should only be able to add a service to an application you have permission to create new releases for.
Maybe that can be set up as a |
I did actually think complete integration was preferable. But then I wondered if it would be harder to extract out when the time came to make it standalone. Okay, so let's do it that way. So should the models and tasks be appended to Yes, tests of course! I forgot about them. Yes, same access controls. That's pretty straightforward then if it's being integrated straight into the API app. Yes, I think a |
Yes.
More like a
All of the node providers/flavors are done in the same way, so yes :)
Installing MySQL can be just as easy as creating a new I think this needs a bigger discussion, as this is a particularly larger subject all on its own. As this was just a proof of concept, all communication was done locally with a base install of MySQL (you can even see the code here). Ideally, It'd be nice to have this all on a separate deis layer, with the operations engineer being able to specify what services he would like on each node (maybe he wants @gabrtv or @mboersma, any input from you guys on this topic? |
Ah, got it! So, a service layer, that definitely sounds like the right way to go. But yeah part of a bigger discussion. So there'll be CLI commands like Might I imagine there could be arguments to Definitely +1 for BTW I'm not wedded to implementing all this, I may not be the best person to do it. I'm just happy to do any grunt work. |
@bacongobbler @tombh When I get some time to breathe I plan to give this a more thorough review including a deep dive into the code. Here is my early feedback:
On a related, service discovery via |
@gabrtv Thanks for the feedback :) I reckon I've got a good idea now of how to flesh out a prototype for this. I really want this on Danabox, so I'm going to crack on with it today and hopefully get it deployed there for some live testing soon. BTW, point 4 and containerisation in general is sounding awesome. I don't fully understand how |
…d adds service URI to config
What is the temporary way to add databases etc. and access them via. your application? |
@bacongobbler What if I want to run my database on Deis? Not possible yet? Also, any news on this? Still researching, or? |
No news other than what's already been posted. Lots of feature requests with very little (wo)manpower is all :) |
Any chance this is getting priority with the recent EY acquisition? |
In the meantime, how would people suggest sharing a development database setup with colleagues. To me, the best options seem to be:-
Am I missing anything better? |
Short from hosting it on your own infrastructure, that sounds correct to me. |
@bacongobbler Where is the Service Registry repository? |
@CloudSide I deleted https://github.com/bacongobbler/service-registry as it was from a pre-production release of Deis (v0.7.0 or something) and is quite out of date. We weren't going to move forward with that branch. The idea now is to implement a service endpoint in the controller, which then will register and consume Cloud Foundry broker APIs since that project has been open-sourced and is used in production. |
@bacongobbler How do I use |
it isn't implemented yet. This issue is to track the progress of that feature. :) |
I'm looking forward |
Any progress in the last 2 month on this? |
@pascalschwientek we've updated the roadmap, but all communication related to this feature will be laid out in this issue. No progress has been made. |
Is this still true? Say I want to create a Design Doc, should that be a separate issue or a continuation of this one? |
It will be a continuation of this thread. I will be tackling |
Ok sweet, thanks for the update. |
Moved to deis/controller#1220. |
Come up with simple design for new object models / dynamic config / envvars to be Deis' service registry and attachment workflow.
The text was updated successfully, but these errors were encountered: