Skip to content

Commit

Permalink
CI: Build .iso (but not -efi.iso) images.
Browse files Browse the repository at this point in the history
Previously (in #8) building both seemed to timeout or otherwise fall foul of
some sort of infra glitch. Try just building one for now.

This is a first step in trying to actually boot images in CI.

Signed-off-by: Ian Campbell <ijc@docker.com>
  • Loading branch information
Ian Campbell committed Dec 8, 2017
1 parent ce0adc4 commit 9740eec
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
20 changes: 15 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ linuxkit_pkg_build: &linuxkit_pkg_build
image_build: &image_build
docker:
- image: debian:stretch
# image builds seem to need a bit more grunt (RAM) than usual. Possibly getting OOM killed, which https://github.com/moby/tool/pull/191 might help.
# NB: This will become a paid for feature at some point soon (with plenty of warning), so is not a long term solution.
# small 1.0 2GB
# medium (default) 2.0 4GB pass: fail:5
# medium+ 3.0 6GB pass: fail:2
# large 4.0 8GB pass:2 fail:
# xlarge 8.0 16GB
resource_class: large
steps:
- run:
name: Configure $PATH
command: echo 'export PATH=/workspace/bin:$PATH' >> $BASH_ENV
- run:
name: Install packages
# ca-certificates are needed for attach_workspace (and git over https)
command: apt-get update && apt-get install -y ca-certificates curl git make openssh-client
command: apt-get update && apt-get install -y ca-certificates curl git make openssh-client strace
- attach_workspace:
at: /workspace
- checkout
Expand Down Expand Up @@ -84,10 +92,12 @@ image_build: &image_build
command: |
mkdir -p /workspace/images/kube-$KUBE_RUNTIME-$KUBE_NETWORK
df -h .
# KUBE_FORMATS="iso-efi iso-bios" times out or fails for larger docker images.
# Just do tar for now.
make KUBE_FORMATS="tar" master node
#mv kube-master*.iso kube-node*.iso /workspace/images/kube-$KUBE_RUNTIME-$KUBE_NETWORK
ulimit -a
make LINUXKIT_ARGS="-v" KUBE_FORMATS="iso-bios" master node
mv kube-master*.iso kube-node*.iso /workspace/images/kube-$KUBE_RUNTIME-$KUBE_NETWORK
- persist_to_workspace:
root: /workspace
paths: images

version: 2
jobs:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ KUBE_FORMAT_ARGS := $(patsubst %,-format %,$(KUBE_FORMATS))
all: master node

master: yml/kube.yml yml/$(KUBE_RUNTIME).yml yml/$(KUBE_RUNTIME)-master.yml yml/$(KUBE_NETWORK).yml
# strace logs received signals
#strace -f -e trace=signal
linuxkit $(LINUXKIT_ARGS) build $(LINUXKIT_BUILD_ARGS) -name kube-master $(KUBE_FORMAT_ARGS) $^

node: yml/kube.yml yml/$(KUBE_RUNTIME).yml yml/$(KUBE_NETWORK).yml
Expand Down
2 changes: 1 addition & 1 deletion boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ if [ -n "${kubeadm_data}" ] ; then
echo "{ \"kubeadm\": { \"entries\": { ${kubeadm_data} } } }" > $state/metadata.json
fi

linuxkit run ${KUBE_RUN_ARGS} -networking ${KUBE_NETWORKING} -cpus ${KUBE_VCPUS} -mem ${KUBE_MEM} -state "${state}" -disk size=${KUBE_DISK} -data $state/metadata.json ${uefi} "${img}${suffix}"
exec linuxkit run ${KUBE_RUN_ARGS} -networking ${KUBE_NETWORKING} -cpus ${KUBE_VCPUS} -mem ${KUBE_MEM} -state "${state}" -disk size=${KUBE_DISK} -data $state/metadata.json ${uefi} "${img}${suffix}"
5 changes: 3 additions & 2 deletions ssh_into_kubelet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
sshopts="-o LogLevel=FATAL \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o IdentitiesOnly=yes"
-o IdentitiesOnly=yes \
$SSHOPTS"

case $(uname -s) in
Linux)
Expand All @@ -15,4 +16,4 @@ case $(uname -s) in
ijc25/alpine-ssh"
;;
esac
$ssh $sshopts -t root@"$1" ctr tasks exec --tty --exec-id ssh-$(hostname)-$$ kubelet ash -l
exec $ssh $sshopts -t root@"$1" ctr tasks exec --tty --exec-id ssh-$(hostname)-$$ kubelet ash -l

0 comments on commit 9740eec

Please sign in to comment.