From ef5b8e73785bd2ce3b619aa67c8a70483409dc8b Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Wed, 21 Nov 2018 15:24:16 +0100 Subject: [PATCH 1/5] Fix #138: check the buildah-ability in Travis CI --- .gitignore | 2 ++ .travis.yml | 14 +++++++++----- Makefile | 18 +++++++----------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 27211b3d..e35ef6b4 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,5 @@ abstract-operator # spark shell metastore_db/ derby.log + +buildah diff --git a/.travis.yml b/.travis.yml index 674ad637..d349a652 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,13 +17,17 @@ jobs: - stage: test name: "Maven & cont. image build" language: java - script: make build-travis test + script: make build test + + - stage: + name: "Buildah-able?" + script: make buildah - stage: test-oc-and-k8s name: "Specs [oc • CMs]" env: BIN=oc VERSION=v3.9.0 CRD=0 script: &oc-script-defaults - - make build-travis + - make build - ./.travis/.travis.prepare.openshift.sh - ./.travis/.travis.test-oc-and-k8s.sh @@ -40,7 +44,7 @@ jobs: name: "Specs [K8s • CMs]" env: BIN=kubectl VERSION=v1.9.0 CRD=0 MINIKUBE_VERSION=v0.25.2 script: &kc-script-defaults - - make build-travis + - make build - ./.travis/.travis.prepare.minikube.sh - ./.travis/.travis.test-oc-and-k8s.sh @@ -53,7 +57,7 @@ jobs: name: "Restarts [oc • CMs]" env: BIN=oc VERSION=v3.9.0 CRD=0 script: - - make build-travis + - make build - ./.travis/.travis.prepare.openshift.sh - ./.travis/.travis.test-restarts.sh @@ -61,7 +65,7 @@ jobs: name: "Restarts [K8s • CRs]" env: BIN=kubectl VERSION=v1.9.0 CRD=1 MINIKUBE_VERSION=v0.25.2 script: - - make build-travis + - make build - ./.travis/.travis.prepare.minikube.sh - ./.travis/.travis.test-restarts.sh diff --git a/Makefile b/Makefile index bd11ca98..e44a6e50 100644 --- a/Makefile +++ b/Makefile @@ -3,17 +3,6 @@ IMAGE?=radanalyticsio/spark-operator .PHONY: build build: package image-build -.PHONY: build-travis -build-travis: install-lib build - -.PHONY: install-parent -install-parent: - rm -rf ./operator-parent-pom ; git clone --depth=1 --branch master https://github.com/jvm-operators/operator-parent-pom.git && cd operator-parent-pom && MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install && cd - && rm -rf ./operator-parent-pom - -.PHONY: install-lib -install-lib: install-parent - rm -rf ./abstract-operator ; git clone --depth=1 --branch master https://github.com/jvm-operators/abstract-operator.git && cd abstract-operator && MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install && cd - && rm -rf ./abstract-operator - .PHONY: package package: MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean package -DskipTests @@ -27,6 +16,13 @@ image-build: docker build -t $(IMAGE):centos -f Dockerfile.centos . docker tag $(IMAGE):centos $(IMAGE):latest +.PHONY: buildah +buildah: + command -v buildah || docker cp $$(docker create docker.io/tomkukral/buildah:latest ls):/usr/bin/buildah ./buildah + echo -e "\n\nbuildah version: " && ./buildah -v || ./buildah -v && echo -e "\n" + buildah bud -f Dockerfile.centos . /dev/null || ./buildah bud -f Dockerfile.centos . + #buildah bud -f Dockerfile.alpine . /dev/null || ./buildah bud -f Dockerfile.alpine . # this fails for the alpine img + .PHONY: image-build-alpine image-build-alpine: docker build -t $(IMAGE):alpine -f Dockerfile.alpine . From 9b96918bb560736eb0249c0b454283ae9f45d7a4 Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Wed, 21 Nov 2018 16:28:43 +0100 Subject: [PATCH 2/5] install missing packages for travis and buildah --- .travis.yml | 2 +- Makefile | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d349a652..b40737ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ jobs: - stage: name: "Buildah-able?" - script: make buildah + script: make buildah-travis-deps buildah - stage: test-oc-and-k8s name: "Specs [oc • CMs]" diff --git a/Makefile b/Makefile index e44a6e50..7ba6ee87 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,17 @@ buildah: buildah bud -f Dockerfile.centos . /dev/null || ./buildah bud -f Dockerfile.centos . #buildah bud -f Dockerfile.alpine . /dev/null || ./buildah bud -f Dockerfile.alpine . # this fails for the alpine img +.PHONY: buildah-travis-deps +buildah-travis-deps: + #sudo apt-get -y install software-properties-common + sudo add-apt-repository -y ppa:alexlarsson/flatpak + #sudo add-apt-repository -y ppa:gophers/archive + #sudo apt-add-repository -y ppa:projectatomic/ppa + sudo apt-get -y -qq update + #sudo apt-get -y install bats btrfs-tools git libapparmor-dev libdevmapper-dev libglib2.0-dev libgpgme11-dev libostree-dev libseccomp-dev libselinux1-dev skopeo-containers go-md2man + sudo apt-get -y install libostree-dev libostree-1-1 + #sudo apt-get -y install golang-1.10 + .PHONY: image-build-alpine image-build-alpine: docker build -t $(IMAGE):alpine -f Dockerfile.alpine . From 100e99d4da4ce689491c7e4bcde496cbfe70e57b Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Wed, 21 Nov 2018 16:31:38 +0100 Subject: [PATCH 3/5] travis.yml: don't use abbreviation --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b40737ec..171986b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ stages: jobs: include: - stage: test - name: "Maven & cont. image build" + name: "Maven & container image build" language: java script: make build test From 83f26a0bcf2acde2a448bcef8cab4e008cf6126e Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Wed, 21 Nov 2018 17:22:04 +0100 Subject: [PATCH 4/5] repo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7ba6ee87..ffef89b1 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ buildah-travis-deps: #sudo apt-get -y install software-properties-common sudo add-apt-repository -y ppa:alexlarsson/flatpak #sudo add-apt-repository -y ppa:gophers/archive - #sudo apt-add-repository -y ppa:projectatomic/ppa + sudo apt-add-repository -y ppa:projectatomic/ppa sudo apt-get -y -qq update #sudo apt-get -y install bats btrfs-tools git libapparmor-dev libdevmapper-dev libglib2.0-dev libgpgme11-dev libostree-dev libseccomp-dev libselinux1-dev skopeo-containers go-md2man sudo apt-get -y install libostree-dev libostree-1-1 From db6818df9b9b7f01d1bb2cb68a40b89971876dfd Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Fri, 22 Feb 2019 12:50:41 +0100 Subject: [PATCH 5/5] another try --- .travis.yml | 5 ++++- Makefile | 23 +++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 171986b2..90bedd84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ -language: java +language: go services: - docker +go: + - "1.10" + # skip install step install: true diff --git a/Makefile b/Makefile index ffef89b1..8e6c18f7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -IMAGE?=radanalyticsio/spark-operator +IMAGE ?= radanalyticsio/spark-operator +#GO_BIN := $(shell which go) .PHONY: build build: package image-build @@ -21,17 +22,27 @@ buildah: command -v buildah || docker cp $$(docker create docker.io/tomkukral/buildah:latest ls):/usr/bin/buildah ./buildah echo -e "\n\nbuildah version: " && ./buildah -v || ./buildah -v && echo -e "\n" buildah bud -f Dockerfile.centos . /dev/null || ./buildah bud -f Dockerfile.centos . - #buildah bud -f Dockerfile.alpine . /dev/null || ./buildah bud -f Dockerfile.alpine . # this fails for the alpine img + buildah bud -f Dockerfile.alpine . /dev/null || ./buildah bud -f Dockerfile.alpine . + +blabla: + sudo touch $(shell type -P go)"-foo" .PHONY: buildah-travis-deps buildah-travis-deps: + echo -e "travis_fold:start:buildah-deps\033[33;1mInstalling Buildah and its dependencies\033[0m" + #sudo cp $(GO_BIN) $(GO_BIN)_bak && sudo apt-get update && sudo apt-get -y install golang-1.10-go && sudo cp /usr/lib/go-1.10/bin/go $(GO_BIN) && go version + git clone https://github.com/containers/buildah ${GOPATH}/src/github.com/containers/buildah + cd ${GOPATH}/src/github.com/containers/buildah && sudo make install.libseccomp.sudo + #sudo cp $(GO_BIN)_bak $(GO_BIN) && go version + cd ${GOPATH}/src/github.com/containers/buildah && make runc all TAGS="apparmor seccomp" && sudo make install install.runc + echo -e "\ntravis_fold:end:buildah-deps\r" #sudo apt-get -y install software-properties-common - sudo add-apt-repository -y ppa:alexlarsson/flatpak + #sudo add-apt-repository -y ppa:alexlarsson/flatpak #sudo add-apt-repository -y ppa:gophers/archive - sudo apt-add-repository -y ppa:projectatomic/ppa - sudo apt-get -y -qq update + #sudo apt-add-repository -y ppa:projectatomic/ppa + #sudo apt-get -y -qq update #sudo apt-get -y install bats btrfs-tools git libapparmor-dev libdevmapper-dev libglib2.0-dev libgpgme11-dev libostree-dev libseccomp-dev libselinux1-dev skopeo-containers go-md2man - sudo apt-get -y install libostree-dev libostree-1-1 + #sudo apt-get -y install libostree-dev libostree-1-1 #sudo apt-get -y install golang-1.10 .PHONY: image-build-alpine