Skip to content

Commit

Permalink
Merge pull request #139 from HewlettPackard/release-v0.0.8
Browse files Browse the repository at this point in the history
Release v0.0.8
  • Loading branch information
bdevcich authored Jun 7, 2023
2 parents ef4f6fb + c609b4c commit fb4d646
Show file tree
Hide file tree
Showing 87 changed files with 10,124 additions and 170 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ name: Docker build and push
on:
push:
branches:
- 'master'
- 'releases/v*'
- '*'
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'releases/v*'

env:
# TEST_TARGET: Name of the testing target in the Dockerfile
Expand Down
41 changes: 38 additions & 3 deletions .github/workflows/rpm_build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
name: RPM Build
on: push
on:
push:
branches:
- '*'
tags:
- 'v*'

jobs:
repo_version:
runs-on: ubuntu-latest
outputs:
version_output: ${{ steps.step1.outputs.version }}
steps:
- name: Verify context
run: |
echo "ref is ${{ github.ref }}"
echo "ref_type is ${{ github.ref_type }}"
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Get Version
id: step1
run: echo "version=$(./git-version-gen)" >> $GITHUB_OUTPUT

rpm_build:
runs-on: ubuntu-latest
needs: repo_version
container:
image: centos:8
env:
Expand All @@ -12,17 +35,29 @@ jobs:
- 80
options: --cpus 1
steps:
- name: "Build context"
env:
VERSION_OUTPUT: ${{ needs.repo_version.outputs.version_output }}
run: |
echo "ref is ${{ github.ref }}"
echo "ref_type is ${{ github.ref_type }}"
echo "head.sha is ${{ github.event.pull_request.head.sha }}"
echo "git-version-gen is $VERSION_OUTPUT"
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: environment setup
env:
VERSION_OUTPUT: ${{ needs.repo_version.outputs.version_output }}
run: |
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf -y distro-sync
dnf -y makecache --refresh
dnf install -y rpm-build rpmdevtools git make
dnf module -y install go-toolset
rpmdev-setuptree
echo $GITHUB_SHA | cut -c1-8 > .commit
echo $VERSION_OUTPUT > .rpmversion
cat .rpmversion
tar -czf /github/home/rpmbuild/SOURCES/dws-clientmount-1.0.tar.gz --transform 's,^,dws-clientmount-1.0/,' .
- name: build rpms
run: rpmbuild -ba clientmount.spec
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ COPY controllers/ controllers/
COPY mount-daemon/ mount-daemon/
COPY utils/ utils/
COPY vendor/ vendor/
COPY github/cluster-api/util/conversion/ github/cluster-api/util/conversion/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
Expand Down
73 changes: 71 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(LOCALBIN))" go test $(TESTDIR) -coverprofile cover.out

##@ Build
build-daemon: COMMIT_HASH?=$(shell git rev-parse --short HEAD)
build-daemon: RPM_VERSION ?= $(shell ./git-version-gen)
build-daemon: PACKAGE = github.com/HewlettPackard/dws/mount-daemon/version
build-daemon: manifests generate fmt vet ## Build standalone clientMount daemon
GOOS=linux GOARCH=amd64 go build -ldflags="-X '$(PACKAGE).commitHash=$(COMMIT_HASH)'" -o bin/clientmountd mount-daemon/main.go
GOOS=linux GOARCH=amd64 go build -ldflags="-X '$(PACKAGE).version=$(RPM_VERSION)'" -o bin/clientmountd mount-daemon/main.go

build: manifests generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
Expand Down Expand Up @@ -184,13 +184,29 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Binaries
GO_INSTALL := ./github/cluster-api/scripts/go_install.sh
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest

CONVERSION_GEN_BIN := conversion-gen
CONVERSION_GEN := $(LOCALBIN)/$(CONVERSION_GEN_BIN)
CONVERSION_GEN_OUTPUT_BASE := --output-base=.
CONVERSION_GEN_PKG := k8s.io/code-generator/cmd/conversion-gen

CONVERSION_VERIFIER_BIN := conversion-verifier
CONVERSION_VERIFIER := $(LOCALBIN)/$(CONVERSION_VERIFIER_BIN)
CONVERSION_VERIFIER_PKG := sigs.k8s.io/cluster-api/hack/tools/conversion-verifier

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
CONTROLLER_TOOLS_VERSION ?= v0.11.1
CONVERSION_GEN_VER := v0.26.3

# Can be "latest", but cannot be a tag, such as "v1.3.3". However, it will
# work with the short-form git commit rev that has been tagged.
#CONVERSION_VERIFIER_VER := 09030092b # v1.3.3
CONVERSION_VERIFIER_VER := 2c07717 # v1.4.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -203,6 +219,59 @@ controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessar
$(CONTROLLER_GEN): $(LOCALBIN)
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

.PHONY: $(CONVERSION_GEN_BIN)
$(CONVERSION_GEN_BIN): $(CONVERSION_GEN) ## Build a local copy of conversion-gen.

## We are forcing a rebuild of conversion-gen via PHONY so that we're always using an up-to-date version.
## We can't use a versioned name for the binary, because that would be reflected in generated files.
.PHONY: $(CONVERSION_GEN)
$(CONVERSION_GEN): $(LOCALBIN) # Build conversion-gen from tools folder.
GOBIN=$(LOCALBIN) $(GO_INSTALL) $(CONVERSION_GEN_PKG) $(CONVERSION_GEN_BIN) $(CONVERSION_GEN_VER)

.PHONY: generate-go-conversions
# The SRC_DIRS value is a comma-separated list of paths to old versions.
# The --input-dirs value is a single path item; specify multiple --input-dirs
# parameters if you have multiple old versions.
generate-go-conversions: $(CONVERSION_GEN) ## Generate conversions go code
$(MAKE) clean-generated-conversions SRC_DIRS="./api/v1alpha1"
$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha1 \
--build-tag=ignore_autogenerated_core \
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
--go-header-file=./hack/boilerplate.go.txt

.PHONY: clean-generated-conversions
clean-generated-conversions: ## Remove files generated by conversion-gen from the mentioned dirs
(IFS=','; for i in $(SRC_DIRS); do find $$i -type f -name 'zz_generated.conversion*' -exec rm -f {} \;; done)

## We are forcing a rebuild of conversion-verifier via PHONY so that we're always using an up-to-date version.
.PHONY: $(CONVERSION_VERIFIER)
$(CONVERSION_VERIFIER): $(LOCALBIN) # Build conversion-verifier from tools folder.
GOBIN=$(LOCALBIN) $(GO_INSTALL) $(CONVERSION_VERIFIER_PKG) $(CONVERSION_VERIFIER_BIN) $(CONVERSION_VERIFIER_VER)

.PHONY: $(CONVERSION_VERIFIER_BIN)
$(CONVERSION_VERIFIER_BIN): $(CONVERSION_VERIFIER) ## Build a local copy of conversion-verifier.

## -------------
## verify
## -------------

ALL_VERIFY_CHECKS = gen conversions

.PHONY: verify
verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) ## Run all verify-* targets

.PHONY: verify-gen
verify-gen: generate manifests generate-go-conversions ## Verify go generated files are up to date
@if !(git diff --quiet HEAD); then \
git diff; \
echo "generated files are out of date, run make generate"; exit 1; \
fi

.PHONY: verify-conversions
verify-conversions: $(CONVERSION_VERIFIER) ## Verifies expected API conversion are in place
$(CONVERSION_VERIFIER)

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
Expand Down
116 changes: 112 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: cray.hpe.com
layout:
- go.kubebuilder.io/v3
Expand All @@ -16,10 +20,6 @@ resources:
kind: Workflow
path: github.com/HewlettPackard/dws/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
Expand Down Expand Up @@ -77,4 +77,112 @@ resources:
kind: SystemConfiguration
path: github.com/HewlettPackard/dws/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: DWDirectiveRule
path: github.com/HewlettPackard/dws/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: ClientMount
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: Computes
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: DWDirectiveRule
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: DirectiveBreakdown
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: PersistentStorageInstance
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: Servers
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: Storage
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: SystemConfiguration
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: cray.hpe.com
group: dws
kind: Workflow
path: github.com/HewlettPackard/dws/api/v1alpha2
version: v1alpha2
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
Loading

0 comments on commit fb4d646

Please sign in to comment.