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

[wip] [blocked] Buildah #150

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ abstract-operator
# spark shell
metastore_db/
derby.log

buildah
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: java
language: go

services:
- docker

go:
- "1.10"

# skip install step
install: true

Expand All @@ -15,15 +18,19 @@ stages:
jobs:
include:
- stage: test
name: "Maven & cont. image build"
name: "Maven & container image build"
language: java
script: make build-travis test
script: make build test

- stage:
name: "Buildah-able?"
script: make buildah-travis-deps 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

Expand All @@ -40,7 +47,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

Expand All @@ -53,15 +60,15 @@ 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

- stage:
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

Expand Down
42 changes: 30 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
IMAGE?=radanalyticsio/spark-operator
IMAGE ?= radanalyticsio/spark-operator
#GO_BIN := $(shell which go)

.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
Expand All @@ -27,6 +17,34 @@ 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 .

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: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 .
Expand Down