Add mysql db access to productpage sample.#473
Add mysql db access to productpage sample.#473saumoh wants to merge 20 commits intoistio:masterfrom saumoh:master
Conversation
…hybrid/envoy-bypass use cases.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
Hi @saumoh. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
… service version embedded in the docker image.
|
CLAs look good, thanks! |
rshriram
left a comment
There was a problem hiding this comment.
This is good start @saumoh . Thank you for diversifying the example with more use cases. We need e2e integration test (like the way we have for almost every task in Istio). Otherwise, these things go out of sync quickly.
The way the system is setup now, will only work in K8S. To showcase external access or hybrid deployment stuff, we need to be able to provide username, password and hostname associated with the mysql DB (so that people can point this to any hosted mysql or on-prem mysql and try it out).
I am not sure how that can be tested regularly though - but it certainly falls under the egress proxy test.
| EXPOSE 9080 | ||
| ARG service_version | ||
| ENV SERVICE_VERSION ${service_version:-v1} | ||
| CMD python productpage.py 9080 $MYSQLADDR |
There was a problem hiding this comment.
where is this variable coming from?
There was a problem hiding this comment.
MYSQLADDR comes from the spec for the productpage Deployment. It can be an IP address or a fqdn. For service_version "v2" the productpage Deployment spec would have the following environment defined for the productpage container.
env:
- name: MYSQLADDR
value: "192.168.144.189"
| COPY requirements.txt ./ | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| COPY . . |
There was a problem hiding this comment.
move above requirements.txt line and remove the requierments.txt copy.
|
So, I found this in the IBM repos.. This basically did almost what you are trying to do.. Ratings service is talking to mysql. But it has all the necessary code to talk to either an internal or hosted mysql (hostname, password, username, etc..). I have spoken to @Animeshsing who created this demo. May be you guys could sync up and fix this PR accordingly? To be clear, I am mainly looking for a simple journey... most of istio tasks run with existing bookinfo. We add a new task that talks about integrating external services (people can choose whatever mysql db they want - in k8s or outside k8s) as long as they provide all the details. We can then use route rules to switch to new version, tinker with it. The key requirement is that we need an integration test, that would run before any PR to the master branch. |
|
thanks for the ref.
I am fine with leveraging the work done already. I am not a js guy so i'll
lean on @Animeshsing to ensuring that it's going to work :-)
Couple of suggestions/addition on the patch:
- If we could get some defaults for the DB_USER/DB_PORT/DB_PASSWORD(s)
that would be great. In case they are not passed as env. variables. DB_HOST
is a mandatory env var that must be passed.
- and if accessing the db is dependent on a service_version tag (v2:
access the db, v1: no db access)
If I have a patch with the above changes and the db schema and data used I
can convert it all into something that is easily consumable.
I am also happy to just adopt/copy the work done by @Animeshsing to the
productpage ver proposed in this pr. @Animeshsing please let me know your
preference.
Irrespective of which ver we use I will write the integration tests to get
it all into master.
One question i have @rshriram is if it's ok to have the mysql/ docker image
as part of this PR? In my opinion having it in there makes it easier to
test against and gives everyone a reference to look at. of course folks may
not use it and specify var's specific to their environment.
…On Fri, Jul 21, 2017 at 10:41 AM, Shriram Rajagopalan < ***@***.***> wrote:
So, I found this in the IBM repos..
https://github.com/IBM/microservices-traffic-management-using-istio#7-
modify-sample-application-to-use-the-external-database
This basically did almost what you are trying to do.. Ratings service is
talking to mysql. But it has all the necessary code to talk to either an
internal or hosted mysql (hostname, password, username, etc..).
I have spoken to @Animeshsing who created this demo. May be you guys could
sync up and fix this PR accordingly?
To be clear, I am mainly looking for a simple journey... most of istio
tasks run with existing bookinfo.
We add a new task that talks about integrating external services (people
can choose whatever mysql db they want - in k8s or outside k8s) as long as
they provide all the details. We can then use route rules to switch to new
version, tinker with it.
The key requirement is that we need an integration test, that would run
before any PR to the master branch.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#473 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AT2ksmWEWssr9_tb7f-VcU_28QVl7Uyoks5sQOLEgaJpZM4OaZnT>
.
|
| # limitations under the License. | ||
|
|
||
| FROM mysql:8 | ||
| ENV MYSQL_ROOT_PASSWORD "password" |
There was a problem hiding this comment.
any way to get a randomly generated password from env ?
|
/ok-to-test |
|
Thanks @rshriram for connecting. @saumoh will love to collaborate. Lets connect on Tuesday after between 2-5 PST - whatever tome works for you and we can discuss cc @AnthonyAmanse. Once we agree on a time i can send the invite |
|
@Animeshsing, @AnthonyAmanse great! Let me setup a meeting with you both
for 2pm pst 7/25
…On Fri, Jul 21, 2017 at 7:08 PM, Animesh Singh ***@***.***> wrote:
Thanks @rshriram <https://github.com/rshriram> for connecting. @saumoh
<https://github.com/saumoh> will love to collaborate. Lets connect on
Tuesday after between 2-5 PST - whatever tome works for you and we can
discuss cc @AnthonyAmanse <https://github.com/anthonyamanse>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#473 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AT2ksoO0uEXBDQMpx_Rsbt_Vc9DMKfKIks5sQVmigaJpZM4OaZnT>
.
|
|
@Animeshsing, @AnthonyAmanse
let's use google hangouts for the discussion today at 2pm pdt
https://plus.google.com/hangouts/_/tigera.io/saurabh?hceid=c2F1cmFiaEB0aWdlcmEuaW8.vf25qu0b75cljn24uleaqfc1co&authuser=0
…On Mon, Jul 24, 2017 at 10:26 AM, Saurabh Mohan ***@***.***> wrote:
@Animeshsing, @AnthonyAmanse great! Let me setup a meeting with you both
for 2pm pst 7/25
On Fri, Jul 21, 2017 at 7:08 PM, Animesh Singh ***@***.***>
wrote:
> Thanks @rshriram <https://github.com/rshriram> for connecting. @saumoh
> <https://github.com/saumoh> will love to collaborate. Lets connect on
> Tuesday after between 2-5 PST - whatever tome works for you and we can
> discuss cc @AnthonyAmanse <https://github.com/anthonyamanse>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#473 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AT2ksoO0uEXBDQMpx_Rsbt_Vc9DMKfKIks5sQVmigaJpZM4OaZnT>
> .
>
|
* Enable Prow * Fix BUILD format * Add execution perm to the script * Fix shell script * Fix flag name * Use the right k8s cluster * Create the ~.kube dir * Linking instead of moving * Explicitly specify dir * Remove debug statements * Rename test_log_path to test_logs_path for consistency * Adds desc + failure conditions
…hybrid/envoy-bypass use cases.
|
@saumoh PR needs rebase |
6 similar comments
|
@saumoh PR needs rebase |
|
@saumoh PR needs rebase |
|
@saumoh PR needs rebase |
|
@saumoh PR needs rebase |
|
@saumoh PR needs rebase |
|
@saumoh PR needs rebase |
|
Yes, it's a bug about merge-bot, will fix it before reopen. |
|
@saumoh PR needs rebase |
|
Sorry for all the mess, so the problem is Mungegithub wants to add a label "needs-rebase" while there is no such label existing and merge-robot is so sad that he cannot create a label in this repo, so he keeps bugging. Since I can't create labels, can any one with access add it, merge-robot will appreciate it :) |
|
Closing this pull request. The plan is to work with @animeshsingh @AnthonyAmanse on a broader version of this. |
Automatic merge from submit-queue Add mysql db to ratings service in bookinfo app. Tracked in #573 and discussed in #473, adding mysql db access to the ratings service. cc @rshriram @AnthonyAmanse @ldemailly
This PR will add a print out of version information to the log for istio mixer. This should ease debugging, etc., as the version info will come along with the log. Example: ```shell $ ./bazel-bin/cmd/server/mixs server Istio Mixer: version: unknown (build: 2017-03-29-84ea18c, status: Modified) Starting gRPC server on port 9091 ``` Former-commit-id: 7b4e4a37769b8132e9327333568767a013bef924
Automatic merge from submit-queue Add mysql db to ratings service in bookinfo app. Tracked in #573 and discussed in #473, adding mysql db access to the ratings service. cc @rshriram @AnthonyAmanse @ldemailly Former-commit-id: 7b5271d
This PR will add a print out of version information to the log for istio mixer. This should ease debugging, etc., as the version info will come along with the log. Example: ```shell $ ./bazel-bin/cmd/server/mixs server Istio Mixer: version: unknown (build: 2017-03-29-84ea18c, status: Modified) Starting gRPC server on port 9091 ``` Former-commit-id: c926e35fdd6686b270eab3799ef6670af4cb3a96
Automatic merge from submit-queue Add mysql db to ratings service in bookinfo app. Tracked in istio#573 and discussed in istio#473, adding mysql db access to the ratings service. cc @rshriram @AnthonyAmanse @ldemailly Former-commit-id: 7b5271d
* Let MANAGER_HUB and MANAGER_TAG env vars override defaults in inject.go if present * Remove defaults in the binary in favor of env variables * Use test-specific hub instead of env var * Added comments on env var name constants * Format
Automatic merge from submit-queue Add mysql db to ratings service in bookinfo app. Tracked in #573 and discussed in #473, adding mysql db access to the ratings service. cc @rshriram @AnthonyAmanse @ldemailly Former-commit-id: 7b5271d
* Update to latest common-files * Address reviewer comments.
* Update readme for controller local debugging * Address comment
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
) If an injected annotation value contained a double-quote character, the rendered istiod-injector-configmap YAML would be invalid. Unmarshalling the inject config would fail with: update error: failed to unmarshal injection template: error converting YAML to JSON: yaml: line 10: did not find expected key
The sample bookinfo app has productpage as one of the micro services. This patch optionally add's a mysql db access from the productpage microservice. This could be helpful in checking out the following use cases of a service mesh:
I'd be happy to change this pr request to make it more useful for general consumption.
One option that was discussed was to create a rev. (v2) of productpage micro service which includes the db access and leave v1 version as is.