Skip to content

Commit

Permalink
Lint space errors (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon authored Oct 19, 2023
1 parent dc273ea commit bde408b
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 62 deletions.
1 change: 0 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Applied code style rules to shell files
6014c4e6872a23f82ca295afa93b033207042876

6 changes: 3 additions & 3 deletions .github/workflows/ci-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
setup:
runs-on: ubuntu-latest
outputs:
git_sha_short: ${{ steps.variables.outputs.git_sha_short }}
workflow_run_url: ${{ steps.variables.outputs.workflow_run_url }}
git_sha_short: ${{ steps.variables.outputs.git_sha_short }}
workflow_run_url: ${{ steps.variables.outputs.workflow_run_url }}
kubernetes_versions: ${{ steps.variables.outputs.kubernetes_versions }}
build_id: ${{ steps.variables.outputs.build_id }}
ci_step_name_prefix: ${{ steps.variables.outputs.ci_step_name_prefix }}
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
uniqueStepNames.add(stepName);
}
}
}
}
}
const headers = [{
data: 'Kubernetes version',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-to-codecommit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
mirror:
if: github.repository == 'awslabs/amazon-eks-ami'
if: github.repository == 'awslabs/amazon-eks-ami'
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
Expand Down
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ AMI details:
Notable changes:
- kernel-5.10 updated to address:
- [ALAS2KERNEL-5.10-2023-039](https://alas.aws.amazon.com/AL2/ALASKERNEL-5.10-2023-039.html)
- Add support for Kubernetes 1.28 ([#1431](https://github.com/awslabs/amazon-eks-ami/pull/1431))
- Add support for Kubernetes 1.28 ([#1431](https://github.com/awslabs/amazon-eks-ami/pull/1431))
- GPU AMI:
- Released with [Neuron version 2.14.0](https://awsdocs-neuron.readthedocs-hosted.com/en/latest/release-notes/index.html#neuron-2-14-0-09-15-2023)
- GPU AMIs on Kubernetes 1.28 and above:
- GPU AMIs on Kubernetes 1.28 and above:
- Upgraded `kernel` to 5.10
- Upgraded `cuda` version to 12.2
- Upgraded Nvidia driver to 535.54.03-1
Expand Down Expand Up @@ -265,7 +265,7 @@ AMI details:
* `amazon-ssm-agent`: 3.1.1732.0-1.amzn2

Notable changes:
- Kernel fix for `CVE-2023-3117` and `CVE-2023-35001` with new versions: [5.10 kernel](https://alas.aws.amazon.com/AL2/ALASKERNEL-5.10-2023-037.html) and [5.4 kernel](https://alas.aws.amazon.com/AL2/ALASKERNEL-5.4-2023-049.html)
- Kernel fix for `CVE-2023-3117` and `CVE-2023-35001` with new versions: [5.10 kernel](https://alas.aws.amazon.com/AL2/ALASKERNEL-5.10-2023-037.html) and [5.4 kernel](https://alas.aws.amazon.com/AL2/ALASKERNEL-5.4-2023-049.html)
- Mount bpffs on all supported Kubernetes versions. ([#1349](https://github.com/awslabs/amazon-eks-ami/pull/1349))
- Enable discard_unpacked_layers by default to clean up compressed image layers in containerd's content store.([#1360](https://github.com/awslabs/amazon-eks-ami/pull/1360))

Expand Down Expand Up @@ -1264,8 +1264,8 @@ AMI details:

Notable changes:
* Pin Kernel 5.4 to 5.4.209-116.367 to prevent nodes from going into Unready [#1072](https://github.com/awslabs/amazon-eks-ami/pull/1072)
* Increase the kube-api-server QPS from 5/10 to 10/20 [#1030](https://github.com/awslabs/amazon-eks-ami/pull/1030)
* Update docker and containerd for [ALASDOCKER-2022-021](https://alas.aws.amazon.com/AL2/ALASDOCKER-2022-021.html) [#1056](https://github.com/awslabs/amazon-eks-ami/pull/1056)
* Increase the kube-api-server QPS from 5/10 to 10/20 [#1030](https://github.com/awslabs/amazon-eks-ami/pull/1030)
* Update docker and containerd for [ALASDOCKER-2022-021](https://alas.aws.amazon.com/AL2/ALASDOCKER-2022-021.html) [#1056](https://github.com/awslabs/amazon-eks-ami/pull/1056)
* runc version is updated to 1.1.3-1.amzn2.0.2 to include ALAS2DOCKER-2022-020 [#1055](https://github.com/awslabs/amazon-eks-ami/pull/1055)
* Release AMI in me-central-1 with version 1.21, 1.22, 1.23. 1.20 is not supported in this region since it will be deprecated soon.
* Fixes an issue with Docker daemon configuration on the GPU AMI (#351).
Expand Down Expand Up @@ -1425,9 +1425,9 @@ Binaries used to build these AMIs are published:

AMI details:
* kernel: 5.4.209-116.363.amzn2
* dockerd: 20.10.17-1.amzn2
* containerd: 1.6.6-1.amzn2
* runc: 1.1.3-1.amzn2-1.amzn2
* dockerd: 20.10.17-1.amzn2
* containerd: 1.6.6-1.amzn2
* runc: 1.1.3-1.amzn2-1.amzn2
* cuda: 470.57.02-1
* nvidia-container-runtime-hook: 1.4.0-1.amzn2
* SSM agent: 3.1.1575.0-1.amzn2
Expand Down Expand Up @@ -1609,7 +1609,7 @@ AMI details:
Notable changes:
* Update kubelet binaries for 1.20
* Support packer's ami_regions feature
* Increase /var/log/messages limit to 100M
* Increase /var/log/messages limit to 100M
* Support local cluster in Outposts
* Adding c6id, m6id, r6id to eni-max-pods.txt

Expand Down Expand Up @@ -3116,7 +3116,7 @@ Notable changes:
- Fix Makefile indentation for 1.19 (#616)
- Increase fs.inotify.max_user_instances to 8192 from the default of 128 (#614)
- use dynamic lookup of docker gid (#622)
- bump docker version to 19.03.13ce-1 (#624)
- bump docker version to 19.03.13ce-1 (#624)

### AMI Release v20210208
* amazon-eks-gpu-node-1.19-v20210208
Expand Down Expand Up @@ -3167,7 +3167,7 @@ Binaries used to build these AMIs are published :
* s3://amazon-eks/1.15.12/2020-11-02/

Notable changes :
* ARM AMIs built with m6g.large instance type (#601)
* ARM AMIs built with m6g.large instance type (#601)
* Add Support for c6gn instance type (#597)
* Patch for CVE-2021-3156 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3156)

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ transform-al2-to-al2023:
lint: lint-docs ## Check the source files for syntax and format issues
$(SHFMT_COMMAND) $(SHFMT_FLAGS) --diff $(MAKEFILE_DIR)
$(SHELLCHECK_COMMAND) --format gcc --severity error $(SHELL_FILES)
hack/lint-space-errors.sh

.PHONY: test
test: ## run the test-harness
Expand Down
4 changes: 2 additions & 2 deletions doc/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.
14 changes: 7 additions & 7 deletions doc/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Contributing Guidelines

Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check [existing open](https://github.com/aws-samples/amazon-eks-ami/issues), or [recently closed](https://github.com/aws-samples/amazon-eks-ami/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
When filing an issue, please check [existing open](https://github.com/aws-samples/amazon-eks-ami/issues), or [recently closed](https://github.com/aws-samples/amazon-eks-ami/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
Expand All @@ -37,7 +37,7 @@ To send us a pull request, please:
6. Send us a pull request, answering any default questions in the pull request interface.
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).

### Testing Changes
Expand Down Expand Up @@ -131,12 +131,12 @@ The issue is discussed in [this StackExchange post](https://unix.stackexchange.c
On OSX, running `brew install coreutils` resolves the issue.

## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-samples/amazon-eks-ami/labels/help%20wanted) issues is a great place to start.
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-samples/amazon-eks-ami/labels/help%20wanted) issues is a great place to start.


## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.


Expand Down
6 changes: 3 additions & 3 deletions doc/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ make k8s \

## Container Image Caching

Optionally, some container images can be cached during the AMI build process in order to reduce the latency of the node getting to a `Ready` state when launched.
Optionally, some container images can be cached during the AMI build process in order to reduce the latency of the node getting to a `Ready` state when launched.

To turn on container image caching:

Expand All @@ -159,7 +159,7 @@ When container image caching is enabled, the following images are cached:

The account ID can be different depending on the region and partition you are building the AMI in. See [here](https://docs.aws.amazon.com/eks/latest/userguide/add-ons-images.html) for more details.

Since the VPC CNI is not versioned with K8s itself, the latest version of the VPC CNI and the default version, based on the response from the EKS DescribeAddonVersions at the time of the AMI build, will be cached.
Since the VPC CNI is not versioned with K8s itself, the latest version of the VPC CNI and the default version, based on the response from the EKS DescribeAddonVersions at the time of the AMI build, will be cached.

The images listed above are also tagged with each region in the partition the AMI is built in, since images are often built in one region and copied to others within the same partition. Images that are available to pull from an ECR FIPS endpoint are also tagged as such (i.e. `602401143452.dkr.ecr-fips.us-east-1.amazonaws.com/eks/pause:3.5`).

Expand Down Expand Up @@ -377,7 +377,7 @@ For more information about image credential provider plugins, refer to the [Kube

Some instance types launch with ephemeral NVMe instance storage (i3, i4i, c5d, c6id, etc). There are two main ways of utilizing this storage within Kubernetes: a single RAID-0 array for use by kubelet and containerd or mounting the individual disks for pod usage.

The EKS Optimized AMI includes a utility script to configure ephemeral storage. The script can be invoked by passing the `--local-disks <raid0 | mount>` flag to the `/etc/eks/bootstrap.sh` script or the script can be invoked directly at `/bin/setup-local-disks`. All disks are formatted with an XFS file system.
The EKS Optimized AMI includes a utility script to configure ephemeral storage. The script can be invoked by passing the `--local-disks <raid0 | mount>` flag to the `/etc/eks/bootstrap.sh` script or the script can be invoked directly at `/bin/setup-local-disks`. All disks are formatted with an XFS file system.

Below are details on the two disk setup options:

Expand Down
6 changes: 3 additions & 3 deletions eks-worker-al2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_comment": "All template variables are enumerated here; and most variables have a default value defined in eks-worker-al2-variables.json",
"variables": {
"additional_yum_repos": null,
"ami_component_description": null,
"ami_component_description": null,
"ami_description": null,
"ami_name": null,
"ami_regions": null,
Expand All @@ -15,7 +15,7 @@
"aws_session_token": null,
"binary_bucket_name": null,
"binary_bucket_region": null,
"cache_container_images": null,
"cache_container_images": null,
"cni_plugin_version": null,
"containerd_version": null,
"creator": null,
Expand All @@ -28,7 +28,7 @@
"kubernetes_build_date": null,
"kubernetes_version": null,
"launch_block_device_mappings_volume_size": null,
"pause_container_version": null,
"pause_container_version": null,
"pull_cni_from_github": null,
"remote_folder": null,
"runc_version": null,
Expand Down
8 changes: 8 additions & 0 deletions hack/lint-space-errors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

cd $(dirname $0)/..

# `git apply|diff` can check for space errors, with the core implementation being `git diff-tree`
# this tool compares two trees, generally used to find errors in proposed changes
# we want to check the entire existing tree, so we compare HEAD against an empty tree
git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
34 changes: 17 additions & 17 deletions log-collector-script/windows/eks-log-collector.ps1
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<#
<#
Copyright 2017 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file.
or in the "license" file accompanying this file.
This file 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.
.SYNOPSIS
.SYNOPSIS
Collects EKS Logs
.DESCRIPTION
Run the script to gather basic operating system, Docker daemon, and kubelet logs.
.DESCRIPTION
Run the script to gather basic operating system, Docker daemon, and kubelet logs.
.NOTES
You need to run this script with Elevated permissions to allow for the collection of the installed applications list
.EXAMPLE
.EXAMPLE
eks-log-collector.ps1
Gather basic operating system, Docker daemon, and kubelet logs.
Gather basic operating system, Docker daemon, and kubelet logs.
#>

param(
[Parameter(Mandatory=$False)][string]$RunMode = "Collect"
[Parameter(Mandatory=$False)][string]$RunMode = "Collect"
)

# Common options
Expand Down Expand Up @@ -111,10 +111,10 @@ Function get_sysinfo{
Write-Host "OK" -ForegroundColor "green"
}
catch {
Write-Error "Unable to collect system information"
Write-Error "Unable to collect system information"
Break
}
}

}

Function is_diskfull{
Expand All @@ -127,11 +127,11 @@ Function is_diskfull{
Write-Host "OK" -ForegroundColor "green"
}
catch {
Write-Error "Unable to Determine Free Disk Space"
Write-Error "Unable to Determine Free Disk Space"
Break
}
if ($percent -lt $threshold){
Write-Error "C: drive only has $percent% free space, please ensure there is at least $threshold% free disk space to collect and store the log files"
Write-Error "C: drive only has $percent% free space, please ensure there is at least $threshold% free disk space to collect and store the log files"
Break
}
}
Expand Down Expand Up @@ -328,7 +328,7 @@ Function get_containerd_logs{

Function get_network_info{
try {
Write-Host "Collecting network Information"
Write-Host "Collecting network Information"
Get-HnsNetwork | Select Name, Type, Id, AddressPrefix > $info_system\network\hns\network.txt
Get-hnsnetwork | Convertto-json -Depth 20 >> $info_system\network\hns\network.txt
Get-hnsnetwork | % { Get-HnsNetwork -Id $_.ID -Detailed } | Convertto-json -Depth 20 >> $info_system\network\hns\networkdetailed.txt
Expand Down Expand Up @@ -373,7 +373,7 @@ Function init{
create_working_dir
get_sysinfo
}

Function collect{
init
is_diskfull
Expand All @@ -395,11 +395,11 @@ Function collect{

#--------------------------
#Main-function
Function main {
Function main {
Write-Host "Running Default(Collect) Mode" -foregroundcolor "blue"
cleanup
collect
pack
pack
}

#Entry point
Expand Down
10 changes: 5 additions & 5 deletions scripts/cleanup_additional_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ fi
AWK_CMD='
BEGIN {RS=";";FS=","}
{
delete vars;
for(i = 1; i <= NF; ++i) {
n = index($i, "=");
if(n) {
delete vars;
for(i = 1; i <= NF; ++i) {
n = index($i, "=");
if(n) {
vars[substr($i, 1, n-1)] = substr($i, n + 1)
}
}
}
Repo = "/etc/yum.repos.d/"vars["repo"]".repo"
}
{cmd="rm -f " Repo; system(cmd)}
Expand Down
10 changes: 5 additions & 5 deletions scripts/install_additional_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ fi
AWK_CMD='
BEGIN {RS=";";FS=","}
{
delete vars;
for(i = 1; i <= NF; ++i) {
n = index($i, "=");
if(n) {
delete vars;
for(i = 1; i <= NF; ++i) {
n = index($i, "=");
if(n) {
vars[substr($i, 1, n-1)] = substr($i, n + 1)
}
}
}
Repo = "/etc/yum.repos.d/"vars["repo"]".repo"
}
{print "["vars["repo"]"]" > Repo}
Expand Down
Loading

0 comments on commit bde408b

Please sign in to comment.