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 19, 2022
1 parent 8144c42 commit 48e2010
Show file tree
Hide file tree
Showing 11 changed files with 1,755 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 @@
cluster-api-provider-nutanix
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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fb85a279c6aa7e67418d4d50dc2f975afcf2bfa78be7be692bb3ea9e7e603760 _output/bin/cluster-api-provider-nutanix/linux-amd64/manager
8dad9195416f4549041dcaa45ea43fdd36c96de5d7ad64c1116e835019551eb9 _output/bin/cluster-api-provider-nutanix/linux-arm64/manager
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.5.0
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?="1.17"

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,18 @@
## **Cluster API Provider for Nutanix**

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.
1. Update the `GIT_TAG` file to have the new desired version based on the upstream release tags.
1. Compare the old tag to the new, looking specifically for Makefile changes. Check if the [release](https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/9e9c2a397288908f73a4f499ac00aaf96d15deb6/Makefile#L283)
target has changed in the Makefile, and make the required changes in create_manifests.sh
1. Check the go.mod file to see if the golang version has changed when updating a version. Update the field `GOLANG_VERSION` in
Makefile to match the version upstream.
1. Update checksums and attribution using `make update-attribution-checksums-docker`.
1. Update the version at the top of this Readme.
1. Run `make generate` to update the UPSTREAM_PROJECTS.yaml file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/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 STAGE="release" \
MANIFEST_DIR="out" \
PULL_POLICY="IfNotPresent" \
IMAGE="${IMAGE_REPO}/nutanix-cloud-native/cluster-api-provider-nutanix/release/manager:$IMAGE_TAG"

mkdir -p $OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG
cp out/cluster-template.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"
cp out/infrastructure-components.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG"
cp metadata.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,16 @@
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-components.yaml
manifests/infrastructure-nutanix/$GIT_TAG/metadata.yaml

0 comments on commit 48e2010

Please sign in to comment.