-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing for https://github.com/turbonomic/data-ingestion-framework
- Loading branch information
Travis CI User
committed
Nov 22, 2024
0 parents
commit d79c260
Showing
3,332 changed files
with
1,205,209 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Turbonomic Data Ingestion Framework Community Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or | ||
advances of any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email | ||
address, without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series of actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within the community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, | ||
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. | ||
|
||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Contributing to Turbonomic Data Ingestion Framework | ||
|
||
Contributing to the Turbonomic Data Ingestion Framework is designed to be easy and most importantly, thank you for contributing!! This is the getting started guide and will adjust over time as we add more automated testing to the build and commit process. | ||
|
||
The Data Ingestion Framework is Apache 2.0 licensed and accepts contributions via GitHub. This document will cover how to contribute to the project and report issues. | ||
|
||
## Reporting Issues or Feature Requests | ||
|
||
Your contribution through issues is very beneficial to the project. We appreciate all reported issues or new requests. They come in a few different forms described below. Before opening a new issue, we appreciate you reviewing open issues to see if there are any similar requests. If there is a match, comment with a +1, "Also seeing this issue" or something like that. If any environment details differ, please add those with your comment to the matching issue. | ||
|
||
When **reporting an issue**, details are key. Include the following: | ||
- OS version | ||
- Environment details (virtual, physical, etc.) | ||
- Steps to reproduce | ||
- Expected results | ||
- Actual results | ||
|
||
When **requesting a feature**, context is key. Some of the questions we want to answer are: | ||
- What does this allow a user to do that they cannot do now? | ||
- What environment is this meant for (containerized, virtualized, bare metal)? | ||
- How urgent is the need (nice to have feature or need to have)? | ||
- Does this align with the goals of Lemur? | ||
|
||
When **submitting code through a pull request**: | ||
- Include deatails about the fix/feature/documentation update you are submitting | ||
- Seriously, it's that easy. Pull requests are greatly appreciated and we thank you for your help in guiding the Lemur project community |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
OUTPUT_DIR=./build | ||
SOURCE_DIRS=cmd pkg | ||
PACKAGES=go list ./... | grep -v /vendor | grep -v /out | ||
SHELL='/bin/bash' | ||
REMOTE=github.ibm.com | ||
USER=turbonomic | ||
PROJECT=data-ingestion-framework | ||
BINARY=turbodif | ||
DEFAULT_VERSION=latest | ||
TURBODIF_VERSION=8.14.4-SNAPSHOT | ||
REMOTE_URL=$(shell git config --get remote.origin.url) | ||
BRANCH=$(shell git rev-parse --abbrev-ref HEAD) | ||
REVISION=$(shell git show -s --format=%cd --date=format:'%Y%m%d%H%M%S000') | ||
|
||
|
||
.DEFAULT_GOAL:=build | ||
|
||
GIT_COMMIT=$(shell git rev-parse HEAD) | ||
BUILD_TIME=$(shell date -R) | ||
BUILD_TIMESTAMP=$(shell date +'%Y%m%d%H%M%S000') | ||
PROJECT_PATH=$(REMOTE)/$(USER)/$(PROJECT) | ||
VERSION=$(or $(TURBODIF_VERSION), $(DEFAULT_VERSION)) | ||
LDFLAGS='\ | ||
-X "$(PROJECT_PATH)/version.GitCommit=$(GIT_COMMIT)" \ | ||
-X "$(PROJECT_PATH)/version.BuildTime=$(BUILD_TIME)" \ | ||
-X "$(PROJECT_PATH)/version.Version=$(VERSION)"' | ||
|
||
|
||
LINUX_ARCH=amd64 arm64 ppc64le s390x | ||
|
||
$(LINUX_ARCH): clean | ||
env GOOS=linux GOARCH=$@ go build -ldflags $(LDFLAGS) -o $(OUTPUT_DIR)/linux/$@/$(BINARY) ./cmd | ||
|
||
product: $(LINUX_ARCH) | ||
|
||
debug-product: clean | ||
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -gcflags "-N -l" -o $(OUTPUT_DIR)/$(BINARY)_debug.linux ./cmd | ||
|
||
build: clean | ||
go build -ldflags $(LDFLAGS) -o $(OUTPUT_DIR)/$(BINARY) ./cmd | ||
|
||
buildInfo: | ||
$(shell test -f git.properties && rm -rf git.properties) | ||
@echo 'turbo-version.remote.origin.url=$(REMOTE_URL)' >> git.properties | ||
@echo 'turbo-version.commit.id=$(GIT_COMMIT)' >> git.properties | ||
@echo 'turbo-version.branch=$(BRANCH)' >> git.properties | ||
@echo 'turbo-version.branch.version=$(VERSION)' >> git.properties | ||
@echo 'turbo-version.commit.time=$(REVISION)' >> git.properties | ||
@echo 'turbo-version.build.time=$(BUILD_TIMESTAMP)' >> git.properties | ||
|
||
debug: clean | ||
go build -ldflags $(LDFLAGS) -gcflags "-N -l" -o $(OUTPUT_DIR)/$(BINARY).debug ./cmd | ||
|
||
docker: product | ||
DOCKER_BUILDKIT=1 docker build -f build/Dockerfile -t turbonomic/turbodif . | ||
|
||
test: clean | ||
@go test -v -race ./pkg/... | ||
|
||
.PHONY: fmtcheck | ||
fmtcheck: | ||
@gofmt -s -l $(SOURCE_DIRS) | grep ".*\.go"; if [ "$$?" = "0" ]; then exit 1; fi | ||
|
||
.PHONY: vet | ||
vet: | ||
@go vet $(shell $(PACKAGES)) | ||
|
||
clean: | ||
@rm -rf $(OUTPUT_DIR)/$(BINARY)* ${OUTPUT_DIR}/linux | ||
|
||
|
||
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le | ||
REPO_NAME ?= icr.io/cpopen/turbonomic | ||
multi-archs: | ||
env GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o $(OUTPUT_DIR)/$(BINARY) ./cmd | ||
.PHONY: docker-buildx | ||
docker-buildx: | ||
docker buildx create --name turbodif-builder | ||
- docker buildx use turbodif-builder | ||
- docker buildx build --platform=$(PLATFORMS) --label "git-commit=$(GIT_COMMIT)" --label "git-version=$(VERSION)" --provenance=false --push --tag $(REPO_NAME)/turbodif:$(VERSION) -f build/Dockerfile.multi-archs --build-arg VERSION=$(VERSION) . | ||
docker buildx rm turbodif-builder | ||
|
||
check-upstream-dependencies: | ||
./hack/check_upstream_dependencies.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Data Ingestion Framework: Open Framework for Turbonomic Platform | ||
|
||
## Overview | ||
The Data Ingestion Framework (DIF) is a framework that allows Turbonomic to collect external metrics from customer and leverages [Turbonomic](https://www.ibm.com/products/turbonomic)'s patented analysis engine to provide visibility and control across the entire application stack in order to assure the performance, efficiency and compliance in real time. | ||
|
||
## Documentation | ||
Read the official documentation [HERE](https://www.ibm.com/docs/en/tarm/latest?topic=documentation-integration-data-ingestion-framework). | ||
|
||
## How DIF works | ||
The custom entities and entity metrics are declared in a predefined JSON format. The DIF probe takes the JSON input and convert them into the data structures known by Turbonomic, and push them to the server. The DIF probe is a generic Turbonomic SDK probe that performs all the usual supply chain and entity validations, as well as participating in the broader mediation framework to ensure all conflicts are resolved, and consistency is maintained. | ||
![image](https://user-images.githubusercontent.com/10012486/88306380-a6b36b80-ccd8-11ea-9236-063577d60430.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM registry.access.redhat.com/ubi9-minimal | ||
MAINTAINER Turbonomic <[email protected]> | ||
ARG TARGETPLATFORM | ||
|
||
# Required OpenShift Labels | ||
LABEL name="Turbodif Container" \ | ||
vendor="Turbonomic" \ | ||
version="v8.0.0" \ | ||
release="1" \ | ||
summary="Performance assurance for the applications in Openshift" \ | ||
description="Hybrid Cloud Container leverages Turbonomic control platform, to assure the performance of micro-services running in OpenShift, as well as the efficiency of underlying infrastructure." \ | ||
### Required labels above - recommended below | ||
url="https://www.turbonomic.com" \ | ||
io.k8s.description="Turbonomic Workload Automation Platform simultaneously optimizes performance, compliance, and cost in real-time. Workloads are precisely resourced, automatically, to perform while satisfying business constraints. " \ | ||
io.k8s.display-name="Turbodif Operator" \ | ||
io.openshift.expose-services="" \ | ||
io.openshift.tags="turbonomic, Multicloud Container" | ||
|
||
RUN microdnf update --nodocs --assumeyes | ||
|
||
### add licenses to this directory | ||
COPY licenses /licenses | ||
|
||
COPY build/Dockerfile /Dockerfile | ||
|
||
### Setup user for build execution and application runtime | ||
ENV APP_ROOT=/opt/turbonomic | ||
ENV PATH=$PATH:${APP_ROOT}/bin | ||
|
||
RUN mkdir -p ${APP_ROOT}/bin | ||
RUN mkdir -p ${APP_ROOT}/conf | ||
COPY build/${TARGETPLATFORM}/turbodif ${APP_ROOT}/bin/turbodif | ||
COPY configs/app-supply-chain-config.yaml ${APP_ROOT}/conf/app-supply-chain-config.yaml | ||
RUN chmod -R ug+x ${APP_ROOT}/bin && sync && \ | ||
chmod -R g=u ${APP_ROOT} | ||
|
||
####### Add app-specific needs below. ####### | ||
USER 10001 | ||
WORKDIR ${APP_ROOT} | ||
ENTRYPOINT ["/opt/turbonomic/bin/turbodif"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Building base image | ||
FROM --platform=$BUILDPLATFORM golang:1.21 AS builder | ||
ARG VERSION TARGETOS TARGETARCH | ||
ENV TURBODIF_VERSION $VERSION | ||
WORKDIR /workspace | ||
ADD . ./ | ||
RUN make multi-archs | ||
|
||
FROM registry.access.redhat.com/ubi9-minimal | ||
ARG TARGETPLATFORM | ||
|
||
# Required OpenShift Labels | ||
LABEL name="Turbodif Container" \ | ||
vendor="Turbonomic" \ | ||
version="v8.0.0" \ | ||
release="1" \ | ||
summary="Performance assurance for the applications in Openshift" \ | ||
description="Hybrid Cloud Container leverages Turbonomic control platform, to assure the performance of micro-services running in OpenShift, as well as the efficiency of underlying infrastructure." \ | ||
### Required labels above - recommended below | ||
url="https://www.turbonomic.com" \ | ||
io.k8s.description="Turbonomic Workload Automation Platform simultaneously optimizes performance, compliance, and cost in real-time. Workloads are precisely resourced, automatically, to perform while satisfying business constraints. " \ | ||
io.k8s.display-name="Turbodif Operator" \ | ||
io.openshift.expose-services="" \ | ||
io.openshift.tags="turbonomic, Multicloud Container" | ||
|
||
RUN microdnf update -y krb5-libs | ||
|
||
### add licenses to this directory | ||
COPY licenses /licenses | ||
|
||
COPY build/Dockerfile /Dockerfile | ||
|
||
### Setup user for build execution and application runtime | ||
ENV APP_ROOT=/opt/turbonomic | ||
ENV PATH=$PATH:${APP_ROOT}/bin | ||
|
||
RUN mkdir -p ${APP_ROOT}/bin | ||
RUN mkdir -p ${APP_ROOT}/conf | ||
COPY --from=builder /workspace/build/turbodif ${APP_ROOT}/bin/turbodif | ||
COPY configs/app-supply-chain-config.yaml ${APP_ROOT}/conf/app-supply-chain-config.yaml | ||
RUN chmod -R ug+x ${APP_ROOT}/bin && sync && \ | ||
chmod -R g=u ${APP_ROOT} | ||
|
||
####### Add app-specific needs below. ####### | ||
USER 10001 | ||
WORKDIR ${APP_ROOT} | ||
ENTRYPOINT ["/opt/turbonomic/bin/turbodif"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"strconv" | ||
"time" | ||
|
||
"github.com/davecgh/go-spew/spew" | ||
"github.com/fsnotify/fsnotify" | ||
"github.com/golang/glog" | ||
"github.ibm.com/turbonomic/data-ingestion-framework/pkg" | ||
"github.ibm.com/turbonomic/data-ingestion-framework/pkg/conf" | ||
"github.ibm.com/turbonomic/data-ingestion-framework/version" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
func main() { | ||
|
||
// Ignore errors | ||
_ = flag.Set("logtostderr", "false") | ||
_ = flag.Set("alsologtostderr", "true") | ||
_ = flag.Set("log_dir", "/var/log") | ||
defer glog.Flush() | ||
|
||
// Config pretty print for debugging | ||
spew.Config = spew.ConfigState{ | ||
Indent: " ", | ||
MaxDepth: 0, | ||
DisableMethods: true, | ||
DisablePointerMethods: true, | ||
ContinueOnMethod: false, | ||
SortKeys: true, | ||
SpewKeys: false, | ||
} | ||
|
||
// Set up arguments specific to DIF | ||
args := conf.NewDIFProbeArgs() | ||
// Parse the flags | ||
flag.Parse() | ||
|
||
// Watch the configmap and detect the change on it | ||
go WatchConfigMap() | ||
|
||
// Print out critical information | ||
glog.Infof("Running turbodif VERSION: %s, GIT_COMMIT: %s, BUILD_TIME: %s", | ||
version.Version, version.GitCommit, version.BuildTime) | ||
glog.Infof("IgnoreIfPresent is set to %v for all commodities.", *args.IgnoreCommodityIfPresent) | ||
|
||
s, err := pkg.NewDIFTAPService(args) | ||
if err != nil { | ||
glog.Fatalf("Failed to run turbodif: %v", err) | ||
} | ||
|
||
s.Start() | ||
|
||
return | ||
} | ||
|
||
func WatchConfigMap() { | ||
//Check if the /etc/turbodif/turbo-autoreload.config exists | ||
autoReloadConfigFilePath := "/etc/turbodif" | ||
autoReloadConfigFileName := "turbo-autoreload.config" | ||
|
||
viper.AddConfigPath(autoReloadConfigFilePath) | ||
viper.SetConfigType("json") | ||
viper.SetConfigName(autoReloadConfigFileName) | ||
for { | ||
verr := viper.ReadInConfig() | ||
if verr == nil { | ||
break | ||
} else { | ||
glog.V(4).Infof("Can't read the autoreload config file %s/%s due to the error: %v, will retry in 3 seconds", autoReloadConfigFilePath, autoReloadConfigFileName, verr) | ||
time.Sleep(30 * time.Second) | ||
} | ||
} | ||
|
||
glog.V(1).Infof("Start watching the autoreload config file %s/%s", autoReloadConfigFilePath, autoReloadConfigFileName) | ||
updateConfig := func() { | ||
newLoggingLevel := viper.GetString("logging.level") | ||
currentLoggingLevel := flag.Lookup("v").Value.String() | ||
if newLoggingLevel != currentLoggingLevel { | ||
if newLogVInt, err := strconv.Atoi(newLoggingLevel); err != nil || newLogVInt < 0 { | ||
glog.Errorf("Invalid log verbosity %v in the autoreload config file", newLoggingLevel) | ||
} else { | ||
err := flag.Lookup("v").Value.Set(newLoggingLevel) | ||
if err != nil { | ||
glog.Errorf("Can't apply the new logging level setting due to the error:%v", err) | ||
} else { | ||
glog.V(1).Infof("Logging level is changed from %v to %v", currentLoggingLevel, newLoggingLevel) | ||
} | ||
} | ||
} | ||
} | ||
updateConfig() //update the logging level during startup | ||
viper.OnConfigChange(func(in fsnotify.Event) { | ||
updateConfig() | ||
}) | ||
|
||
viper.WatchConfig() | ||
} |
Oops, something went wrong.