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

Optimize the process of build repository iso #1185

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

muzi502
Copy link
Contributor

@muzi502 muzi502 commented Apr 9, 2022

Signed-off-by: muzi502 muzi502.li@gmail.com

What type of PR is this?

What this PR does / why we need it:

  1. Use a configuration file to manage the required packages instead of in Dockerfile, this way is more flexible and easier to maintain.
  2. Build repository iso support debian9/debian10 and arm64 architecture.
  3. Add github action workflow of auto build repository iso artifact.

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

Does this PR introduced a user-facing change?


Additional documentation, usage docs, etc.:

Usage: run make build-iso-${OS} command in kubekey repo

example: make build-iso-centos7 will build centos7 system repository iso artifact

$ make build-iso-centos7

docker build  \
	--platform linux/amd64 \
	-o type=local,dest=./output \
	-f hack/gen-repository-iso/dockerfile.centos7 \
	hack/gen-repository-iso
[+] Building 7.8s (14/14) FINISHED
 => [internal] load build definition from dockerfile.centos7                                                                              0.0s
 => => transferring dockerfile: 742B                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                         0.0s
 => => transferring context: 2B                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/centos:7                                                                               3.8s
 => FROM docker.io/mikefarah/yq:4.11.1                                                                                                    1.5s
 => => resolve docker.io/mikefarah/yq:4.11.1                                                                                              1.5s
 => [internal] load build context                                                                                                         0.0s
 => => transferring context: 35B                                                                                                          0.0s
 => [centos7 1/7] FROM docker.io/library/centos:7@sha256:c73f515d06b0fa07bb18d8202035e739a494ce760aa73129f60f4bf2bd22b407                 0.0s
 => CACHED [centos7 2/7] RUN yum install -q -y yum-utils createrepo mkisofs epel-release     && yum-config-manager --add-repo https://do  0.0s
 => CACHED [centos7 3/7] WORKDIR package                                                                                                  0.0s
 => CACHED [centos7 4/7] COPY packages.yaml .                                                                                             0.0s
 => CACHED [centos7 5/7] COPY --from=mikefarah/yq:4.11.1 /usr/bin/yq /usr/bin/yq                                                          0.0s
 => CACHED [centos7 6/7] RUN yq eval ".common[],.rpms[],.centos[],.centos7" packages.yaml > packages.list                                 0.0s
 => CACHED [centos7 7/7] RUN sort -u packages.list | xargs repotrack -p centos7-amd64-rpms     && createrepo -d centos7-amd64-rpms     &  0.0s
 => CACHED [stage-1 1/1] COPY --from=centos7 /package/*.iso /                                                                             0.0s
 => exporting to client                                                                                                                   2.4s
 => => copying files 310.77MB

                                                                                                             2.4s
$ ls -lh output/centos7-amd64-rpms.iso
-rw-r--r-- 1 root root 297M Apr 11 18:09 output/centos7-amd64-rpms.iso

In addition, if you run make build-iso-all, it will build all supported OS ISO (centos7 debian9 debian10 ubuntu1604 ubuntu1804 ubuntu2004)

$ make build-iso-all
$ tree output
output
├── [ 296M]  centos7-amd64-rpms.iso
├── [ 190M]  debian-10-amd64-debs.iso
├── [ 210M]  debian-9-amd64-debs.iso
├── [ 159M]  ubuntu-16.04-amd64-debs.iso
├── [ 206M]  ubuntu-18.04-amd64-debs.iso
└── [ 146M]  ubuntu-20.04-amd64-debs.iso

/cc @pixiake @24sama

@ks-ci-bot ks-ci-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 9, 2022
1. Use a configuration file to manage the required packages instead of
   in Dockerfile, this way is more flexible and easier to maintain.
2. Build repository iso support debian9/debian10 and arm64 architecture.
3. Add github action workflow of auto build repository iso artifact.

Signed-off-by: muzi502 <muzi502.li@gmail.com>
@muzi502 muzi502 changed the title [WIP] Optimize the process of build repository iso Optimize the process of build repository iso Apr 11, 2022
@ks-ci-bot ks-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 11, 2022
@muzi502
Copy link
Contributor Author

muzi502 commented Apr 11, 2022

/assign @pixiake @24sama

@pixiake
Copy link
Collaborator

pixiake commented Apr 12, 2022

Thanks for this contribution !

@pixiake
Copy link
Collaborator

pixiake commented Apr 12, 2022

/lgtm
/approve

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2022
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 040b259a46159e42392673c4dfd78ed8a3e0ff55

@pixiake
Copy link
Collaborator

pixiake commented Apr 12, 2022

/approve

@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: muzi502, pixiake

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2022
@ks-ci-bot ks-ci-bot merged commit 0fa9eda into kubesphere:master Apr 12, 2022
@pixiake
Copy link
Collaborator

pixiake commented Apr 12, 2022

@all-contributors please add @muzi502 for code

@allcontributors
Copy link
Contributor

@pixiake

I've put up a pull request to add @muzi502! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants