-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build info for CAPX #1313
Add build info for CAPX #1313
Changes from all commits
8f1ad93
f360b92
c98fad5
684f814
284ec92
dbefb89
24c103e
7d50f86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ setupgo "${GOLANG115_VERSION:-1.15.15}" | |
setupgo "${GOLANG116_VERSION:-1.16.15}" | ||
setupgo "${GOLANG117_VERSION:-1.17.12}" | ||
setupgo "${GOLANG118_VERSION:-1.18.5}" | ||
setupgo "${GOLANG119_VERSION:-1.19.1}" | ||
|
||
# use 1.16 or 1.17 when installing and running go-licenses | ||
# go-licenses needs to be installed by the same version of go that is being used | ||
|
@@ -53,6 +54,9 @@ GOBIN=${GOPATH}/go1.17/bin go install github.com/google/[email protected] | |
build::common::use_go_version "1.18" | ||
GOBIN=${GOPATH}/go1.18/bin go install github.com/google/[email protected] | ||
|
||
build::common::use_go_version "1.19" | ||
GOBIN=${GOPATH}/go1.19/bin go install github.com/google/[email protected] | ||
|
||
# 1.16 is the default so symlink it to /go/bin | ||
unlink ${GOPATH}/bin/go-licenses | ||
ln -s ${GOPATH}/go1.16/bin/go-licenses ${GOPATH}/bin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cluster-api-provider-nutanix | ||
_output |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
28d96463c36c630eab3a815ac107251d46537a407b2114ca98d07923d83b80f3 _output/bin/cluster-api-provider-nutanix/linux-amd64/manager | ||
b4b7809b9b15bcb3a1ac3a4bc9fc5c4fa911d20b821a2b777147df9771470522 _output/bin/cluster-api-provider-nutanix/linux-arm64/manager |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.5.1 |
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,29 @@ | ||
BASE_DIRECTORY:=$(shell git rev-parse --show-toplevel) | ||
GIT_TAG:=$(shell cat GIT_TAG) | ||
GOLANG_VERSION?="1.18" | ||
|
||
REPO=cluster-api-provider-nutanix | ||
REPO_OWNER=nutanix-cloud-native | ||
|
||
BASE_IMAGE_NAME?=eks-distro-minimal-base-nonroot | ||
|
||
BINARY_TARGET_FILES=manager | ||
SOURCE_PATTERNS=. | ||
EXTRA_GO_LDFLAGS=$(shell $(BUILD_LIB)/version.sh $(REPO) sigs.k8s.io/cluster-api-provider-nutanix/pkg/version) | ||
|
||
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.1-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 @abhinavmpandey08. | ||
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` in `Makefile` to match the version upstream. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont like pointing to the go.mod as the source of truth for golang versions. Is there a better file in the CAPX repo, maybe the release job or makefile or dockerfile? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really (we have github workflows which also specify the same value); can you elaborate on why we don't like go.mod specifying the version of Go? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is because, the |
||
4. Compare the old tag to the new, looking specifically for Makefile changes. If `release-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,45 @@ | ||
#!/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 | ||
|
||
make release-manifests \ | ||
RELEASE_DIR="out" \ | ||
IMG="${IMAGE_REPO}:${IMAGE_TAG}" | ||
|
||
mkdir -p $OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG | ||
cp out/metadata.yaml "$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 -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this the make commands default to
go1.16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to take care of it as mentioned here google/go-licenses#128
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the latest run, switching to 1.0.0 doesn't seem to have an effect on the CI run. I don't see this locally on my machine but I have the 1.0.0 version of the binary. Switching the local binary to 1.2.1 I am able to repro the issue.