Skip to content

Conversation

jeffmendoza
Copy link
Contributor

@jeffmendoza jeffmendoza commented Feb 15, 2018

Grafana 5.0 includes a major UI update. Configuration of datasources
and dashboards is easly done via file. Dashboards have been imported
and re-exported to be on the latest schema. README and install config
updated.

See the promo video here.
What's new here.

Screenshot below
grafana-5 0

@istio-testing
Copy link
Collaborator

Hi @jeffmendoza. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Instructions 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.

@mattdelco
Copy link
Contributor

Are there going to be more dashboard files added in the future? Currently I'm hesitant to think 3 files warrants a directory copy. The alternative I'm considering is along the lines of:

Dockerfile.grafana:

- COPY dashboards /var/lib/grafana/dashboards/
+ # possibly need to do: RUN mkdir -p /var/lib/grafana/dashboards/
+ COPY istio-dashboard.json /var/lib/grafana/dashboards/
+ COPY mixer-dashboard.json /var/lib/grafana/dashboards/
+ COPY pilot-dashboard.json /var/lib/grafana/dashboards/

in tools/istio-docker.mk add these to GRAFANA_FILES:

addons/grafana/dashboards/istio-dashboard.json
addons/grafana/dashboards/mixer-dashboard.json
addons/grafana/dashboards/pilot-dashboard.json

an optional simplification is to remote the $(GRAFANA_FILES) dependency:

- docker.grafana: addons/grafana/Dockerfile$$(suffix $$@) $(GRAFANA_FILES)
+ docker.grafana: addons/grafana/Dockerfile$$(suffix $$@)

as the dependency is already added/handled by the preceeding "$(foreach FILE,$(GRAFANA_FILES) " line.

@douglas-reid
Copy link
Contributor

/ok-to-test

@douglas-reid
Copy link
Contributor

@jeffmendoza would you mind posting some screenshots of the updates to make it slightly easier to appreciate what the update looks like?

@jeffmendoza
Copy link
Contributor Author

@mattdelco What is the cost of adding a directory copy? There will be more dashboards, and I'd like it to be easier for them to be added. New contributors could be intimidated by the Makefile system.

@mattdelco
Copy link
Contributor

The cost of the directory copy is mostly about loss of consistency and increased special casing in the Makefile. If someone also later adds other files (e.g., a readme.md for devs) then those might inadvertently get added to the docker image. With individual files someone would have to update the Makefile but that'd only be to add a file to GRAFANA_FILES.

The runtime cost is harder to quantify (e.g., 1 call to "cp -r" vs 3 calls to "cp"). Citing individual files will probably copy less during an incremental rebuild, but the build time will probably be dominated by "docker build" copying the entire $(ISTIO_DOCKER) directory to a temp location to perform a hermetic build. In any case I doubt anyone would notice the perf difference for such a small file count, so I was mostly asking to help gauge if the inconsistency was a worthwhile tradeoff.

@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 16, 2018
@istio-merge-robot
Copy link

@jeffmendoza PR needs rebase

Grafana 5.0 includes a major UI update. Configuration of datasources
and dashboards is easly done via file. Dashboards have been imported
and re-exported to be on the latest schema. README and install config
updated.
@istio-merge-robot istio-merge-robot removed the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 16, 2018
@jeffmendoza
Copy link
Contributor Author

@mattdelco
I'd like a new developer to be able to run docker build -t my-grafana -f Dockerfile.grafana . inside that directory. Using GRAFANA_FILES and the changes you mentioned in the Dockerfile would make that not work, unless the dashboard.json files were moved up a dir. I think that would get a bit messy.

@mattdelco
Copy link
Contributor

Generally it's been fragile for there to be multiple ways to build things (it's not uncommon for one way to break in ways that the others don't), so I'd actually find it appealing to use an approach that dissuades doing stuff outside of make.

@jeffmendoza
Copy link
Contributor Author

I understand that using native go commands to build components is a goal of the project. I believe docker build is similar. There is not a Makefile in each directory to just simply type make. A developer unfamiliar with the project and our particular make target naming scheme would simply try to build the docker image as I described.

@ldemailly
Copy link
Member

conclusion ?

@jeffmendoza
Copy link
Contributor Author

@mattdelco Let me know what you want. I'd like to leave it as-is, to allow easy dashboard adding without editing Makefiles. If the directory copy is not ok, I'll move the dashboards up a dir, and make it a flat directory structure.

@mattdelco
Copy link
Contributor

I can live with things either way--just don't create a doc that suggests that people run "docker build" directly. The last I'd heard was that go devs could run "go build" to satisfy the particular needs of themselves, tools, or IDEs, but anything else should be handled via make.

@ldemailly
Copy link
Member

For a fun different perspective, we do use Dockerfile to build in some places, for instance https://github.com/istio/fortio/blob/master/Dockerfile
is what docker swarm auto builds and auto pushes to docker for git tagged releases
and even run tests etc
https://github.com/istio/fortio/blob/master/docker-compose.test.yml
but that setup predates istio's switch from bazel and fortio does have Makefile too to drive most steps and fortio's build is a lot simpler/straightforward than istio's (and I guess inside istio/istio we probably should try to be consistent)

but shall we / l g t m as is or not ?

@jeffmendoza
Copy link
Contributor Author

Multi-stage builds for Docker images are really nice.

@jeffmendoza
Copy link
Contributor Author

jeffmendoza commented Feb 21, 2018

just don't create a doc that suggests that people run "docker build" directly

Sgtm

@ldemailly
Copy link
Member

Multi-stage builds for Docker images are really nice.

thanks ! there is even a third stage as the binary is later extracted in realease/ to make the linux binary tgz release

/lgtm

@istio-merge-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ldemailly

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit f19c420 into istio:master Feb 21, 2018
@istio-testing
Copy link
Collaborator

@jeffmendoza: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/istio-pilot-e2e.sh 9cf74a1 link /test istio-pilot-e2e

Instructions 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.

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

Successfully merging this pull request may close these issues.

7 participants