Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/bot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ class CICommand {
// a map of file path prefixes to OS distros that are associated with the file paths
// a value of "*" implies multiple OS distros are associated with the path, and we should just rely on the workflow's default
osDistroPathPrefixHints = {
"templates/al2/": "al2",
"templates/al2023/": "al2023",
"templates/shared/": "*",
"nodeadm/": "al2023",
Expand Down
53 changes: 12 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ K8S_VERSION_MINOR := $(word 1,${K8S_VERSION_PARTS}).$(word 2,${K8S_VERSION_PARTS
AMI_VARIANT ?= amazon-eks
AMI_VERSION ?= v$(shell date '+%Y%m%d')
aws_region ?= us-west-2
os_distro ?= al2
arch ?= x86_64

BUILD_TARGETS := build k8s validate

ifneq ($(filter $(BUILD_TARGETS),$(MAKECMDGOALS)),)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of validating the input, would it be better/more-consistent if we set defaults?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry the defaults won't be updated, given that we left our latest versions as 1.28 for a while.

ifndef os_distro
$(error os_distro is required (e.g., os_distro=al2023))
endif
ifndef k8s
$(error k8s is required (e.g., k8s=1.35))
endif
endif

ifeq ($(os_distro), al2023)
AMI_VARIANT := $(AMI_VARIANT)-al2023
endif
Expand All @@ -33,11 +43,6 @@ endif

ifdef enable_accelerator
AMI_VARIANT := $(AMI_VARIANT)-$(enable_accelerator)

ifeq ($(os_distro), al2)
enable_efa ?= true
launch_block_device_mappings_volume_size ?= 10
endif
endif

ami_name ?= $(AMI_VARIANT)-node-$(K8S_VERSION_MINOR)-$(AMI_VERSION)
Expand All @@ -48,11 +53,8 @@ else ifneq ($(filter $(aws_region),us-gov-west-1 us-gov-east-1),)
source_ami_owners ?= 045324592363
endif

# default to the latest supported Kubernetes version
k8s=1.28

.PHONY: build
build: ## Build EKS Optimized AMI, default using AL2, use os_distro=al2023 for AL2023 AMI
build: ## Build EKS Optimized AMI (requires os_distro=al2023)
$(MAKE) k8s $(shell hack/latest-binaries.sh $(k8s) $(aws_region))

.PHONY: fmt
Expand All @@ -69,10 +71,6 @@ lint-code: ## Check the source files for syntax and format issues
hack/shellcheck --format gcc --severity warning
hack/lint-space-errors.sh

.PHONY: test
test: ## run the test-harness
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this only test AL2? It seem so but I want to check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I believe so.

templates/test/test-harness.sh

PACKER_BINARY ?= packer
PACKER_TEMPLATE_DIR ?= templates/$(os_distro)
PACKER_TEMPLATE_FILE ?= $(PACKER_TEMPLATE_DIR)/template.json
Expand Down Expand Up @@ -107,33 +105,6 @@ k8s: validate ## Build default K8s version of EKS Optimized AMI
@echo "Building AMI [os_distro=$(os_distro) kubernetes_version=$(kubernetes_version) arch=$(arch) $(if $(enable_accelerator),enable_accelerator=$(enable_accelerator))]"
$(PACKER_BINARY) build -timestamp-ui -color=false $(PACKER_ARGS) $(PACKER_TEMPLATE_FILE)

# DEPRECATION NOTICE: `make` targets for each Kubernetes minor version will not be added after 1.28
# Use the `k8s` variable to specify a minor version instead

.PHONY: 1.23
1.23: ## Build EKS Optimized AMI - K8s 1.23 - DEPRECATED: use the `k8s` variable instead
$(MAKE) k8s $(shell hack/latest-binaries.sh 1.23 $(aws_region))

.PHONY: 1.24
1.24: ## Build EKS Optimized AMI - K8s 1.24 - DEPRECATED: use the `k8s` variable instead
$(MAKE) k8s $(shell hack/latest-binaries.sh 1.24 $(aws_region))

.PHONY: 1.25
1.25: ## Build EKS Optimized AMI - K8s 1.25 - DEPRECATED: use the `k8s` variable instead
$(MAKE) k8s $(shell hack/latest-binaries.sh 1.25 $(aws_region))

.PHONY: 1.26
1.26: ## Build EKS Optimized AMI - K8s 1.26 - DEPRECATED: use the `k8s` variable instead
$(MAKE) k8s $(shell hack/latest-binaries.sh 1.26 $(aws_region))

.PHONY: 1.27
1.27: ## Build EKS Optimized AMI - K8s 1.27 - DEPRECATED: use the `k8s` variable instead
$(MAKE) k8s $(shell hack/latest-binaries.sh 1.27 $(aws_region))

.PHONY: 1.28
1.28: ## Build EKS Optimized AMI - K8s 1.28 - DEPRECATED: use the `k8s` variable instead
$(MAKE) k8s $(shell hack/latest-binaries.sh 1.28 $(aws_region))

.PHONY: lint-docs
lint-docs: ## Lint the docs
hack/lint-docs.sh
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@ invoking Packer directly. You can initiate the build process by running the
following command in the root of this repository:

```bash
# build an AMI with the latest Kubernetes version and the default OS distro
make

# build an AMI with a specific Kubernetes version and the default OS distro
make k8s=1.29

# build an AMI with a specific Kubernetes version and a specific OS distro
# build an AMI with a specific Kubernetes version
make k8s=1.29 os_distro=al2023

# check default value and options in help doc
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-template-variable-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def update_doc(doc: str, template_path: str) -> str:
new_doc = re.sub(table_pattern, "\n".join([boundary, *new_table_lines, boundary]), doc)
return new_doc

for template in ['al2', 'al2023']:
for template in ['al2023']:
doc_file_name = f'../doc/usage/{template}.md'
with open(doc_file_name) as doc_file:
doc = doc_file.read()
Expand Down
26 changes: 0 additions & 26 deletions templates/al2/provisioners/cleanup-additional-repos.sh

This file was deleted.

10 changes: 0 additions & 10 deletions templates/al2/provisioners/enable-fips.sh

This file was deleted.

36 changes: 0 additions & 36 deletions templates/al2/provisioners/install-additional-repos.sh

This file was deleted.

52 changes: 0 additions & 52 deletions templates/al2/provisioners/install-efa.sh

This file was deleted.

34 changes: 0 additions & 34 deletions templates/al2/provisioners/install-neuron-driver.sh

This file was deleted.

Loading
Loading