Skip to content
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

update build to support multi-arch #54

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

chenghu2
Copy link
Contributor

multi-arch support attempt 3 (3rd time is the charm)

@ozbillwang I did some changes in the build script and tested in circleCI.

  1. Circle CI link from my fork branch: https://app.circleci.com/pipelines/github/chenghu2/k8s/26/workflows/decc8b05-3df5-4a65-a427-baf4131b497e/jobs/25
  2. Change the way that fetches Helm's latest tag, the current way always fetches an empty tag so I switched it to match other fetch tag styles.
  3. Get the latest Kubernetes release versions: I completely changed this to not use the docker image since I couldn't figure it out why the volume doesn't work. The new script retrieves the list of all release tags for the Kubernetes repository on GitHub, then loops through them and extracts the minor version number (e.g., 1.18) from each release and finally get the latest version of each minor version.
  4. With current changes, it will still not republish images unless there is a new K8s release. Here is what I propose to change and force republish multi-arch images. Let me know what you think!
for tag in "${latest_versions[@]}"; do
  echo ${tag}
  status=$(curl -sL https://hub.docker.com/v2/repositories/${image}/tags/${tag})
  echo $status
  image_count=$(echo $status | jq '.images | length')
  echo image_count: $image_count
  if [[ ( "${status}" =~ "not found" ) || $(echo $image_count) -le 1 ||( ${REBUILD} == "true" ) ]]; then
     echo "build image for ${tag}"
     build
  fi
done

@ozbillwang
Copy link
Collaborator

ozbillwang commented Feb 15, 2023

Thanks for the improvement.

LGTM

@ozbillwang ozbillwang merged commit a062b2b into alpine-docker:master Feb 15, 2023
ozbillwang pushed a commit that referenced this pull request Feb 15, 2023
@ozbillwang
Copy link
Collaborator

ozbillwang commented Feb 15, 2023

Thanks, @chenghu2

The build is done and images are ready

image

image

can you run tests to make sure the new image work on ARM (Mac Apple M2 chip )?

some test commands for your reference:

docker pull alpine/k8s:1.26.1
docker run -ti --rm alpine/k8s:1.26.1 bash

c12dc9e700d0:/apps# kubectl version --client
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.1", GitCommit:"8f94681cd294aa8cfd3407b8191f6c70214973a4", GitTreeState:"clean", BuildDate:"2023-01-18T15:58:16Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7

c12dc9e700d0:/apps# helm version
version.BuildInfo{Version:"v3.11.1", GitCommit:"293b50c65d4d56187cd4e2f390f0ada46b4c4737", GitTreeState:"clean", GoVersion:"go1.18.10"}

c12dc9e700d0:/apps# eksctl version
0.129.0

c12dc9e700d0:/apps# aws --version
aws-cli/1.27.71 Python/3.10.10 Linux/5.15.68-0-virt botocore/1.29.71

ozbillwang pushed a commit that referenced this pull request Feb 15, 2023
ozbillwang pushed a commit that referenced this pull request Feb 15, 2023
@ozbillwang
Copy link
Collaborator

since this PR works, we are ready to do the same for https://github.com/alpine-docker/helm as well.

Thanks for the improvement.

@chenghu2
Copy link
Contributor Author

Thanks for reviewing and pushing the images! I have tested this on Macbook and AWS M6g Instance and worked.

@ozbillwang ozbillwang mentioned this pull request Feb 15, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants