Skip to content

Commit

Permalink
UPSTREAM: <carry>: configure repository for OpenShift releases
Browse files Browse the repository at this point in the history
This change carries files and modifications that are used by OpenShift
release infrastructure and related files.

* spec file
* dockerfiles
  * vertical-pod-autoscaler/Dockerfile.rhel
  * images/cluster-autoscaler/Dockerfile
  * images/cluster-autoscaler/Dockerfile.rhel
* hack scripts (ci and build related)
* Makefile
* JUnit tools
* update gitignore
* update/remove OWNERS files
* ci-operator config yaml
  • Loading branch information
elmiko authored and JoelSpeed committed May 31, 2022
1 parent 1a0f666 commit 4a0b883
Show file tree
Hide file tree
Showing 192 changed files with 11,180 additions and 148 deletions.
4 changes: 4 additions & 0 deletions .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-8-release-golang-1.17-openshift-4.10
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
Session.vim
.netrwhist

_output
144 changes: 144 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Old-skool build tools.
#
# Targets (see each target for more information):
# all: Build code.
# build: Build code.
# check: Run verify, build, unit tests and cmd tests.
# test: Run all tests.
# run: Run all-in-one server
# clean: Clean up.

OUT_DIR = _output
OS_OUTPUT_GOPATH ?= 1

GO111MODULE = off
export GO111MODULE
GOFLAGS ?= -mod=vendor

export GOFLAGS
export TESTFLAGS
# If set to 1, create an isolated GOPATH inside _output using symlinks to avoid
# other packages being accidentally included. Defaults to on.
export OS_OUTPUT_GOPATH
# May be used to set additional arguments passed to the image build commands for
# mounting secrets specific to a build environment.
export OS_BUILD_IMAGE_ARGS

# Tests run using `make` are most often run by the CI system, so we are OK to
# assume the user wants jUnit output and will turn it off if they don't.
JUNIT_REPORT ?= true

# Build code.
#
# Args:
# WHAT: Directory names to build. If any of these directories has a 'main'
# package, the build will produce executable files under $(OUT_DIR)/local/bin.
# If not specified, "everything" will be built.
# GOFLAGS: Extra flags to pass to 'go' when building.
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh
#
# Example:
# make
# make all
# make all WHAT=cmd/oc GOFLAGS=-v
all build:
hack/build-go.sh $(WHAT) $(GOFLAGS)
.PHONY: all build

# Run core verification and all self contained tests.
#
# Example:
# make check
check: | verify test-unit
.PHONY: check


# Verify code conventions are properly setup.
#
# Example:
# make verify
verify:
{ \
hack/verify-gofmt.sh ||r=1;\
hack/verify-govet.sh ||r=1;\
hack/verify-imports.sh ||r=1;\
exit $$r ;\
}
.PHONY: verify


# Verify commit comments.
#
# Example:
# make verify-commits
verify-commits:
hack/verify-upstream-commits.sh
.PHONY: verify-commits

# Run unit tests.
#
# Args:
# WHAT: Directory names to test. All *_test.go files under these
# directories will be run. If not specified, "everything" will be tested.
# TESTS: Same as WHAT.
# GOFLAGS: Extra flags to pass to 'go' when building.
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh
#
# Example:
# make test-unit
# make test-unit WHAT=pkg/build TESTFLAGS=-v
test-unit:
GO111MODULE="$(GO111MODULE)" GOTEST_FLAGS="$(TESTFLAGS)" hack/test-go.sh $(WHAT) $(TESTS)
.PHONY: test-unit

# Remove all build artifacts.
#
# Example:
# make clean
clean:
rm -rf $(OUT_DIR)
.PHONY: clean

# Build the cross compiled release binaries
#
# Example:
# make build-cross
build-cross:
hack/build-cross.sh
.PHONY: build-cross

# Build RPMs only for the Linux AMD64 target
#
# Args:
#
# Example:
# make build-rpms
build-rpms:
OS_ONLY_BUILD_PLATFORMS='linux/amd64' hack/build-rpms.sh
.PHONY: build-rpms

# Build images from the official RPMs
#
# Args:
#
# Example:
# make build-images
build-images: build-rpms
hack/build-images.sh
.PHONY: build-images

.PHONY: lint
lint: ## Go lint your code
hack/go-lint.sh -min_confidence 0.9 ./cluster-autoscaler/cloudprovider/clusterapi/...

.PHONY: fmt
fmt: ## Go fmt your code
hack/go-fmt.sh ./cluster-autoscaler/cloudprovider/clusterapi

.PHONY: vet
vet: ## Go fmt your code
hack/go-vet.sh ./cluster-autoscaler/cloudprovider/clusterapi

.PHONY: goimports
goimports: ## Go fmt your code
hack/goimports.sh ./cluster-autoscaler/cloudprovider/clusterapi
21 changes: 13 additions & 8 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
approvers:
- mwielgus
- maciekpytel
- bskiba
- gjtempleton
- enxebre
- frobware
- elmiko
- alexander-demichev
- JoelSpeed
reviewers:
- mwielgus
- maciekpytel
- bskiba
- gjtempleton
- enxebre
- frobware
- elmiko
- alexander-demichev
- JoelSpeed

component: "Cloud Compute"
subcomponent: "Cluster Autoscaler"
2 changes: 0 additions & 2 deletions addon-resizer/OWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
approvers:
- bskiba
- wojtek-t
- jbartosik
reviewers:
- bskiba
- wojtek-t
- jbartosik
4 changes: 0 additions & 4 deletions charts/OWNERS

This file was deleted.

131 changes: 131 additions & 0 deletions cluster-autoscaler.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#
# This is a template package spec that will support Go builds following the OpenShift conventions.
# It expects a set of standard env vars that define the Git version being built and can also handle
# multi-architecture Linux builds. It has stubs for cross building.
#
# Search for TODO and fill those sections out as appropriate.
#

#debuginfo not supported with Go
%global debug_package %{nil}

# modifying the Go binaries breaks the DWARF debugging
%global __os_install_post %{_rpmconfigdir}/brp-compress

# %commit and %os_git_vars are intended to be set by tito custom builders provided
# in the .tito/lib directory. The values in this spec file will not be kept up to date.
%{!?commit: %global commit HEAD }
%global shortcommit %(c=%{commit}; echo ${c:0:7})
# os_git_vars needed to run hack scripts during rpm builds
%{!?os_git_vars: %global os_git_vars OS_GIT_VERSION='' OS_GIT_COMMIT='' OS_GIT_MAJOR='' OS_GIT_MINOR='' OS_GIT_TREE_STATE='' }

%if 0%{?skip_build}
%global do_build 0
%else
%global do_build 1
%endif
%if 0%{?skip_prep}
%global do_prep 0
%else
%global do_prep 1
%endif

%if 0%{?fedora} || 0%{?epel}
%global need_redistributable_set 0
%else
# Due to library availability, redistributable builds only work on x86_64
%ifarch x86_64
%global need_redistributable_set 1
%else
%global need_redistributable_set 0
%endif
%endif
%{!?make_redistributable: %global make_redistributable %{need_redistributable_set}}

#
# Customize from here.
#

%global golang_version 1.13
%{!?version: %global version 1.2.0}
%{!?release: %global release 1}

%if "%{dist}" == ".el7aos"
%global package_name atomic-openshift
%global product_name Atomic OpenShift
%else
%global package_name origin
%global product_name Origin
%endif
%global import_path github.com/openshift/kubernetes-autoscaler

Name: %{package_name}-cluster-autoscaler
Version: %{version}
Release: %{release}%{?dist}
Summary: Cluster Autoscaler for OpenShift and Kubernetes
License: ASL 2.0
URL: https://%{import_path}

Source0: https://%{import_path}/archive/%{commit}/%{name}-%{version}.tar.gz
BuildRequires: golang >= %{golang_version}

# If go_arches not defined fall through to implicit golang archs
%if 0%{?go_arches:1}
ExclusiveArch: %{go_arches}
%else
ExclusiveArch: x86_64 aarch64 ppc64le s390x
%endif

### AUTO-BUNDLED-GEN-ENTRY-POINT

%description
Cluster Autoscaler is a component that automatically adjusts
the size of a Kubernetes/OpenShift cluster so that all pods
have a place to run and there are no unneeded nodes.

%prep
%if 0%{do_prep}
%setup -q
%endif

%build
%if 0%{do_build}
%if 0%{make_redistributable}
# Create Binaries for all internally defined arches
%{os_git_vars} make build-cross
%else
# Create Binaries only for building arch
%ifarch x86_64
BUILD_PLATFORM="linux/amd64"
%endif
%ifarch %{ix86}
BUILD_PLATFORM="linux/386"
%endif
%ifarch ppc64le
BUILD_PLATFORM="linux/ppc64le"
%endif
%ifarch %{arm} aarch64
BUILD_PLATFORM="linux/arm64"
%endif
%ifarch s390x
BUILD_PLATFORM="linux/s390x"
%endif
OS_ONLY_BUILD_PLATFORMS="${BUILD_PLATFORM}" %{os_git_vars} make build-cross
%endif
%endif

%install
PLATFORM="$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
install -d %{buildroot}%{_bindir}

# install binary
install -p -m 755 _output/local/bin/${PLATFORM}/cluster-autoscaler %{buildroot}%{_bindir}/cluster-autoscaler

%files
%doc cluster-autoscaler/README.md
%license LICENSE
%{_bindir}/cluster-autoscaler

%changelog
* Tue Apr 17 2018 Avesh Agarwal <avagarwa@redhat.com> 1.2.0-1
- Initial cluster autoscaler spec file.
16 changes: 10 additions & 6 deletions cluster-autoscaler/OWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md

approvers:
- aleksandra-malinowska
- feiskyer
- towca
- elmiko
- alexander-demichev
- JoelSpeed
reviewers:
- aleksandra-malinowska
- feiskyer
- Jeffwan
- enxebre
- frobware
- elmiko
- alexander-demichev
- JoelSpeed
4 changes: 0 additions & 4 deletions cluster-autoscaler/cloudprovider/alicloud/OWNERS

This file was deleted.

4 changes: 0 additions & 4 deletions cluster-autoscaler/cloudprovider/aws/OWNERS

This file was deleted.

8 changes: 0 additions & 8 deletions cluster-autoscaler/cloudprovider/azure/OWNERS

This file was deleted.

4 changes: 0 additions & 4 deletions cluster-autoscaler/cloudprovider/baiducloud/OWNERS

This file was deleted.

10 changes: 0 additions & 10 deletions cluster-autoscaler/cloudprovider/cherryservers/OWNERS

This file was deleted.

2 changes: 0 additions & 2 deletions cluster-autoscaler/cloudprovider/cloudstack/OWNERS

This file was deleted.

Loading

0 comments on commit 4a0b883

Please sign in to comment.