Skip to content

Commit

Permalink
Replayed commit history.
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorDoyle committed Aug 31, 2016
2 parents 86c20e6 + d5a9c62 commit 570d1ae
Show file tree
Hide file tree
Showing 18 changed files with 1,303 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node-feature-discovery
node-feature-discovery-job.json
vendor/
intel-cmt-cat/
rdt-discovery/l2-alloc-discovery
rdt-discovery/l3-alloc-discovery
rdt-discovery/mon-discovery
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sudo: required

services:
- docker

script:
- docker build -t intelsdi/dbi-iafeature-discovery .
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.6

ADD . /go/src/github.com/kubernetes-incubator/node-feature-discovery

WORKDIR /go/src/github.com/kubernetes-incubator/node-feature-discovery

RUN git clone --depth 1 https://github.com/01org/intel-cmt-cat.git
RUN cd intel-cmt-cat/lib; make install
RUN cd rdt-discovery; make
RUN go get github.com/Masterminds/glide
RUN glide install
RUN go install \
-ldflags "-s -w -X main.version=`git describe --tags --dirty --always`" \
github.com/kubernetes-incubator/node-feature-discovery

ENTRYPOINT ["/go/bin/node-feature-discovery"]
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: all

DOCKER_REGISTRY_USER := kubernetesincubator
DOCKER_IMAGE_NAME := node-feature-discovery

VERSION := $(shell git describe --tags --dirty --always)

all: docker

# To override DOCKER_REGISTRY_USER use the -e option as follows:
# DOCKER_REGISTRY_USER=<my-username> make docker -e
docker:
docker build -t $(DOCKER_REGISTRY_USER)/$(DOCKER_IMAGE_NAME):$(VERSION) ./
147 changes: 145 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Node feature discovery for [Kubernetes](https://kubernetes.io)

- [Overview](#overview)
- [Command line interface](#command-line-interface)
- [Feature discovery](#feature-discovery)
- [Feature sources](#feature-sources)
- [Feature labels](#feature-labels)
- [Getting started](#getting-started)
- [System requirements](#system-requirements)
- [Usage](#usage)
- [Building from source](#building-from-source)
- [Targeting nodes with specific features](#targeting-nodes-with-specific-features)
- [References](#references)
- [License](#license)

## Overview
Expand All @@ -9,8 +19,29 @@ This software enables node feature discovery for Kubernetes. It detects
hardware features available on each node in a Kubernetes cluster, and advertises
those features using node labels.

## Command line interface

```
node-feature-discovery.
Usage:
node-feature-discovery [--no-publish --sources=<sources>]
node-feature-discovery -h | --help
node-feature-discovery --version
Options:
-h --help Show this screen.
--version Output version and exit.
--sources=<sources> Comma separated list of feature sources. [Default: cpuid,rdt,pstate]
--no-publish Do not publish discovered features to the cluster-local Kubernetes API server.
```

## Feature discovery

### Feature sources

The current set of feature sources are the following:

- [CPUID][cpuid] for x86 CPU details
- [Intel Resource Director Technology][intel-rdt]
- [Intel P-State driver][intel-pstate]
Expand All @@ -31,14 +62,120 @@ the only label value published for features is the string `"true"`._

```json
{
"node.alpha.intel.com/dbi-iafeature-discovery.version": "v0.1.0",
"node.alpha.intel.com/node-feature-discovery.version": "v0.1.0",
"node.alpha.intel.com/v0.1.0-cpuid-<feature-name>": "true",
"node.alpha.intel.com/v0.1.0-rdt-<feature-name>": "true",
"node.alpha.intel.com/v0.1.0-pstate-<feature-name>": "true"
}
```

### References
The `--sources` flag controls which sources to use for discovery.

### Intel Resource Director Technology (RDT) Features

| Feature name | Description |
| :------------: | :---------------------------------------------------------------------------------: |
| RDTMON | Intel Cache Monitoring Technology (CMT) and Intel Memory Bandwidth Monitoring (MBM)
| RDTL3CA | Intel L3 Cache Allocation Technology
| RDTL2CA | Intel L2 Cache Allocation Technology

### CPUID Features (Partial List)

| Feature name | Description |
| :------------: | :----------------------------------------------------------: |
| ADX | Multi-Precision Add-Carry Instruction Extensions (ADX)
| AESNI | Advanced Encryption Standard (AES) New Instructions (AES-NI)
| AVX | Advanced Vector Extensions (AVX)
| AVX2 | Advanced Vector Extensions 2 (AVX2)
| BMI1 | Bit Manipulation Instruction Set 1 (BMI)
| BMI2 | Bit Manipulation Instruction Set 2 (BMI2)
| SSE4.1 | Streaming SIMD Extensions 4.1 (SSE4.1)
| SSE4.2 | Streaming SIMD Extensions 4.2 (SSE4.2)
| SGX | Software Guard Extensions (SGX)

### System Requirements

1. Linux (x86_64)
1. [kubectl] [kubectl-setup] (properly set up and configured to work with your
Kubernetes cluster)
1. [Docker] [docker-down] (only required to build and push docker images)

### Usage

Feature discovery is done as a one-shot job. There is an example script in this
repo that demonstrates how to deploy the job to unlabeled nodes.

```
./label-nodes.sh
```

The discovery script will launch a job on each each unlabeled node in the
cluster. When the job runs, it contacts the Kubernetes API server to add labels
to the node to advertise hardware features (initially, from `cpuid` and RDT).

## Building from source

Download the source code.

```
git clone https://github.com/kubernetes-incubator/node-feature-discovery
```

**Build the Docker image:**

```
cd <project-root>
make
```

**NOTE: To override the `DOCKER_REGISTRY_USER` use the `-e` option as follows:
`DOCKER_REGISTRY_USER=<my-username> make docker -e`**

Push the Docker Image (optional)

```
docker push <registry-user>/<image-name>:<version>
```

**Change the job spec to use your custom image (optional):**

To use your published image from the step above instead of the
`kubernetesincubator/node-feature-discovery` image, edit line 40 in the file
[node-feature-discovery-job.json.template](node-feature-discovery-job.json.template)
to the new location (`<registry-user>/<image-name>[:<version>]`).

## Targeting Nodes with Specific Features

Nodes with specific features can be targeted using the `nodeSelector` field. The
following example shows how to target nodes with Intel TurboBoost enabled.

```json
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"labels": {
"env": "test"
},
"name": "golang-test"
},
"spec": {
"containers": [
{
"image": "golang",
"name": "go1",
}
],
"nodeSelector": {
"node.alpha.intel.com/v0.1.0-pstate-turbo": "true"
}
}
}
```

For more details on targeting nodes, see [node selection][node-sel].

## References

Github issues

Expand All @@ -48,6 +185,7 @@ Github issues

[Design proposal](https://docs.google.com/document/d/1uulT2AjqXjc_pLtDu0Kw9WyvvXm-WAZZaSiUziKsr68/edit)


## License

This is open source software released under the [Apache 2.0 License](LICENSE).
Expand All @@ -56,3 +194,8 @@ This is open source software released under the [Apache 2.0 License](LICENSE).
[cpuid]: http://man7.org/linux/man-pages/man4/cpuid.4.html
[intel-rdt]: http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html
[intel-pstate]: https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt
[docker-down]: https://docs.docker.com/engine/installation
[golang-down]: https://golang.org/dl
[gcc-down]: https://gcc.gnu.org
[kubectl-setup]: https://coreos.com/kubernetes/docs/latest/configure-kubectl.html
[node-sel]: http://kubernetes.io/docs/user-guide/node-selection
Loading

0 comments on commit 570d1ae

Please sign in to comment.