-
Notifications
You must be signed in to change notification settings - Fork 502
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
debs: Support building arbitrary combinations of release packages #884
Conversation
@justaugustus: Adding label: Reasons for blocking this PR:[Changes to certain release tools can affect our ability to test, build, and release Kubernetes. This PR must be explicitly approved by SIG Release repo admins.]
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
a1d0469
to
9206c11
Compare
9206c11
to
cd5e1a9
Compare
There are still tweaks I want to do for this (improving log output, error messages, refactor a few functions) before adding the per-release package logic, but this is a good time to get an initial review. @kubernetes/release-engineering @kubernetes/build-admins Here's some example output from a build run:
And the resulting debs: $ ls -alh bin/*
bin/stable:
total 54M
drwxr-xr-x 2 augustus augustus 4.0K Sep 26 09:36 .
drwxr-xr-x 5 augustus augustus 4.0K Sep 26 09:34 ..
-rw-r--r-- 1 augustus augustus 11M Sep 26 09:36 cri-tools_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 8.4M Sep 26 09:36 kubeadm_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 8.9M Sep 26 09:33 kubectl_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 20M Sep 26 09:34 kubelet_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 7.0M Sep 26 09:35 kubernetes-cni_0.7.5-0_amd64.deb
bin/testing:
total 70M
drwxr-xr-x 2 augustus augustus 4.0K Sep 26 09:37 .
drwxr-xr-x 5 augustus augustus 4.0K Sep 26 09:34 ..
-rw-r--r-- 1 augustus augustus 11M Sep 26 09:37 cri-tools_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 8.1M Sep 26 09:36 kubeadm_1.17.0-alpha.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 8.8M Sep 26 09:33 kubectl_1.17.0-alpha.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 20M Sep 26 09:34 kubelet_1.17.0-alpha.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 24M Sep 26 09:35 kubernetes-cni_0.8.2-0_amd64.deb
bin/unstable:
total 109M
drwxr-xr-x 2 augustus augustus 4.0K Sep 26 09:37 .
drwxr-xr-x 5 augustus augustus 4.0K Sep 26 09:34 ..
-rw-r--r-- 1 augustus augustus 11M Sep 26 09:37 cri-tools_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 18M Sep 26 09:36 kubeadm_1.17.0-alpha.0.1832-d8a420c0d810da-0_amd64.deb
-rw-r--r-- 1 augustus augustus 19M Sep 26 09:34 kubectl_1.17.0-alpha.0.1832-d8a420c0d810da-0_amd64.deb
-rw-r--r-- 1 augustus augustus 39M Sep 26 09:35 kubelet_1.17.0-alpha.0.1832-d8a420c0d810da-0_amd64.deb
-rw-r--r-- 1 augustus augustus 24M Sep 26 09:35 kubernetes-cni_0.8.2-0_amd64.deb |
Sorry for jumping in uninvited, I think you might also need to replace
with
in |
I tweaked this some more to add a few more CLI flags so we can build arbitrary sets of packages. Here's an example: 2019/09/27 10:11:37 download link base is
2019/09/27 10:11:37 download link base is https://dl.k8s.io/v1.16.0
2019/09/27 10:11:37 package name is cri-tools
2019/09/27 10:11:37 CRI tools function
2019/09/27 10:11:37 using CRI version
2019/09/27 10:11:37 [1 16 0], len: 3
2019/09/27 10:11:37 package version is 1.16.0
2019/09/27 10:11:37 !!!!!!!!! doing: main.cfg{packageDefinition:(*main.packageDefinition)(0xc0000b0240), Arch:"amd64", DebArch:"amd64", Package:"cri-tools", Dependencies:"kubelet (>= 1.13.0), kubectl (>= 1.13.0), kubernetes-cni (>= 0.7.5), cri-tools (>= 1.13.0), ${misc:Depends}"}
2019/09/27 10:11:37 /tmp/debs745298073/debian
2019/09/27 10:11:37 w: main.work{src:"packages/latest/cri-tools/debian/changelog", dst:"/tmp/debs745298073/debian/changelog", t:(*template.Template)(0xc0002c4480), info:(*os.fileStat)(0xc0002b2340)}
2019/09/27 10:11:37 w: main.work{src:"packages/latest/cri-tools/debian/compat", dst:"/tmp/debs745298073/debian/compat", t:(*template.Template)(0xc0002c45c0), info:(*os.fileStat)(0xc0002b2680)}
2019/09/27 10:11:37 w: main.work{src:"packages/latest/cri-tools/debian/control", dst:"/tmp/debs745298073/debian/control", t:(*template.Template)(0xc0002c4700), info:(*os.fileStat)(0xc0002b29c0)}
2019/09/27 10:11:37 w: main.work{src:"packages/latest/cri-tools/debian/copyright", dst:"/tmp/debs745298073/debian/copyright", t:(*template.Template)(0xc0002c4800), info:(*os.fileStat)(0xc0002b2d00)}
2019/09/27 10:11:37 w: main.work{src:"packages/latest/cri-tools/debian/cri-tools.install", dst:"/tmp/debs745298073/debian/cri-tools.install", t:(*template.Template)(0xc0002c48c0), info:(*os.fileStat)(0xc0002b3040)}
2019/09/27 10:11:37 w: main.work{src:"packages/latest/cri-tools/debian/rules", dst:"/tmp/debs745298073/debian/rules", t:(*template.Template)(0xc0002c4980), info:(*os.fileStat)(0xc0002b3380)}
dpkg-buildpackage: info: source package cri-tools
dpkg-buildpackage: info: source version 1.16.0-0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Kubernetes Authors <kubernetes-dev@googlegroups.com>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build debs745298073
fakeroot debian/rules clean
dh clean
dh_clean
debian/rules build
echo noop
noop
fakeroot debian/rules binary
mkdir -p ./bin
curl -sSL --fail --retry 5 \
"https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.16.0/crictl-v1.16.0-linux-amd64.tar.gz" \
| tar -C ./bin -xz
dh_testroot
dh_auto_install
dh_shlibdeps
dh_install
dh_installdeb
dh_gencontrol
dpkg-gencontrol: warning: Depends field of package cri-tools: unknown substitution variable ${shlibs:Depends}
dh_md5sums
dh_builddeb
dpkg-deb: building package 'cri-tools' in '../cri-tools_1.16.0-0_amd64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../cri-tools_1.16.0-0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build debs745298073
dpkg-buildpackage: info: binary-only upload (no source included)
2019/09/27 10:11:49 download link base is
2019/09/27 10:11:49 download link base is https://dl.k8s.io/v1.17.0-alpha.0
2019/09/27 10:11:49 package name is cri-tools
2019/09/27 10:11:49 CRI tools function
2019/09/27 10:11:49 using CRI version
2019/09/27 10:11:49 [1 17 0-alpha 0], len: 4
2019/09/27 10:11:49 CRI minor is 17
2019/09/27 10:11:49 CRI minor is 16
2019/09/27 10:11:49 package version is 1.16.0
2019/09/27 10:11:49 !!!!!!!!! doing: main.cfg{packageDefinition:(*main.packageDefinition)(0xc000012510), Arch:"amd64", DebArch:"amd64", Package:"cri-tools", Dependencies:"kubelet (>= 1.13.0), kubectl (>= 1.13.0), kubernetes-cni (>= 0.7.5), cri-tools (>= 1.13.0), ${misc:Depends}"}
2019/09/27 10:11:49 /tmp/debs553687844/debian
2019/09/27 10:11:49 w: main.work{src:"packages/latest/cri-tools/debian/changelog", dst:"/tmp/debs553687844/debian/changelog", t:(*template.Template)(0xc0002c4e00), info:(*os.fileStat)(0xc00017ea90)}
2019/09/27 10:11:49 w: main.work{src:"packages/latest/cri-tools/debian/compat", dst:"/tmp/debs553687844/debian/compat", t:(*template.Template)(0xc0002c4f40), info:(*os.fileStat)(0xc00017edd0)}
2019/09/27 10:11:49 w: main.work{src:"packages/latest/cri-tools/debian/control", dst:"/tmp/debs553687844/debian/control", t:(*template.Template)(0xc0002c5000), info:(*os.fileStat)(0xc00017f110)}
2019/09/27 10:11:49 w: main.work{src:"packages/latest/cri-tools/debian/copyright", dst:"/tmp/debs553687844/debian/copyright", t:(*template.Template)(0xc0002c5100), info:(*os.fileStat)(0xc00017f450)}
2019/09/27 10:11:49 w: main.work{src:"packages/latest/cri-tools/debian/cri-tools.install", dst:"/tmp/debs553687844/debian/cri-tools.install", t:(*template.Template)(0xc0002c51c0), info:(*os.fileStat)(0xc00017f790)}
2019/09/27 10:11:49 w: main.work{src:"packages/latest/cri-tools/debian/rules", dst:"/tmp/debs553687844/debian/rules", t:(*template.Template)(0xc0002c5280), info:(*os.fileStat)(0xc00017fad0)}
dpkg-buildpackage: info: source package cri-tools
dpkg-buildpackage: info: source version 1.16.0-0
dpkg-buildpackage: info: source distribution testing
dpkg-buildpackage: info: source changed by Kubernetes Authors <kubernetes-dev@googlegroups.com>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build debs553687844
fakeroot debian/rules clean
dh clean
dh_clean
debian/rules build
echo noop
noop
fakeroot debian/rules binary
mkdir -p ./bin
curl -sSL --fail --retry 5 \
"https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.16.0/crictl-v1.16.0-linux-amd64.tar.gz" \
| tar -C ./bin -xz
dh_testroot
dh_auto_install
dh_shlibdeps
dh_install
dh_installdeb
dh_gencontrol
dpkg-gencontrol: warning: Depends field of package cri-tools: unknown substitution variable ${shlibs:Depends}
dh_md5sums
dh_builddeb
dpkg-deb: building package 'cri-tools' in '../cri-tools_1.16.0-0_amd64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../cri-tools_1.16.0-0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build debs553687844
dpkg-buildpackage: info: binary-only upload (no source included)
2019/09/27 10:12:01 download link base is
2019/09/27 10:12:01 download link base is https://dl.k8s.io/v1.16.0
2019/09/27 10:12:01 package name is kubeadm
2019/09/27 10:12:01 using Kubernetes version
2019/09/27 10:12:01 package version is 1.16.0
2019/09/27 10:12:01 !!!!!!!!! doing: main.cfg{packageDefinition:(*main.packageDefinition)(0xc000012900), Arch:"amd64", DebArch:"amd64", Package:"kubeadm", Dependencies:"kubelet (>= 1.13.0), kubectl (>= 1.13.0), kubernetes-cni (>= 0.7.5), cri-tools (>= 1.13.0), ${misc:Depends}"}
2019/09/27 10:12:01 /tmp/debs679194675/debian
2019/09/27 10:12:01 /tmp/debs679194675/debian/source
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/10-kubeadm.conf", dst:"/tmp/debs679194675/10-kubeadm.conf", t:(*template.Template)(0xc0002c5680), info:(*os.fileStat)(0xc000467110)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/changelog", dst:"/tmp/debs679194675/debian/changelog", t:(*template.Template)(0xc0002c5780), info:(*os.fileStat)(0xc000467520)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/compat", dst:"/tmp/debs679194675/debian/compat", t:(*template.Template)(0xc0002c5880), info:(*os.fileStat)(0xc000467860)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/control", dst:"/tmp/debs679194675/debian/control", t:(*template.Template)(0xc0002c5940), info:(*os.fileStat)(0xc000467ba0)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/copyright", dst:"/tmp/debs679194675/debian/copyright", t:(*template.Template)(0xc0002c5a40), info:(*os.fileStat)(0xc000467ee0)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/kubeadm.install", dst:"/tmp/debs679194675/debian/kubeadm.install", t:(*template.Template)(0xc0002c5b00), info:(*os.fileStat)(0xc000508270)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/postinst", dst:"/tmp/debs679194675/debian/postinst", t:(*template.Template)(0xc0002c5c00), info:(*os.fileStat)(0xc0005085b0)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/rules", dst:"/tmp/debs679194675/debian/rules", t:(*template.Template)(0xc0002c5cc0), info:(*os.fileStat)(0xc0005088f0)}
2019/09/27 10:12:01 w: main.work{src:"packages/latest/kubeadm/debian/source/format", dst:"/tmp/debs679194675/debian/source/format", t:(*template.Template)(0xc0002c5dc0), info:(*os.fileStat)(0xc000508d00)}
dpkg-buildpackage: info: source package kubeadm
dpkg-buildpackage: info: source version 1.16.0-0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Kubernetes Authors <kubernetes-dev@googlegroups.com>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build debs679194675
fakeroot debian/rules clean
dh clean
dh_clean
debian/rules build
echo noop
noop
fakeroot debian/rules binary
mkdir -p usr/bin
curl --fail -sSL --retry 5 \
-o usr/bin/kubeadm \
"https://dl.k8s.io/v1.16.0/bin/linux/amd64/kubeadm"
chmod +x usr/bin/kubeadm
dh_testroot
dh_auto_install
dh_shlibdeps
dh_install
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'kubeadm' in '../kubeadm_1.16.0-0_amd64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../kubeadm_1.16.0-0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build debs679194675
dpkg-buildpackage: info: binary-only upload (no source included)
2019/09/27 10:12:16 download link base is
2019/09/27 10:12:16 download link base is https://dl.k8s.io/v1.17.0-alpha.0
2019/09/27 10:12:16 package name is kubeadm
2019/09/27 10:12:16 using Kubernetes version
2019/09/27 10:12:16 package version is 1.17.0-alpha.0
2019/09/27 10:12:16 !!!!!!!!! doing: main.cfg{packageDefinition:(*main.packageDefinition)(0xc0000b0090), Arch:"amd64", DebArch:"amd64", Package:"kubeadm", Dependencies:"kubelet (>= 1.13.0), kubectl (>= 1.13.0), kubernetes-cni (>= 0.7.5), cri-tools (>= 1.13.0), ${misc:Depends}"}
2019/09/27 10:12:16 /tmp/debs353753590/debian
2019/09/27 10:12:16 /tmp/debs353753590/debian/source
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/10-kubeadm.conf", dst:"/tmp/debs353753590/10-kubeadm.conf", t:(*template.Template)(0xc0000ae600), info:(*os.fileStat)(0xc0000a0750)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/changelog", dst:"/tmp/debs353753590/debian/changelog", t:(*template.Template)(0xc0000ae740), info:(*os.fileStat)(0xc0000a1110)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/compat", dst:"/tmp/debs353753590/debian/compat", t:(*template.Template)(0xc0000ae840), info:(*os.fileStat)(0xc0000a1450)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/control", dst:"/tmp/debs353753590/debian/control", t:(*template.Template)(0xc0000ae900), info:(*os.fileStat)(0xc0000a1790)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/copyright", dst:"/tmp/debs353753590/debian/copyright", t:(*template.Template)(0xc0000aea00), info:(*os.fileStat)(0xc0000a1ad0)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/kubeadm.install", dst:"/tmp/debs353753590/debian/kubeadm.install", t:(*template.Template)(0xc0000aeac0), info:(*os.fileStat)(0xc0000a1e10)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/postinst", dst:"/tmp/debs353753590/debian/postinst", t:(*template.Template)(0xc0000aebc0), info:(*os.fileStat)(0xc0002b2270)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/rules", dst:"/tmp/debs353753590/debian/rules", t:(*template.Template)(0xc0000aec80), info:(*os.fileStat)(0xc0002b25b0)}
2019/09/27 10:12:16 w: main.work{src:"packages/latest/kubeadm/debian/source/format", dst:"/tmp/debs353753590/debian/source/format", t:(*template.Template)(0xc0000aed80), info:(*os.fileStat)(0xc0002b29c0)}
dpkg-buildpackage: info: source package kubeadm
dpkg-buildpackage: info: source version 1.17.0-alpha.0-0
dpkg-buildpackage: info: source distribution testing
dpkg-buildpackage: info: source changed by Kubernetes Authors <kubernetes-dev@googlegroups.com>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build debs353753590
fakeroot debian/rules clean
dh clean
dh_clean
debian/rules build
echo noop
noop
fakeroot debian/rules binary
mkdir -p usr/bin
curl --fail -sSL --retry 5 \
-o usr/bin/kubeadm \
"https://dl.k8s.io/v1.17.0-alpha.0/bin/linux/amd64/kubeadm"
chmod +x usr/bin/kubeadm
dh_testroot
dh_auto_install
dh_shlibdeps
dh_install
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'kubeadm' in '../kubeadm_1.17.0-alpha.0-0_amd64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../kubeadm_1.17.0-alpha.0-0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build debs353753590
dpkg-buildpackage: info: binary-only upload (no source included)
2019/09/27 10:12:30 download link base is
2019/09/27 10:12:30 download link base is https://dl.k8s.io/v1.16.0
2019/09/27 10:12:30 package name is kubernetes-cni
2019/09/27 10:12:30 using CNI version
2019/09/27 10:12:30 checking kube version (1.16.0) against 1.17.0-alpha.0
2019/09/27 10:12:30 package version is 0.7.5
2019/09/27 10:12:30 !!!!!!!!! doing: main.cfg{packageDefinition:(*main.packageDefinition)(0xc00037a2d0), Arch:"amd64", DebArch:"amd64", Package:"kubernetes-cni", Dependencies:"kubelet (>= 1.13.0), kubectl (>= 1.13.0), kubernetes-cni (>= 0.7.5), cri-tools (>= 1.13.0), ${misc:Depends}"}
2019/09/27 10:12:30 /tmp/debs490486493/debian
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/.gitignore", dst:"/tmp/debs490486493/.gitignore", t:(*template.Template)(0xc0000af240), info:(*os.fileStat)(0xc0002b3ee0)}
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/debian/changelog", dst:"/tmp/debs490486493/debian/changelog", t:(*template.Template)(0xc0000af340), info:(*os.fileStat)(0xc00019a340)}
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/debian/compat", dst:"/tmp/debs490486493/debian/compat", t:(*template.Template)(0xc0000af440), info:(*os.fileStat)(0xc00019a680)}
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/debian/control", dst:"/tmp/debs490486493/debian/control", t:(*template.Template)(0xc0000af500), info:(*os.fileStat)(0xc00019a9c0)}
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/debian/copyright", dst:"/tmp/debs490486493/debian/copyright", t:(*template.Template)(0xc0000af600), info:(*os.fileStat)(0xc00019af70)}
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/debian/kubernetes-cni.install", dst:"/tmp/debs490486493/debian/kubernetes-cni.install", t:(*template.Template)(0xc0000af6c0), info:(*os.fileStat)(0xc00019b2b0)}
2019/09/27 10:12:30 w: main.work{src:"packages/latest/kubernetes-cni/debian/rules", dst:"/tmp/debs490486493/debian/rules", t:(*template.Template)(0xc0000af780), info:(*os.fileStat)(0xc00019b5f0)}
dpkg-buildpackage: info: source package kubernetes-cni
dpkg-buildpackage: info: source version 0.7.5-0
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Kubernetes Authors <kubernetes-dev@googlegroups.com>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build debs490486493
fakeroot debian/rules clean
dh clean
dh_clean
debian/rules build
echo noop
noop
fakeroot debian/rules binary
mkdir -p ./bin
curl -sSL --fail --retry 5 \
"https://github.com/containernetworking/plugins/releases/download/v0.7.5/cni-plugins-amd64-v0.7.5.tgz" \
| tar -C ./bin -xz
dh_testroot
dh_auto_install
dh_shlibdeps
dh_install
dh_installdeb
dh_gencontrol
dpkg-gencontrol: warning: Depends field of package kubernetes-cni: unknown substitution variable ${shlibs:Depends}
dh_md5sums
dh_builddeb
dpkg-deb: building package 'kubernetes-cni' in '../kubernetes-cni_0.7.5-0_amd64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../kubernetes-cni_0.7.5-0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build debs490486493
dpkg-buildpackage: info: binary-only upload (no source included)
2019/09/27 10:12:42 download link base is
2019/09/27 10:12:42 download link base is https://dl.k8s.io/v1.17.0-alpha.0
2019/09/27 10:12:42 package name is kubernetes-cni
2019/09/27 10:12:42 using CNI version
2019/09/27 10:12:42 checking kube version (1.17.0-alpha.0) against 1.17.0-alpha.0
2019/09/27 10:12:42 package version is 0.8.2
2019/09/27 10:12:42 !!!!!!!!! doing: main.cfg{packageDefinition:(*main.packageDefinition)(0xc00037a630), Arch:"amd64", DebArch:"amd64", Package:"kubernetes-cni", Dependencies:"kubelet (>= 1.13.0), kubectl (>= 1.13.0), kubernetes-cni (>= 0.7.5), cri-tools (>= 1.13.0), ${misc:Depends}"}
2019/09/27 10:12:42 /tmp/debs379369624/debian
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/.gitignore", dst:"/tmp/debs379369624/.gitignore", t:(*template.Template)(0xc0002c4500), info:(*os.fileStat)(0xc0004400d0)}
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/debian/changelog", dst:"/tmp/debs379369624/debian/changelog", t:(*template.Template)(0xc0002c4680), info:(*os.fileStat)(0xc0004404e0)}
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/debian/compat", dst:"/tmp/debs379369624/debian/compat", t:(*template.Template)(0xc0002c4780), info:(*os.fileStat)(0xc000440820)}
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/debian/control", dst:"/tmp/debs379369624/debian/control", t:(*template.Template)(0xc0002c4840), info:(*os.fileStat)(0xc000440b60)}
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/debian/copyright", dst:"/tmp/debs379369624/debian/copyright", t:(*template.Template)(0xc0002c4940), info:(*os.fileStat)(0xc000440ea0)}
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/debian/kubernetes-cni.install", dst:"/tmp/debs379369624/debian/kubernetes-cni.install", t:(*template.Template)(0xc0002c4a00), info:(*os.fileStat)(0xc0004411e0)}
2019/09/27 10:12:42 w: main.work{src:"packages/latest/kubernetes-cni/debian/rules", dst:"/tmp/debs379369624/debian/rules", t:(*template.Template)(0xc0002c4ac0), info:(*os.fileStat)(0xc000441520)}
dpkg-buildpackage: info: source package kubernetes-cni
dpkg-buildpackage: info: source version 0.8.2-0
dpkg-buildpackage: info: source distribution testing
dpkg-buildpackage: info: source changed by Kubernetes Authors <kubernetes-dev@googlegroups.com>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build debs379369624
fakeroot debian/rules clean
dh clean
dh_clean
debian/rules build
echo noop
noop
fakeroot debian/rules binary
mkdir -p ./bin
curl -sSL --fail --retry 5 \
"https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz" \
| tar -C ./bin -xz
dh_testroot
dh_auto_install
dh_shlibdeps
dh_install
dh_installdeb
dh_gencontrol
dpkg-gencontrol: warning: Depends field of package kubernetes-cni: unknown substitution variable ${shlibs:Depends}
dh_md5sums
dh_builddeb
dpkg-deb: building package 'kubernetes-cni' in '../kubernetes-cni_0.8.2-0_amd64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../kubernetes-cni_0.8.2-0_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build debs379369624
dpkg-buildpackage: info: binary-only upload (no source included)
real 1m18.466s
user 1m43.774s
sys 0m6.130s and the resulting packages: $ ls -alh bin/*
bin/stable:
total 26M
drwxr-xr-x 2 augustus augustus 4.0K Sep 27 10:12 .
drwxr-xr-x 4 augustus augustus 4.0K Sep 27 10:12 ..
-rw-r--r-- 1 augustus augustus 11M Sep 27 10:11 cri-tools_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 8.4M Sep 27 10:12 kubeadm_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 7.0M Sep 27 10:12 kubernetes-cni_0.7.5-0_amd64.deb
bin/testing:
total 42M
drwxr-xr-x 2 augustus augustus 4.0K Sep 27 10:12 .
drwxr-xr-x 4 augustus augustus 4.0K Sep 27 10:12 ..
-rw-r--r-- 1 augustus augustus 11M Sep 27 10:12 cri-tools_1.16.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 8.1M Sep 27 10:12 kubeadm_1.17.0-alpha.0-0_amd64.deb
-rw-r--r-- 1 augustus augustus 24M Sep 27 10:12 kubernetes-cni_0.8.2-0_amd64.deb |
Is it intended that cri-tools are bound to kubernetes version? E.g. https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.16.1 was released 2 days ago, but with this PR it'll always try to match cri-tools version with kubernetes version: https://github.com/kubernetes/release/pull/884/files#diff-425ad2a19e5c7f50fe5a5163f21cfa04R54 One more thingKinda unrelated but please correct me if I'm wrong, it seems like both in current master and on this branch there's a bug in This line: https://github.com/kubernetes/release/blob/master/build/package.sh#L74 should actually read:
since packages are built in
|
@bai --
Nice catch! I purposely bound the I'll add some logic to this to figure out the latest patch release of
Yep, |
build/debs/build.go
Outdated
kubeVersionString := kubeSemver.String() | ||
kubeVersionParts := strings.Split(kubeVersionString, ".") | ||
|
||
log.Printf("%v, len: %s", kubeVersionParts, len(kubeVersionParts)) |
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.
log.Printf("%v, len: %s", kubeVersionParts, len(kubeVersionParts)) | |
log.Printf("%v, len: %d", kubeVersionParts, len(kubeVersionParts)) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus 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 |
build/debs/build.go
Outdated
ChannelNightly ChannelType = "nightly" | ||
DistributionStable DistributionType = "stable" | ||
DistributionUnstable DistributionType = "unstable" | ||
DistributionTesting DistributionType = "testing" |
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.
What's the rationale for this rename? The current names feel slightly unclear in meaning and I don't follow how the new names improve this.
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.
Aaah in a later patch you reorder to unstable, testing, stable. So unstable is some type of periodic (nightly?), testing is something that's promoted out of the periodic for broader test consumption, and stable is something that's promoted out of test?
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.
@tpepper -- yep, nailed it! I based the naming on the Debian package streams:
stable
: "This is stable and well tested software, which changes only if major security or usability fixes are incorporated."testing
: "This area contains packages that are intended to become part of the next stable distribution. There are strict criteria a package in unstable (see below) must obey before it can be added to testing. Note that testing does not get the timely security updates from the security team."unstable
: "This area contains the most recent packages in Debian. Once a package has met our criterion for stability and quality of packaging, it will be included in testing. unstable is also not supported by the security team. Packages in unstable are the least tested and may contain problems severe enough to affect the stability of your system. Only experienced users should consider using this distribution."
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.
You may notice I'm not the huge-est fan of the Debian influenced naming. I just don't feel "unstable" is accurate, when it's more typically a periodic build. If we're doing things right, the periodics are stable, do then promote to testing, and do then to promote to stable.
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.
While these packages are for Debian, our channels should be named consistently for our project and its users. For those who are Debian users the Debian names might be familiar, but they may not follow the principle of least surprise for other OS users or be appropriate for our intended build/publish/promote workflow.
|
||
packagesRootDir = "packages" | ||
|
||
kubeadmConf = "10-kubeadm.conf" | ||
) | ||
|
||
var latestPackagesDir = fmt.Sprintf("%s/%s", packagesRootDir, "latest") | ||
var ( | ||
minimumCRIToolsVersion = minimumKubernetesVersion |
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.
I'm not sure this a safe default. It's probably the general intent, but we regularly end up with mismatches because things weren't tested in conjunction with one another and then move forward out of sync, eg: kubernetes/kubernetes#83217
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.
I think the default should be to build a specified combination. These dependencies should be specified elsewhere consistently and everything consume that source of truth, instead of making other default assumptions.
Revision string | ||
|
||
KubernetesVersion string | ||
KubeletCNIVersion string |
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.
What's the rationale for not having CRI here?
return getTestingKubeVersion() | ||
case DistributionUnstable: | ||
return getUnstableKubeVersion() | ||
} |
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.
Style nit: this should have the getStableKubeVersion() happen for an explicit case, plus a default case that returns an error explicitly for unknown cases. We may over time add and remove distribution types, modifying such switch statements, so having them explicit and throw errors for unhandled cases likely reduces future bugs.
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.
Going further through review I'm seeing a lot of differences across the per-channel switch statements. I suggest consistently doing explicitly:
- case channel foo
- case channel bar
- case channel baz
- default: error
for ease of maintenance.
build/debs/build.go
Outdated
fmt.Sprintf("kubernetes-cni (%s)", cniVersion), | ||
fmt.Sprintf("kubelet (>= %s)", minimumKubernetesVersion), | ||
fmt.Sprintf("kubectl (>= %s)", minimumKubernetesVersion), | ||
fmt.Sprintf("kubernetes-cni (>= %s)", minimumCNIVersion), |
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.
My regular reminder..unilaterally moving these to ">=" is a policy change and is known to break things for end users given how we test and publish today. This code wont be able to actually be used on production build machines until we have modified our publication streams on the server side.
if err != nil { | ||
return "", err | ||
} | ||
|
||
v1110, err := semver.Make("1.11.0-alpha.0") | ||
v117, err := semver.Make("1.17.0-alpha.0") |
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.
Why is this configuration hard coded as a string constant and further encoded in variable naming?
build/debs/build.go
Outdated
return "", err | ||
} | ||
v1121, err := semver.Make("1.12.1-alpha.0") | ||
v075, err := semver.Make(pre117CNIVersion) |
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.
This should be config.
build/debs/build.go
Outdated
|
||
var err error | ||
|
||
// TODO: Allow building packages for a specific distro type |
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.
By "distro type" here do you mean OS distribution, a variation for which you've mostly removed support, or the unstable/testing/stable distribution channel? "distro" is overloaded, so it might be beneficial to use something more evocative of the release distribution channel concept.
Personally I'm ok with us not building distinctly for a dozen different Debian/Ubuntu targets, specifying the one we do build on and that runtime mileage may vary if the host is different than that. We can't build and test them all.
build/debs/build.go
Outdated
ChannelNightly ChannelType = "nightly" | ||
DistributionStable DistributionType = "stable" | ||
DistributionUnstable DistributionType = "unstable" | ||
DistributionTesting DistributionType = "testing" |
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.
You may notice I'm not the huge-est fan of the Debian influenced naming. I just don't feel "unstable" is accurate, when it's more typically a periodic build. If we're doing things right, the periodics are stable, do then promote to testing, and do then to promote to stable.
build/debs/build.go
Outdated
|
||
log.Printf("download link base is %s", c.DownloadLinkBase) | ||
|
||
// TODO: Add note about this |
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.
what is it?
build/debs/build.go
Outdated
@@ -118,7 +121,8 @@ var ( | |||
) | |||
|
|||
func init() { | |||
// TODO: Add flag support to build stable, testing, or unstable versions | |||
flag.Var(&packages, "packages", "packages to build") | |||
flag.Var(&distributions, "distributions", "distributions to build for") |
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.
This is the "channel"?
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.
I'm not seeing clear value in the chosen default CRI::Kubernetes version mapping. I think build should happen based on external configuration (default) or explicit runtime override. This is an important split to start us moving toward more explicit curation of the variations. Allowing effectively arbitrary variations to be built implicitly by different tools in the pipeline means more places somebody needs to know to update in order to maintain things as new versions come out.
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 |
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.
does this line have extra indentation?
build/debs/build.go
Outdated
pre1110kubeadmconf = "post-1.8/10-kubeadm.conf" | ||
latestkubeadmconf = "post-1.10/10-kubeadm.conf" | ||
cniVersion = "0.7.5" | ||
criToolsVersion = "1.13.0" |
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.
i think we might want to drop the magic build.go is doing in terms of version handling for cni/cri, long term.
it's fighting the deficiency of not having separate spec files or release branches.
LGTM on the overall refactor. |
There is a fair amount of symlinking and reference to Debian/Ubuntu versions, which is not required (and probably hasn't been for a while). When building and publishing debs, we publish them to a single apt repo (https://packages.cloud.google.com/apt/dists/kubernetes-xenial) which makes no distinction between the packages within. This commit moves the deb package definitions to `packages/latest` and removes all symlinks. The deb build program is also slightly refactored here to reference the true distribution types (stable, testing, unstable). Future commits will divide the package definitions so we can modify the structure and dependencies of packages for specific versions of Kubernetes without affecting previous versions. Signed-off-by: Stephen Augustus <saugustus@vmware.com>
We've created an artificial directory structure for arbitrary files that get copied into the kubeadm package. This is unnecessary as kubeadm.install handles the file locations correctly. This commit also removes the symlinks to separate channels, which were unused. Signed-off-by: Stephen Augustus <saugustus@vmware.com>
dpkg-buildpackage throws the following warning for cri-tools when run: "dpkg-buildpackage: warning: debian/rules is not executable; fixing that" Signed-off-by: Stephen Augustus <saugustus@vmware.com>
- Set explicit dependency versions of CRI tools and CNI plugins - Allow building cri-tools and kubernetes-cni packages which correspond to Kubernetes versions - Set default package revision to "0" - Rename "version" struct to "packageDefinition", which is more indicative of the values it contains - Add cni-version flag to allow building arbitrary versions of kubernetes-cni - Remove logic for symlinking package definition directories - Add CNIDownloadLink to handle changes in CNI plugin download links between 0.7.x and 0.8.x Signed-off-by: Stephen Augustus <saugustus@vmware.com>
No code changes; just moving functions around to improve readability. Signed-off-by: Stephen Augustus <saugustus@vmware.com>
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
Here we collapse the builds structs in main() into a function (constructBuilds) as well as provide additional cli flags for package and disribution. This allows us to build arbitrary combinations of packages instead of the entire package set for all distributions. Signed-off-by: Stephen Augustus <saugustus@vmware.com>
Additionally, when the CRI tools version is not specified, we will try to build the latest patch version of CRI tools that corresponds with the Kubernetes version. Examples (current as of this original commit time): - Kubernetes version (1.16.0) --> CRI tools version (1.16.1) - Kubernetes version (1.15.4) --> CRI tools version (1.15.0) Signed-off-by: Stephen Augustus <saugustus@vmware.com>
After discussing with tpepper, we're going to use "channel" instead of "distribution" to describe a package stream. The following channel names will be used: - "release": stable versions of Kubernetes (x.y.z) - "testing": pre-release versions of Kubernetes (x.y.z-{alpha,beta,rc}.m) - "nightly": build versions of Kubernetes (x.y.z-{alpha,beta,rc}.m.nnnn+SHA) Signed-off-by: Stephen Augustus <saugustus@vmware.com>
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
f31f83f
to
bea0fad
Compare
@justaugustus: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Chatted with @tpepper and I'm going to merge this one and continue the work in a follow-up before we get into rebase trouble. |
Happy to see this one merged, thanks ❤️ |
Given the time that has passed and things that have moved around in the repo, #734 has gotten a little too unwieldy to easily rebase, so this will supersede it.
Inspired by/required for the discussion to deprecate the
kubernetes-cni
package.Remove usage of distro variants
There is a fair amount of symlinking and reference to Debian/Ubuntu
versions, which is not required (and probably hasn't been for a while).
When building and publishing debs, we publish them to a single apt repo
(https://packages.cloud.google.com/apt/dists/kubernetes-xenial) which
makes no distinction between the packages within.
This commit moves the deb package definitions to
packages/latest
andremoves all symlinks. The deb build program is also slightly refactored
here to reference the true distribution types (stable, testing, unstable).
Future commits will divide the package definitions so we can modify the
structure and dependencies of packages for specific versions of
Kubernetes without affecting previous versions.
Simplify file structure for kubeadm package
Ensure debian/rules files are executable
Improve build logic
correspond to Kubernetes versions
of the values it contains
between 0.7.x and 0.8.x
Reorganize build code
No code changes; just moving functions around to improve readability.
Update package definition locations in Dockerfile
Enable building arbitrary packages, distributions, versions
Add support for specifying CRI tools version