Skip to content

Commit

Permalink
[YUNIKORN-143] Travis CI integration (apache#110)
Browse files Browse the repository at this point in the history
Replace github workflow with Travis-CI.
Add pushing docker images to the apache docker repo. This includes a
name change for the docker images.

Fixes: apache#110
  • Loading branch information
yangwwei authored and wilfred-s committed May 14, 2020
1 parent 0f2c95c commit dcb7861
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 32 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/main.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

language: go

os:
- linux

go:
- "1.12"

git:
depth: 1

services:
- 'docker'

env:
- GO111MODULE=on

install: true

jobs:
include:
- stage: pre-commit checks
script:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2
- make license-check
- make test
- make lint
after_success: bash <(curl -s https://codecov.io/bash)
- stage: publish docker image
deploy:
provider: script
script: make push
on:
branch: master
#condition: $TRAVIS_EVENT_TYPE = cron
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ endif
# Image build parameters
# This tag of the image must be changed when pushed to a public repository.
ifeq ($(REGISTRY),)
REGISTRY := yunikorn
REGISTRY := apache
endif

# Force Go modules even when checked out inside GOPATH
Expand All @@ -71,8 +71,8 @@ lint:
fi ; \
$${lintBin} run --new

.PHONY: common-check-license
common-check-license:
.PHONY: license-check
license-check:
@echo "checking license header"
@licRes=$$(grep -Lr --include=*.{go,sh} "Licensed to the Apache Software Foundation" .) ; \
if [ -n "$${licRes}" ]; then \
Expand Down Expand Up @@ -124,7 +124,7 @@ sched_image: scheduler
@coreSHA=$$(go list -m "github.com/apache/incubator-yunikorn-core" | cut -d "-" -f5) ; \
siSHA=$$(go list -m "github.com/apache/incubator-yunikorn-scheduler-interface" | cut -d "-" -f6) ; \
shimSHA=$$(git rev-parse --short=12 HEAD) ; \
docker build ./deployments/image/configmap -t ${REGISTRY}/yunikorn-scheduler-k8s:${VERSION} \
docker build ./deployments/image/configmap -t ${REGISTRY}/yunikorn:scheduler-${VERSION} \
--label "yunikorn-core-revision=$${coreSHA}" \
--label "yunikorn-scheduler-interface-revision=$${siSHA}" \
--label "yunikorn-k8shim-revision=$${shimSHA}" \
Expand All @@ -149,18 +149,25 @@ admission: init
adm_image: admission
@echo "building admission controller docker images"
@cp ${ADMISSION_CONTROLLER_BIN_DIR}/${POD_ADMISSION_CONTROLLER_BINARY} ./deployments/image/admission
docker build ./deployments/image/admission -t ${REGISTRY}/yunikorn-scheduler-admission-controller:${VERSION}
docker build ./deployments/image/admission -t ${REGISTRY}/yunikorn:admission-${VERSION}
@rm -f ./deployments/image/admission/${POD_ADMISSION_CONTROLLER_BINARY}

# Build all images based on the production ready version
.PHONY: image
image: sched_image adm_image

.PHONY: push
push: image
@echo "push docker images"
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
docker push ${REGISTRY}/yunikorn:scheduler-${VERSION}
docker push ${REGISTRY}/yunikorn:admission-${VERSION}

# Run the tests after building
.PHONY: test
test:
@echo "running unit tests"
go test ./... -cover -race -tags deadlock
go test ./... -race -tags deadlock -coverprofile=coverage.txt -covermode=atomic
go vet $(REPO)...

# Simple clean of generated files only (no local cleanup).
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# YuniKorn Scheduler for Kubernetes (yunikorn-k8shim)

[![Build Status](https://travis-ci.org/apache/incubator-yunikorn-k8shim.svg?branch=master)](https://travis-ci.org/apache/incubator-yunikorn-k8shim)
[![codecov](https://codecov.io/gh/apache/incubator-yunikorn-k8shim/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/incubator-yunikorn-k8shim)
[![Go Report Card](https://goreportcard.com/badge/github.com/apache/incubator-yunikorn-k8shim)](https://goreportcard.com/report/github.com/apache/incubator-yunikorn-k8shim)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Repo Size](https://img.shields.io/github/repo-size/apache/incubator-yunikorn-k8shim)](https://img.shields.io/github/repo-size/apache/incubator-yunikorn-k8shim)

YuniKorn scheduler shim for kubernetes is a customized k8s scheduler, it can be deployed in a K8s cluster and work as the scheduler.
This project contains the k8s shim layer code for k8s, it depends on `yunikorn-core` which encapsulates all the actual scheduling logic.
By default, it handles all pods scheduling if pod's spec has field `schedulerName: yunikorn`.
Expand Down

0 comments on commit dcb7861

Please sign in to comment.