From 5be99d2989a5ccab355481094f65ea3fa0732666 Mon Sep 17 00:00:00 2001 From: Dieter Reuter Date: Sun, 14 Aug 2016 04:34:44 +0200 Subject: [PATCH 1/2] Remove cluster lab and pre-installed images * remove hypriot-cluster-lab package * remove pre-installed rpi-consul image * remove pre-installed rpi-swarm image Signed-off-by: Dieter Reuter --- Makefile | 5 +---- builder/chroot-script.sh | 7 ------- builder/files/boot/device-init.yaml | 7 ------- builder/files/etc/docker/daemon.json | 2 -- builder/files/var/local/.gitkeep | 0 builder/get-cluster-lab-images.sh | 13 ------------- .../spec/hypriotos-docker/docker-consul_spec.rb | 15 --------------- .../spec/hypriotos-docker/docker-swarm_spec.rb | 15 --------------- .../spec/hypriotos-image/cluster_lab_spec.rb | 17 ----------------- .../spec/hypriotos-image/device-init_spec.rb | 4 ---- builder/test/image_spec.rb | 12 ------------ versions.config | 5 ----- 12 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 builder/files/etc/docker/daemon.json delete mode 100644 builder/files/var/local/.gitkeep delete mode 100755 builder/get-cluster-lab-images.sh delete mode 100644 builder/test-integration/spec/hypriotos-docker/docker-consul_spec.rb delete mode 100644 builder/test-integration/spec/hypriotos-docker/docker-swarm_spec.rb delete mode 100644 builder/test-integration/spec/hypriotos-image/cluster_lab_spec.rb diff --git a/Makefile b/Makefile index db02a26..bd26b94 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,7 @@ default: build build: docker build -t image-builder-rpi . -get-cluster-lab-images: - builder/get-cluster-lab-images.sh - -sd-image: get-cluster-lab-images build +sd-image: build docker run --rm --privileged -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules -e TRAVIS_TAG -e VERSION image-builder-rpi shell: build diff --git a/builder/chroot-script.sh b/builder/chroot-script.sh index 1cde6e9..39ec75f 100644 --- a/builder/chroot-script.sh +++ b/builder/chroot-script.sh @@ -199,13 +199,6 @@ echo "Installing rpi-serial-console script" wget -q https://raw.githubusercontent.com/lurch/rpi-serial-console/master/rpi-serial-console -O usr/local/bin/rpi-serial-console chmod +x usr/local/bin/rpi-serial-console - -# install Hypriot Cluster-Lab -apt-get install -y \ - "hypriot-cluster-lab=${CLUSTER_LAB_VERSION}" -# do not run cluster-lab automatically -systemctl disable cluster-lab.service - # cleanup APT cache and lists apt-get clean rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/builder/files/boot/device-init.yaml b/builder/files/boot/device-init.yaml index d36d189..8a1dc97 100644 --- a/builder/files/boot/device-init.yaml +++ b/builder/files/boot/device-init.yaml @@ -1,12 +1,5 @@ # hostname for your HypriotOS device hostname: black-pearl -docker: - images: - - /var/local/rpi-consul_0.6.4.tar.gz - - /var/local/rpi-swarm_1.2.2.tar.gz -clusterlab: - service: - run_on_boot: false # optional wireless network settings wifi: diff --git a/builder/files/etc/docker/daemon.json b/builder/files/etc/docker/daemon.json deleted file mode 100644 index 2c63c08..0000000 --- a/builder/files/etc/docker/daemon.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/builder/files/var/local/.gitkeep b/builder/files/var/local/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/builder/get-cluster-lab-images.sh b/builder/get-cluster-lab-images.sh deleted file mode 100755 index 7b41b94..0000000 --- a/builder/get-cluster-lab-images.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source versions.config || source ../versions.config - -# pull save and zip consul -docker pull hypriot/rpi-consul:"${CONSUL_VERSION}" -docker save --output=builder/files/var/local/rpi-consul_"${CONSUL_VERSION}".tar hypriot/rpi-consul:"${CONSUL_VERSION}" -gzip -f builder/files/var/local/rpi-consul_"${CONSUL_VERSION}".tar - -# pull save and zip swarm -docker pull hypriot/rpi-swarm:"${SWARM_VERSION}" -docker save --output=builder/files/var/local/rpi-swarm_"${SWARM_VERSION}".tar hypriot/rpi-swarm:"${SWARM_VERSION}" -gzip -f builder/files/var/local/rpi-swarm_"${SWARM_VERSION}".tar diff --git a/builder/test-integration/spec/hypriotos-docker/docker-consul_spec.rb b/builder/test-integration/spec/hypriotos-docker/docker-consul_spec.rb deleted file mode 100644 index 6536c92..0000000 --- a/builder/test-integration/spec/hypriotos-docker/docker-consul_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe file('/var/local/rpi-consul_0.6.4.tar.gz') do - it { should be_file } -end - -describe command('docker run --rm -t hypriot/rpi-consul --version') do - its(:stdout) { should match /Consul v0\.6\.4/ } - its(:exit_status) { should eq 0 } -end - -describe command('docker images hypriot/rpi-consul') do - its(:stdout) { should match /hypriot\/rpi-consul .*latest .*879ac05d5353 / } - its(:exit_status) { should eq 0 } -end diff --git a/builder/test-integration/spec/hypriotos-docker/docker-swarm_spec.rb b/builder/test-integration/spec/hypriotos-docker/docker-swarm_spec.rb deleted file mode 100644 index 966c072..0000000 --- a/builder/test-integration/spec/hypriotos-docker/docker-swarm_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe file('/var/local/rpi-swarm_1.2.2.tar.gz') do - it { should be_file } -end - -describe command('docker run --rm -t hypriot/rpi-swarm --version') do - its(:stdout) { should match /swarm version 1.2.2 \(HEAD\)/ } - its(:exit_status) { should eq 0 } -end - -describe command('docker images hypriot/rpi-swarm') do - its(:stdout) { should match /hypriot\/rpi-swarm .*latest .*f13b7205f2db / } - its(:exit_status) { should eq 0 } -end diff --git a/builder/test-integration/spec/hypriotos-image/cluster_lab_spec.rb b/builder/test-integration/spec/hypriotos-image/cluster_lab_spec.rb deleted file mode 100644 index c80775c..0000000 --- a/builder/test-integration/spec/hypriotos-image/cluster_lab_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe package('hypriot-cluster-lab') do - it { should be_installed } -end - -describe command('dpkg -l hypriot-cluster-lab') do - its(:stdout) { should match /ii hypriot-cluster-lab/ } - its(:stdout) { should match /0.2.14/ } - its(:exit_status) { should eq 0 } -end - -describe file('/usr/local/bin/cluster-lab') do - it { should be_file } - it { should be_mode 755 } - it { should be_owned_by 'root' } -end diff --git a/builder/test-integration/spec/hypriotos-image/device-init_spec.rb b/builder/test-integration/spec/hypriotos-image/device-init_spec.rb index 6290318..5c42f0b 100644 --- a/builder/test-integration/spec/hypriotos-image/device-init_spec.rb +++ b/builder/test-integration/spec/hypriotos-image/device-init_spec.rb @@ -13,10 +13,6 @@ describe file('/boot/device-init.yaml') do it { should be_file } its(:content) { should match /hostname: / } - its(:content) { should match /docker:/ } - its(:content) { should match /images:/ } - its(:content) { should match /- \/var\/local\/rpi-consul_0.6.4.tar.gz/ } - its(:content) { should match /- \/var\/local\/rpi-swarm_1.2.2.tar.gz/ } end describe file('/usr/local/bin/device-init') do diff --git a/builder/test/image_spec.rb b/builder/test/image_spec.rb index 8063d56..ef6a65f 100644 --- a/builder/test/image_spec.rb +++ b/builder/test/image_spec.rb @@ -43,18 +43,6 @@ end end - context "Docker Images" do - let(:stdout) { run_mounted("ls /var/local").stdout } - - it "Consul export file exists" do - expect(stdout).to contain('rpi-consul_0.6.4.tar.gz') - end - - it "Docker Swarm export file exists" do - expect(stdout).to contain('rpi-swarm_1.2.2.tar.gz') - end - end - context "Docker daemon config" do let(:stdout) { run_mounted("cat /etc/docker/daemon.json").stdout } diff --git a/versions.config b/versions.config index c22b5cf..66983c3 100644 --- a/versions.config +++ b/versions.config @@ -14,8 +14,3 @@ export DOCKER_ENGINE_VERSION="1.12.1~rc1-0~jessie" export DOCKER_COMPOSE_VERSION="1.8.0-61" export DOCKER_MACHINE_VERSION="0.8.0-30" export DEVICE_INIT_VERSION="0.1.8" -export CLUSTER_LAB_VERSION="0.2.14-1" - -# specify preloaded versions of docker images needed for the cluster-lab -SWARM_VERSION="1.2.2" -CONSUL_VERSION="0.6.4" From f8ebf428b261ca703ad739dbfdb38d086e311654 Mon Sep 17 00:00:00 2001 From: Dieter Reuter Date: Sun, 14 Aug 2016 10:42:53 +0200 Subject: [PATCH 2/2] Fix integration tests Signed-off-by: Dieter Reuter --- builder/test/image_spec.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/builder/test/image_spec.rb b/builder/test/image_spec.rb index ef6a65f..53d6a44 100644 --- a/builder/test/image_spec.rb +++ b/builder/test/image_spec.rb @@ -43,14 +43,6 @@ end end - context "Docker daemon config" do - let(:stdout) { run_mounted("cat /etc/docker/daemon.json").stdout } - - it "Daemon config is empty" do - expect(stdout).to contain("{\n}\n\n") - end - end - context "Docker service file" do let(:stdout) { run_mounted("cat /etc/systemd/system/docker.service").stdout }