commit | 2bae2cdba603fec1e9620b6c17d99deaddb800ec | [log] [tgz] |
---|---|---|
author | Adam Antal <adam.antal@cloudera.com> | Thu May 21 17:58:21 2020 +0200 |
committer | GitHub <noreply@github.com> | Thu May 21 08:58:21 2020 -0700 |
tree | b42d797227ab57ce6f313e6d8aa65ad7c88ff0e9 | |
parent | bfa065708642240de9b80bae55a979baad1ce870 [diff] |
[YUNIKORN-135] Move the scheduler-interface related constants from th… (#15) * define common constants in the scheduler-interface and generate constants in the pkg/common package.
Yunikorn Scheduler Interface defines protobuf interfaces for the communication between the yunikorn-core and the resource management systems.
For detailed information on the components and how to build the overall scheduler please see the yunikorn-core.
The interface has two parts:
Both interfaces are build from the same source.
The source and documentation are included in one file the scheduler-interface-spec
The protocol definition is extracted from the documentation by the build. The extracted protocol definition and the source code generated from the definition are part of the repository but should not be modified directly.
The interface is defined in the specification as blocks of type protobuf
as follows:
```protobuf defintion following the protobuf specifications ```
The blocks of definitions are extracted from the specification file and added together to form the protobuf input. The definitions cannot have lines exceeding 200 characters.
The output of this build is required to build the scheduler and the shims for the resource manager(s). However to allow building those projects against a predefined interface and without the requirement of generating the interface artifacts in each build the generated artifacts are part of the repository for direct use.
The dependent projects can use the interface by importing github.com/apache/incubator-yunikorn-scheduler-interface/lib/go/si as part of the code:
package example
import "github.com/apache/incubator-yunikorn-scheduler-interface/lib/go/si"
To be added: currently only the go source code artifact is generated.
The scheduler interface is used by all other components of yunikorn. For building the scheduler and its shims please check the instructions in the How to build section in the yunikorn-core repository.
The build process will download and install all required tools to build the artifact. Building the interface should only be required if the interface has been modified.
Prerequisite:
Steps:
make
to build.Including the modified interface in other components without updating the repository is possible by replacing the artifact checked out from the repository with the newly generated artifact. The exact procedure depends on the language the component is written in.
See how to contribute code from this guide.