Skip to content

Commit

Permalink
Add build info for CAPX
Browse files Browse the repository at this point in the history
CAPX is Nutanix's Cluster API provider.
  • Loading branch information
thunderboltsid committed Sep 20, 2022
1 parent 8144c42 commit 7d160c5
Show file tree
Hide file tree
Showing 13 changed files with 1,951 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UPSTREAM_PROJECTS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ projects:
- name: metallb
versions:
- tag: v0.12.1
- org: nutanix-cloud-native
repos:
- name: cluster-api-provider-nutanix
versions:
- tag: v0.5.0
- org: rancher
repos:
- name: local-path-provisioner
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cluster-api-provider-nutanix
_output
1,563 changes: 1,563 additions & 0 deletions projects/nutanix-cloud-native/cluster-api-provider-nutanix/ATTRIBUTION.txt

Large diffs are not rendered by default.

190 changes: 190 additions & 0 deletions projects/nutanix-cloud-native/cluster-api-provider-nutanix/CHECKSUMS

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.5.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.17
57 changes: 57 additions & 0 deletions projects/nutanix-cloud-native/cluster-api-provider-nutanix/Help.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@



########### DO NOT EDIT #############################
# To update call: make add-generated-help-block
# This is added to help document dynamic targets and support shell autocompletion


##@ GIT/Repo Targets
clone-repo: ## Clone upstream `cluster-api-provider-nutanix`
checkout-repo: ## Checkout upstream tag based on value in GIT_TAG file
patch-repo: ## Patch upstream repo with patches in patches directory

##@ Binary Targets
binaries: ## Build all binaries: `manager` for `linux/amd64 linux/arm64`
_output/bin/cluster-api-provider-nutanix/linux-amd64/manager: ## Build `_output/bin/cluster-api-provider-nutanix/linux-amd64/manager`
_output/bin/cluster-api-provider-nutanix/linux-arm64/manager: ## Build `_output/bin/cluster-api-provider-nutanix/linux-arm64/manager`

##@ Image Targets
local-images: ## Builds `cluster-api-provider-nutanix/images/amd64` as oci tars for presumbit validation
images: ## Pushes `cluster-api-provider-nutanix/images/push` to IMAGE_REPO
cluster-api-provider-nutanix/images/amd64: ## Builds/pushes `cluster-api-provider-nutanix/images/amd64`
cluster-api-provider-nutanix/images/push: ## Builds/pushes `cluster-api-provider-nutanix/images/push`

##@ Checksum Targets
checksums: ## Update checksums file based on currently built binaries.
validate-checksums: # Validate checksums of currently built binaries against checksums file.

##@ Artifact Targets
tarballs: ## Create tarballs by calling build/lib/simple_create_tarballs.sh unless SIMPLE_CREATE_TARBALLS=false, then tarballs must be defined in project Makefile
s3-artifacts: # Prepare ARTIFACTS_PATH folder structure with tarballs/manifests/other items to be uploaded to s3
upload-artifacts: # Upload tarballs and other artifacts from ARTIFACTS_PATH to S3

##@ License Targets
gather-licenses: ## Helper to call $(GATHER_LICENSES_TARGETS) which gathers all licenses
attribution: ## Generates attribution from licenses gathered during `gather-licenses`.
attribution-pr: ## Generates PR to update attribution files for projects

##@ Clean Targets
clean: ## Removes source and _output directory
clean-repo: ## Removes source directory

##@ Helpers
help: ## Display this help
add-generated-help-block: ## Add or update generated help block to document project make file and support shell auto completion

##@Update Helpers
run-target-in-docker: ## Run `MAKE_TARGET` using builder base docker container
update-attribution-checksums-docker: ## Update attribution and checksums using the builder base docker container
stop-docker-builder: ## Clean up builder base docker container
generate: ## Update UPSTREAM_PROJECTS.yaml
create-ecr-repos: ## Create repos in ECR for project images for local testing

##@ Build Targets
build: ## Called via prow presubmit, calls `validate-checksums attribution local-images upload-artifacts attribution-pr`
release: ## Called via prow postsubmit + release jobs, calls `validate-checksums images upload-artifacts`
########### END GENERATED ###########################
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BASE_DIRECTORY:=$(shell git rev-parse --show-toplevel)
GIT_TAG:=$(shell cat GIT_TAG)
GOLANG_VERSION:=$(shell cat GOLANG_VERSION)

REPO=cluster-api-provider-nutanix
REPO_OWNER=nutanix-cloud-native

BASE_IMAGE_NAME?=eks-distro-minimal-base

BINARY_TARGET_FILES=manager
EXTRA_GO_LDFLAGS=$(shell $(BUILD_LIB)/version.sh $(REPO) sigs.k8s.io/cluster-api-provider-nutanix/pkg/version)

IMAGE_COMPONENT=nutanix-cloud-native/cluster-api-provider-nutanix/release/manager

HAS_S3_ARTIFACTS=true

include $(BASE_DIRECTORY)/Common.mk

s3-artifacts: create-manifests

.PHONY: create-manifests
create-manifests: tarballs
build/create_manifests.sh $(REPO) $(OUTPUT_DIR) $(ARTIFACTS_PATH) $(GIT_TAG) $(IMAGE_REPO) $(IMAGE_TAG) $(GOLANG_VERSION)

########### DO NOT EDIT #############################
# To update call: make add-generated-help-block
# This is added to help document dynamic targets and support shell autocompletion
# Run make help for a formatted help block with all targets
include Help.mk
########### END GENERATED ###########################
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## **Cluster API Provider for Nutanix**
![Version](https://img.shields.io/badge/version-v0.5.0-blue)

The [Cluster API Provider for Nutanix (CAPX)](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix) is a the implementation of Cluster API for Nutanix.


### Updating

1. Review releases and changelogs in upstream [repo](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix) and decide on the new version.
Please review carefully and if there are questions about changes necessary to eks-anywhere to support the new version
and/or automatically update between eks-anywhere version reach out to @jaxesn, @pokearu or @abhnvp.
2. Update the `GIT_TAG` file to have the new desired version based on the upstream release tags.
3. Check the go.mod file to see if the golang version has changed when updating a version. Update the `GOLANG_VERSION` file to match the version upstream.
4. Compare the old tag to the new, looking specifically for Makefile changes. If `manifests` target has changed in the Makefile, make the required changes in create_manifests.sh
5. Update checksums and attribution using `make update-attribution-checksums-docker`.
6. Update the version at the top of this Readme.
7. Run `make generate` to update the UPSTREAM_PROJECTS.yaml file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


set -x
set -o errexit
set -o pipefail

REPO="$1"
OUTPUT_DIR="$2"
ARTIFACTS_PATH="$3"
TAG="$4"
IMAGE_REPO="$5"
IMAGE_TAG="$6"
GOLANG_VERSION="$7"

MAKE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
source "${MAKE_ROOT}/../../../build/lib/common.sh"

build::common::use_go_version $GOLANG_VERSION

cd $REPO

yq eval -i -P ".spec.template.spec.containers[0].args += [\"--namespace=eksa-system\"]" config/manager/manager.yaml

make manifests

mkdir -p $OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG
cp metadata.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"
cp templates/cluster-template.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"
cp config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"
cp config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"
cp config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"

cp -rf $OUTPUT_DIR/manifests $ARTIFACTS_PATH
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG BASE_IMAGE # https://gallery.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot
FROM $BASE_IMAGE

ARG TARGETARCH
ARG TARGETOS

WORKDIR /

COPY _output/bin/cluster-api-provider-nutanix/$TARGETOS-$TARGETARCH/manager /manager
COPY _output/LICENSES /LICENSES
COPY ATTRIBUTION.txt /ATTRIBUTION.txt

USER 65532
ENTRYPOINT ["/manager"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SHA256SUM
SHA256SUM.sha256
SHA256SUM.sha512
SHA512SUM
SHA512SUM.sha256
SHA512SUM.sha512
cluster-api-provider-nutanix-linux-amd64-$GIT_TAG.tar.gz
cluster-api-provider-nutanix-linux-amd64-$GIT_TAG.tar.gz.sha256
cluster-api-provider-nutanix-linux-amd64-$GIT_TAG.tar.gz.sha512
cluster-api-provider-nutanix-linux-arm64-$GIT_TAG.tar.gz
cluster-api-provider-nutanix-linux-arm64-$GIT_TAG.tar.gz.sha256
cluster-api-provider-nutanix-linux-arm64-$GIT_TAG.tar.gz.sha512
githash
manifests/infrastructure-nutanix/$GIT_TAG/cluster-template.yaml
manifests/infrastructure-nutanix/$GIT_TAG/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml
manifests/infrastructure-nutanix/$GIT_TAG/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml
manifests/infrastructure-nutanix/$GIT_TAG/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml
manifests/infrastructure-nutanix/$GIT_TAG/metadata.yaml
6 changes: 6 additions & 0 deletions release/staging-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ batch:
variables:
PROJECT_PATH: projects/kubernetes-sigs/vsphere-csi-driver
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.vsphere-csi-driver
- identifier: nutanix_cloud_native_cluster_api_provider_nutanix
buildspec: buildspec.yml
env:
variables:
PROJECT_PATH: projects/nutanix-cloud-native/cluster-api-provider-nutanix
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/nutanix-cloud-native.cluster-api-provider-nutanix
- identifier: rancher_local_path_provisioner
buildspec: buildspec.yml
env:
Expand Down

0 comments on commit 7d160c5

Please sign in to comment.