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

Overhaul of top-level .md files #15802

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

jtattermusch
Copy link
Contributor

restructure top-level README.md, INSTALL.md

  • make "how to use grpc" instructions more accessible, simplify top-level README.md
  • differentiate between the "use grpc as a dependency" and "develop grpc" workflows
  • explicitly mention possible build systems for C++, add basic bazel info, improve cmake docs
  • remove some no-longer-useful info
  • move the "gRPC concepts" info to a separate doc
  • fix a number of nits in the documentation (broken links, out-of-date items...)

I'm planning to make a few more changes in a followup PR (improvements for contributing.md, test out the prerequisites list, ...)

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@jtattermusch
Copy link
Contributor Author

@carl-mastrangelo @hcaseyal @srini100 you all have recently dealt with c-core repo as newcomers. Comments are welcome!

@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

CONCEPTS.md Outdated
## Interface


Developers using gRPC typically start with the description of an RPC service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: run on sentence. Would you consider:

Developers using gRPC start with the description of an RPC service (a collection of methods), and generate client and server side interfaces. The server implements the service interface, which can be remotely invoked by the client interface.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for carl's suggestion. Although I'd say to add the "typically" back in if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

CONCEPTS.md Outdated
### Surface API
Starting from an interface definition in a .proto file, gRPC provides
Protocol Compiler plugins that generate Client- and Server-side APIs.
gRPC users typically call into these APIs on the Client side and implement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would make these statements stronger, and thus avoid words like "typically". While technically correct, I would claim that a reader of this page is looking to be told what to do. Once they are more comfortable with gRPC they can branch out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

CONCEPTS.md Outdated
fleshing out the details of each of the required operations.

## Abstract gRPC protocol
A gRPC RPC comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You used gRPC Call above, and gRPC RPC here. I prefer the former, but I think being consistent is more important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

CONCEPTS.md Outdated
The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers).

## Flow Control
gRPC inherits the flow control mechanisms in HTTP/2 and uses them to enable fine-grained control of the amount of memory used for buffering in-flight messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run on sentence. Perhaps:

gRPC uses the flow control mechanism in HTTP/2. This enables fine-grained control of memory used for buffering in-flight messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

===================================

gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. It enables client and server applications to communicate transparently, and makes it easier to build connected systems.

<table>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: I believe markdown supports tables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving as is, this snippet is copied from grpc-java repo: https://raw.githubusercontent.com/grpc/grpc-java/master/README.md

README.md Outdated

You can find per-language quickstart guides and tutorials in [Documentation section on grpc.io website](https://grpc.io/docs/). The code examples are available in the [examples](examples) directory.

# To start developing gRPC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should be in CONTRIBUTING.md right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the info to CONTRIBUTING.md

README.md Outdated
First of all, please refer to the documentation under the `src/YOUR_LANGUAGE` directory for any language-specific instructions on how to build and how to setup your
development environment.

Different languages use different build systems. To hide the complexity of needing to build with many different build systems, we provide a portable python script that unifies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: avoid first-person, unless it's done consistently. I, we, us, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

README.md Outdated
instructions
- Run
```
python tools/run_tests/run_tests.py -l YOUR_LANGUAGE --build_only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs several dependencies no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I was able to use the run_tests.py script for building on a fresh GCE instance (Debian 9) without installing any extra python module (we recently removed the implicit dependency on google-api-client-python).
But I agree in general, let's check if any more dependencies are needed and add them to the docs - I was planning to do one more pass once restructuring the .md files is done.

- via cmake's `ExternalProject_Add` using a technique called "superbuild". [Example](../../examples/cpp/helloworld/cmake_externalproject/CMakeLists.txt)
- add gRPC source tree to your project (preferrably as a git submodule) and add it to your cmake project with `add_subdirectory`. [Example](../../examples/cpp/helloworld/CMakeLists.txt)

## bazel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If bazel is recommended, it should be on the top.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@hcaseyal hcaseyal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted some preliminary comments, but I will be reviewing the rest of the docs in the near future. Hope they're helpful!

BUILDING.md Outdated
From the grpc repository root
```sh
$ make
# WARNING: make doesn't provide an easy way to uninstall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some context for this warning? If I were someone new to grpc, I may not know why I should be concerned that "make doesn't provide an easy way to uninstall." Is this a situation where if a user needs to be able to easily uninstall grpc, they should use bazel instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up q; I thought we do support make uninstall, is that not a sufficient uninstall? Might be work clarifying, because this comment, as is, is a little scary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make uninstall doesn't exist (and to be honest it would be pretty hard to implement, the right solution for uninstalling is to rely on a build system / package manager that has proper support for installing/uninstalling dependencies - I'm hoping we will get there soon).

I agree that more careful wording (and more detailed explanation) would be necessary for the warning. For now, I removed the comment and also the make install line as this document is about how to build (more info on installation is in src/cpp/README.md)


# Build from source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide a brief introduction here that explains why these different build options exist? E.g., when would someone use make vs. bazel? Can bazel be used on all systems? I could envision a new user being confused about which of these options they should choose (or if they need to run a subset of these options).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this would be useful. For now, I provided some basic info about why we support multiple build systems, we can elaborate on this in a followup PR (please see my general comment about merging this PR and iterating).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intro you provided is sufficient 👍 There is a typo though (should be "would work for all...")

CONCEPTS.md Outdated
## Interface


Developers using gRPC typically start with the description of an RPC service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for carl's suggestion. Although I'd say to add the "typically" back in if necessary.

CONCEPTS.md Outdated
and the structure of the payload messages. It is possible to use other
alternatives if desired.

### Surface API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I were someone completely new to grpc, I'd have no idea why this section is titled "Surface API." I'd ask, "What is the non-surface API? What is surface?" I'd probably understand eventually, but providing a clearer indication of what is meant by "surface api" would be great. E.g., Surface API (Client- and Server-side APIs).

Looking at this more, I think the problem is in the structure of the topic sentence below. Although the title of this section introduces a potentially new concept, Surface API, the topic sentence begins with other new concepts, and it's not immediately clear how it relates to surface API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the section title, sg?

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



1 similar comment
@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

1 similar comment
@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

1 similar comment
@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

Copy link
Contributor

@ncteisen ncteisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome

BUILDING.md Outdated
From the grpc repository root
```sh
$ make
# WARNING: make doesn't provide an easy way to uninstall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up q; I thought we do support make uninstall, is that not a sufficient uninstall? Might be work clarifying, because this comment, as is, is a little scary

> powershell git clone --recursive -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc
> cd grpc
> @rem To update submodules at later time, run "git submodule update --init"
bazel build :all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to our doc or a bazel doc on how to get this dependency?

Copy link
Contributor Author

@jtattermusch jtattermusch Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg, let's do this in a followup PR? (see my comment #15802 (comment))


## Interface

Developers using gRPC start with the description of an RPC service (a collection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. start with a language agnostic description of an RPC service ...

## Interface

Developers using gRPC start with the description of an RPC service (a collection
of methods), and generate client and server side interfaces. The server implements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... methods). From this description, gRPC will generate client and server side interfaces in any of our supported languages. The server...


gRPC supports streaming semantics, where either the client or the server (or both)
send a stream of messages on a single RPC call. The most general case is
Bidirectional Streaming where a single gRPC call establishes a stream where both
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitl change the second where to in which

clients and servers. A concrete embedding over HTTP/2 completes the picture by
fleshing out the details of each of the required operations.

## Abstract gRPC protocol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point this needs its own doc with the same level of detail that PROTOCOL-HTTP2 has...


## Implementation over HTTP/2
The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth mentioning the http web protocol here?

@@ -1,24 +1,79 @@
[gRPC - An RPC library and framework](http://github.com/grpc/grpc)
gRPC - An RPC library and framework
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; I think it would look better if we capitalized the L and F

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



1 similar comment
@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

1 similar comment
@grpc-testing
Copy link

[trickle] No significant performance differences

@jtattermusch
Copy link
Contributor Author

jtattermusch commented Jun 20, 2018

Thanks everyone for great comments! I think all of the comments are very useful and I definitely plan to incorporate them, but my worries is that this PR is getting very bloated and the comment thread will be super long.
Here's my suggestion:

  • let's focus on the overall structure and layout of the docs in this PR. My goal in this PR was to make the important info more visible (e.g. bringing the "how to use" to the front page), get rid of duplication and get to a logical structure that will be easier to maintain / update in the future.
  • Let's leave wording / non-structural suggestions for follow-up PR. Many of the docs being updated in this PR (like CONCEPTS.md) are just moving a pre-existing text to a different location, but the comments on that text (that was there before without anyone noticing) seem to be piling up. I think it would be good to first agree on the general structure first and then address smaller items in individual .md files later.

Can we get this PR reviewed (and merged) quickly and then continue improving individual .md files separately? That will lead to smaller PRs and better overall productivity IMHO. We will also be able to split the work among more people if we wanted to.
I believe this PR is currently in relatively good shape - it adds some new useful info and almost certainly doesn't make things worse. Let's get it merged and iterate?

@carl-mastrangelo @hcaseyal @ncteisen

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

2 similar comments
@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@carl-mastrangelo
Copy link
Contributor

@jtattermusch SGTM

Also LGTM.

@jtattermusch
Copy link
Contributor Author

I squashed the commits and I'm going to merge as soon as the required tests pass.

Remaining comments will be addresses in followup PRs.

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

Copy link
Contributor

@hcaseyal hcaseyal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Left a few more wording suggestions and nits that can be addressed in the other PR


# Build from source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intro you provided is sufficient 👍 There is a typo though (should be "would work for all...")

script that unifies the experience of building and testing gRPC in different
languages and on different platforms is provided.

To build gRPC in the language of choice (e.g. `c++`, `csharp`, `php`, `python`, `ruby`, ...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add colon at the end of this line

languages and on different platforms is provided.

To build gRPC in the language of choice (e.g. `c++`, `csharp`, `php`, `python`, `ruby`, ...)
- Prepare you development environment based on language-specific instructions in `src/YOUR-LANGUAGE` directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"you" should be "your"

To build gRPC in the language of choice (e.g. `c++`, `csharp`, `php`, `python`, `ruby`, ...)
- Prepare you development environment based on language-specific instructions in `src/YOUR-LANGUAGE` directory.
- The language-specific instructions might involve installing C/C++ prerequisites listed in
[Building gRPC C++: Prerequisites](BUILDING.md#pre-requisites) as gRPC implementations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence takes a couple of reads to parse. I would break it up: "The language-specific instructions might involve installing C/C++ prerequisites listed in Building gRPC C++: Prerequisites. This is because gRPC implementations in this repository are using the native gRPC "core" library internally."

```

You can also run `python tools/run_tests/run_tests.py --help` to discover useful command line flags supported. For more details,
see [tools/run_tests](tools/run_tests) where you will also find guidance on how to run various other test suites (e.g. interop tests, benchmarks)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Period missing at the end of this sentence.

@jtattermusch jtattermusch added the release notes: no Indicates if PR should not be in release notes label Jul 19, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release notes: no Indicates if PR should not be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants