{"id":18755817,"url":"https://github.com/kasperskylab/grpc-kos","last_synced_at":"2025-09-01T13:31:57.074Z","repository":{"id":107847667,"uuid":"590497956","full_name":"KasperskyLab/grpc-kos","owner":"KasperskyLab","description":"Shared C [core library], C++, Ruby, Python, PHP, C# (core library based), Objective-C","archived":false,"fork":false,"pushed_at":"2024-12-03T08:18:45.000Z","size":280234,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-03T08:33:40.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KasperskyLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-18T14:56:41.000Z","updated_at":"2024-12-03T08:05:03.000Z","dependencies_parsed_at":"2023-07-11T11:02:24.183Z","dependency_job_id":null,"html_url":"https://github.com/KasperskyLab/grpc-kos","commit_stats":null,"previous_names":[],"tags_count":262,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KasperskyLab%2Fgrpc-kos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KasperskyLab%2Fgrpc-kos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KasperskyLab%2Fgrpc-kos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KasperskyLab%2Fgrpc-kos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KasperskyLab","download_url":"https://codeload.github.com/KasperskyLab/grpc-kos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231693382,"owners_count":18411894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T17:34:02.611Z","updated_at":"2025-09-01T13:31:57.064Z","avatar_url":"https://github.com/KasperskyLab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KasperskyOS modification of gRPC\n\ngRPC® (Google Remote Procedure Call) is a high-performance framework for developing distributed systems.\nIt uses HTTP/2 and [Protocol Buffers (Protobuf™)](https://github.com/google/protobuf) as the underlying\nprotocols for data exchange between clients and servers.\n\nThis project is an adaptation of gRPC for KasperskyOS. It is based on the original version of\n[grpc 1.48.0](https://github.com/grpc/grpc/tree/v1.48.0) and includes an example that demonstrates its\nuse in KasperskyOS.\n\nFor additional details on KasperskyOS, including its limitations and known issues, please refer to the\n[KasperskyOS Community Edition Online Help](https://click.kaspersky.com/?hl=en-us\u0026link=online_help\u0026pid=kos\u0026version=1.3\u0026customization=KCE\u0026helpid=community_edition).\n\n## Table of contents\n- [KasperskyOS modification of gRPC](#kasperskyos-modification-of-grpc)\n  - [Table of contents](#table-of-contents)\n  - [Overview](#overview)\n    - [Repository status](#repository-status)\n    - [Interface](#interface)\n    - [Surface API](#surface-api)\n      - [Synchronous vs. asynchronous](#synchronous-vs-asynchronous)\n  - [Streaming](#streaming)\n  - [Protocol](#protocol)\n    - [Abstract gRPC protocol](#abstract-grpc-protocol)\n    - [Implementation over HTTP/2](#implementation-over-http2)\n    - [Flow control](#flow-control)\n  - [Getting started](#getting-started)\n    - [Prerequisites](#prerequisites)\n    - [Building and installing](#building-and-installing)\n      - [Protoc compiler](#protoc-compiler)\n      - [Build gRPC for Linux host operation system](#build-grpc-for-linux-host-operation-system)\n      - [Build gRPC for KasperskyOS](#build-grpc-for-kasperskyos)\n      - [Tests](#tests)\n  - [Usage](#usage)\n- [Trademarks](#trademarks)\n- [Contributing](#contributing)\n- [Licensing](#licensing)\n\n## Overview\n\nRemote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services.\nThe libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2.\nThese libraries enable communication between clients and servers using any combination of the supported languages.\n\n### Repository status\n\nThis repository contains source code for gRPC libraries for multiple languages written on top of shared C core library\n[./src/core](src/core), but the KasperskyOS adaptation is realized only for C++.\n\n### Interface\n\nDevelopers using gRPC typically start with the description of an RPC service (a collection of methods),\nand generate client and server side interfaces which they use on the client-side and implement on the server side.\n\nBy default, gRPC uses Protocol Buffers as the gRPC Interface Definition Language (IDL) for describing both the service interface\nand the structure of the payload messages. It is possible to use other alternatives if desired.\n\n### Surface API\n\nStarting from an interface definition in a `*.proto` file, gRPC provides Protocol Compiler plugins that generate Client- and\nServer-side APIs. gRPC users typically call into these APIs on the Client side and implement the corresponding API on the server side.\n\n#### Synchronous vs. asynchronous\n\nSynchronous RPC calls, that block until a response arrives from the server,\nare the closest approximation to the abstraction of a procedure call that RPC aspires to.\n\nOn the other hand, networks are inherently asynchronous and in many scenarios,\nit is desirable to have the ability to start RPCs without blocking the current thread.\n\nThe gRPC programming surface in most languages comes in both synchronous and asynchronous flavors.\n\n[⬆ Back to Top](#table-of-contents)\n\n## Streaming\n\ngRPC supports streaming semantics, where either the client or the server (or both) sends a stream of messages on a single RPC call.\nThe most general case is Bidirectional Streaming where a single gRPC call establishes a stream where both the client and the server\ncan send a stream of messages to each other. The streamed messages are delivered in the order they were sent.\n\n## Protocol\n\nThe [gRPC protocol](doc/PROTOCOL-HTTP2.md) specifies the abstract requirements for communication between clients and servers.\nA concrete embedding over HTTP/2 completes the picture by fleshing out the details of each of the required operations.\n\n### Abstract gRPC protocol\n\nA gRPC comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction,\nthis stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`.\nThe server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated\nwith a mandatory `Status` and optional `Status-Metadata` (or `Trailing-Metadata`).\n\n### Implementation over HTTP/2\n\nThe abstract gRPC protocol is implemented over [HTTP/2](https://http2.github.io/).\ngRPC bidirectional streams are mapped to HTTP/2 streams.\nThe contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression.\n`Payload Messages` are serialized into a byte stream of length prefixed gRPC frames\nwhich are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver.\n`Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (or trailers).\n\n### Flow control\n\ngRPC inherits the flow control mechanisms in HTTP/2 and uses them\nto enable fine-grained control of the amount of memory used for buffering in-flight messages.\n\n[⬆ Back to Top](#table-of-contents)\n\n## Getting started\n\n### Prerequisites\n\n1. [Install](https://click.kaspersky.com/?hl=en-us\u0026link=online_help\u0026pid=kos\u0026version=1.3\u0026customization=KCE\u0026helpid=sdk_install_and_remove)\nKasperskyOS Community Edition SDK. You can download the latest version of the KasperskyOS Community Edition for free from\n[os.kaspersky.com](https://os.kaspersky.com/development/). The minimum required version of KasperskyOS Community Edition SDK is 1.3.\nFor more information, see [System requirements](https://click.kaspersky.com/?hl=en-us\u0026link=online_help\u0026pid=kos\u0026version=1.3\u0026customization=KCE\u0026helpid=system_requirements).\n2. Clone gRPC for KasperskyOS repository to your project directory (to reduce cloning time you can use `--depth 1` option):\n    ```sh\n     $ git clone --recurse-submodules --shallow-submodules https://github.com/KasperskyLab/grpc-kos.git\n    ```\n3. NTP is a networking protocol for clock synchronization between computer systems.\n   NTP is necessary to gRPC to ensure ssl-encrypted connections between server and client tasks located on different hardware.\n   When it is impossible to access external NTP services, it is recommended to run a local NTP service on the host.\n   The following step shows how to install the NTP server using `apt`:\n    ```sh\n     $ sudo apt install ntp\n    ```\n\n### Building and installing\n\ngRPC is built using the CMake build system, which is provided in the KasperskyOS Community Edition SDK.\nIn order to use gRPC for KasperskyOS and the host, it is necessary to install gRPC on both platforms.\nIt is recommended to use the same gRPC version for KasperskyOS and other platforms.\n\n#### Protoc compiler\n\nBy default, gRPC uses protocol buffers, you will need the `protoc` compiler to generate stub server and client code.\n\nIf you compile gRPC from source, the Makefile will automatically try to compile the `protoc` compiler from the\n[./third_party](third_party) directory. This will happen if you have recursively cloned the repository and it detects\nthat the `protoc` compiler has not installed on your system yet.\n\n#### Build gRPC for Linux host operation system\n\nThe gRPC is cross-compiled on the host where the KasperskyOS Community Edition SDK is installed.\nTo compile `*.proto` files and use gRPC plugins, it is necessary to first build and install gRPC for the host.\nThe `protoc` compiler (used to compile `*.proto` files) must be built with the host toolchain.\nThis is because the `protoc` will be run on the host when building solutions for KasperskyOS.\n\nTo build and install gRPC for the host, go to the `./kos` directory and execute the [`host-build.sh`](./kos/host-build.sh) script.\nThe environment variable `INSTALL_PREFIX` specifies the installation path of gRPC for the host.\nIf not specified, gRPC for the host will be installed in the `./install/host` directory.\n\nSyntax for using the `host-build.sh` script:\n```sh\n$ host-build.sh [-i INSTALL_PREFIX]\n```\nThe parameter `-i, --install-prefix INSTALL_PREFIX` specifies the installation path of gRPC for the host.\nThe value specified in this parameter takes precedence over the value of the `INSTALL_PREFIX` environment variable.\n\nBy default, the build type is set to `Debug`, the build libraries are static,\nand the build path is set to `./build/host`. To change this, edit the `host-build.sh` script as needed.\n\nFor example:\n```sh\n$ ./host-build.sh\n```\n\nYou also can build gRPC for corresponding host [manually](BUILDING.md).\n\n[⬆ Back to Top](#table-of-contents)\n\n#### Build gRPC for KasperskyOS\n\nTo build and install gRPC for KasperskyOS, go to the `./kos` directory and execute the [`cross-build.sh`](./kos/cross-build.sh) script.\nThere are environment variables that affect the build and installation of the libraries:\n\n* `SDK_PREFIX` specifies the path to the installed version of the KasperskyOS Community Edition SDK.\n* `INSTALL_PREFIX` specifies the installation path of gRPC for KasperskyOS.\nIf not specified, the libraries will be installed in the `./install/kos` directory.\n* `TARGET` specifies the target platform. If not specified, the platform will be determined automatically.\n\nSyntax for using the `cross-build.sh` script:\n\n`$ SDK_PREFIX=/opt/KasperskyOS-Community-Edition-\u003cversion\u003e [TARGET=\"aarch64-kos\"] ./cross-build.sh [-h] [-s PATH] [-i PATH] [-H PATH] [-j N]`,\n\nwhere:\n\n* `version`\n\n  Latest version number of the [KasperskyOS Community Edition SDK](https://os.kaspersky.com/development/).\n* `-h, --help`\n\n  Help text.\n* `-s, --sdk PATH`\n\n  Path to the installed version of the KasperskyOS Community Edition SDK.\nThe path must be set using either the value of the `SDK_PREFIX` environment variable or the `-s` option.\nThe value specified in the `-s` option takes precedence over the value of the `SDK_PREFIX` environment variable.\n* `-i, --install PATH`\n\n  Path to directory where gRPC for KasperskyOS will be installed. If not specified, the default path `./install/kos` will be used.\nThe value specified in the `-i` option takes precedence over the value of the `INSTALL_PREFIX` environment variable.\n* `-H, --host-install PATH`\n\n  Path to the directory where gRPC for the host is installed. If not specified, the default path `./install/host` will be used.\n* `-j, --jobs N`\n\n  Number of jobs for parallel build. If not specified, the default value is 1.\n\nBy default, the build type is set to `Debug`, the build libraries are static,\nand the build path is set to `./build/kos`. To change this, edit the `cross-build.sh` script as needed.\n\nFor CMake build system to find gRPC for KasperskyOS, make sure that the directory where the libraries were installed\nis listed in the `CMAKE_FIND_ROOT_PATH` environment variable.\n\nThe `cross-build.sh` script builds only runtime libraries.\nThe host `protoc` compiler and `gRPC plugin` are used to generate source files from `*.proto` files.\n\n[⬆ Back to Top](#table-of-contents)\n\n#### Tests\n\nThe C++ gRPC tests have been adapted to run on KasperskyOS.\nThe CMake files for building the tests are located in the [`./test/kos`](test/kos/cmake/) directory.\nThe tests have the following limitations:\n\n* Some tests are disabled. See the list at\n[./test/kos/cmake/grpc_cpp_disabled_tests.cmake](test/kos/cmake/grpc_cpp_disabled_tests.cmake).\n* Death tests not supported in KasperskyOS.\n* Some tests are skipped. See the list at [./test/kos/cmake/tests.cmake](test/kos/cmake/tests.cmake).\n* Flaky tests:\n  * `streaming_throughput_test`\n  * `async_end2end_test`\n  * `cli_call_test`\n  * `client_interceptors_end2end_test`\n  * `context_allocator_end2end_test`\n  * `delegating_channel_test`\n  * `google_c2p_resolver_test`\n  * `grpc_authz_end2end_test`\n  * `service_config_end2end_test`\n  * `shutdown_test`\n  * `xds_credentials_end2end_test`\n* C++ unit tests for KasperskyOS are currently available only for QEMU.\n\nTests use an out-of-source build. The build tree is situated in the generated `./build/kos_tests` directory.\nFor each test suite, a separate image will be created. As it can be taxing on disk space, the tests will run sequentially.\n\nTo build and run the tests, go to the `./kos` directory and execute the [`run-tests.sh`](./kos/run-tests.sh) script.\nThere are environment variables that affect the build and installation of the tests:\n\n* `SDK_PREFIX` specifies the path to the installed version of the KasperskyOS Community Edition SDK.\n* `TARGET` specifies the target platform. (Currently only the `aarch64-kos` platform is supported.)\n\nSyntax for using the `run-tests.sh` script:\n\n`$ SDK_PREFIX=/opt/KasperskyOS-Community-Edition-\u003cversion\u003e [TARGET=\"aarch64-kos\"] ./run-tests.sh [--help] [-s PATH] [--list] [-n TEST_1] ... [-n TEST_N] [-t SEC] [-o PATH] [-j N] [-H PATH]`,\n\nwhere:\n\n* `version`\n\n  Latest version number of the [KasperskyOS Community Edition SDK](https://os.kaspersky.com/development/).\n* `-h, --help`\n\n  Help text.\n* `-s, --sdk PATH`\n\n  Path to the installed version of the KasperskyOS Community Edition SDK.\nThe path must be set using either the value of the `SDK_PREFIX` environment variable or the `-s` option.\nThe value specified in the `-s` option takes precedence over the value of the `SDK_PREFIX` environment variable.\n* `-l, --list`\n\n  List of tests that can be run.\n* `-n, --name TEST`\n\n  Test name to execute. The parameter can be repeated multiple times.\nIf not specified, all tests will be executed.\n* `-t, --timeout SEC`\n\n  Time, in seconds, allotted to start and execute a single test case. Default value is 3000 seconds.\n* `-o, --out PATH`\n\n  Path where the results of the test run will be stored. If not specified, the results will be stored in the `./build/kos_tests/logs` directory.\n* `-j, --jobs N`\n\n  Number of jobs for parallel build. If not specified, the default value obtained from the `nproc` command is used.\n* `-H, --host-install PATH`\n\n  Path to the directory where gRPC for the host is installed. If not specified, the default path `./install/host` will be used.\n\n[⬆ Back to Top](#table-of-contents)\n\n## Usage\n\nWhen you develop a KasperskyOS-based solution, use the\n[recommended structure of project directories](https://click.kaspersky.com/?hl=en-us\u0026link=online_help\u0026pid=kos\u0026version=1.3\u0026customization=KCE\u0026helpid=cmake_using_sdk_cmake)\nto simplify usage of CMake scripts.\n\nFor more on using gRPC in KasperskyOS, see the [README.md](./examples/kos/helloworld/README.md) file for the project's example.\n\n# Trademarks\n\nRegistered trademarks and endpoint marks are the property of their respective owners.\n\ngRPC, Kubernetes are registered trademarks of The Linux Foundation in the United States and other countries.\n\nAndroid, Chromium, Closure, Dart, Firebase, GoogleTest, Google Go, Protobuf, TensorFlow are trademarks of Google LLC.\n\nLinux is the registered trademark of Linus Torvalds in the U.S. and other countries.\n\nRaspberry Pi is a trademark of the Raspberry Pi Foundation.\n\nAFS, AIX, IBM, s3 are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide.\n\nAMD is a trademark or a registered trademark of Advanced Micro Devices, Inc.\n\nF5 is a trademark of F5 Networks, Inc. in the U.S. and in certain other countries.\n\nFreeBSD is a registered trademark of The FreeBSD Foundation.\n\nMSDN, Microsoft, PowerShell, Visual C++, Visual Studio, Win32, Windows, Windows Server are trademarks of the Microsoft group of companies.\n\nMac, macOS, Mac OS, OS X, Objective-C, Rosetta, Xcode are trademarks of Apple Inc.\n\nFirefox, Mozilla are trademarks of the Mozilla Foundation in the U.S. and other countries.\n\nPentium, Intel are trademarks of Intel Corporation or its subsidiaries.\n\nPython is a trademark or registered trademark of the Python Software Foundation.\n\nFedora, Red Hat are trademarks or registered trademarks of Red Hat, Inc. or its subsidiaries in the United States and other countries.\n\nSymantec is a registered trademark of Symantec Corporation or its affiliates in the U.S. and other countries.\n\nUNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited.\n\nIOS is a registered trademark of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.\n\n# Contributing\n\nOnly KasperskyOS-specific changes can be approved. See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed instructions on code contribution.\n\n# Licensing\n\nThis project is licensed under the terms of the Apache License. See [LICENSE](LICENSE) for more information.\n\n[⬆ Back to Top](#table-of-contents)\n\n© 2025 AO Kaspersky Lab\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasperskylab%2Fgrpc-kos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkasperskylab%2Fgrpc-kos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasperskylab%2Fgrpc-kos/lists"}