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

Yunikorn 146 #2

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3856c9a
[YUNIKORN-113] fix empty resource handling (#32)
kingamarton May 1, 2020
f6d601c
[YUNIKORN-93] Fix queue resource display (#33)
kingamarton May 6, 2020
1c784c1
[YUNIKORN-83] Add a nodes page (#34)
akhilpb001 May 8, 2020
fe31fb6
[YUNIKORN-136] Image build consistency (#35)
wilfred-s May 8, 2020
3b47608
[YUNIKORN-129] missing license headers (#36)
wilfred-s May 8, 2020
41f2779
[YUNIKORN-146] Add travis integration for yunikorn-web repo
kingamarton May 14, 2020
c2efc2c
reverted karmaconf changes
kingamarton May 15, 2020
680fd36
[YUNIKORN-146] Fixed travis integration
kingamarton May 15, 2020
229fa5a
Merge branch 'YUNIKORN-146' of https://github.com/kingamarton/incubat…
kingamarton May 15, 2020
69645c7
[YUNIKORN-146] changed docker_images.yaml
kingamarton May 18, 2020
277d23c
[YUNIKORN-146] removed duplicate line from makefile
kingamarton May 18, 2020
3562ca2
[YUNIKORN-146] review fix
kingamarton May 20, 2020
12f12a0
[YUNIKORN-146] renames travis.yaml and removed build-prod from image …
kingamarton May 27, 2020
52d470c
[YUNIKORN-146] Renamed travis.yml to .travis.yml
kingamarton May 28, 2020
ac7210c
YUNIKORN-46: Add a quick search box in app page (#38)
akhilpb001 Jun 3, 2020
a9af384
Merge branch 'master' of https://github.com/apache/incubator-yunikorn…
kingamarton Jun 3, 2020
fce4ac9
[YUNIKORN-146] modified travis to have only one stage
kingamarton Jun 3, 2020
b07de8c
Removed yarn install, since it is already installed
kingamarton Jun 3, 2020
81d1481
Revert "Removed yarn install, since it is already installed"
kingamarton Jun 3, 2020
3ec2220
[YUNIKORN-146] Fixed typo in travis and renamed push command to push …
kingamarton Jun 4, 2020
bcc3642
[YUNIKORN-146] fixed push_image
kingamarton Jun 4, 2020
eae1d5a
do push docker image in a separate stage
yangwwei Jun 5, 2020
faaea00
move before_script location
yangwwei Jun 5, 2020
c23a945
Remove before script...
yangwwei Jun 5, 2020
3cbc1e7
[YUNIKORN-146] updated travis.yaml
kingamarton Jun 5, 2020
8476629
[YUNIKORN-146] removed branch
kingamarton Jun 5, 2020
b8d1678
moved script into a new line
kingamarton Jun 5, 2020
18f6312
workaround for npm failure
kingamarton Jun 5, 2020
633b8ac
fix the default REGISTRY to apache
yangwwei Jun 6, 2020
ade899c
Change the docker push to cron job
yangwwei Jun 10, 2020
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
21 changes: 20 additions & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#
# 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.
#

github:
enabled_merge_buttons:
squash: true
Expand All @@ -6,4 +25,4 @@ github:
features:
wiki: true
issues: false
projects: false
projects: false
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# 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: node_js
node_js:
- "12"

git:
depth: 1

services:
- 'docker'

jobs:
include:
- stage: pre-commit checks
install:
- rm -rf package-lock.json node_modules
- npm install -g @angular/cli
- npm install karma
- npm install -g protractor
- npm install yarn
script:
- make check-license
- make build-prod
- yarn test:coverage
- yarn lint
- stage: publish docker image
install: skip
deploy:
provider: script
script: make push
on:
branch: master
condition: $TRAVIS_EVENT_TYPE = cron
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,22 @@ endif

# Image build parameters
# This tag of the image must be changed when pushed to a public repository.
ifeq ($(TAG),)
TAG := yunikorn/yunikorn-web
ifeq ($(REGISTRY),)
REGISTRY := apache
endif

# Set the default web port, this must be the same as in the nginx/nginx.conf file.
PORT=9889

.PHONY: check-license
check-license:
@echo "checking license header"
@licRes=$$(grep -Lr --exclude-dir={node_modules,dist} --include=*.{sh,md,yaml,yml,js,ts,html,js,scss} "Licensed to the Apache Software Foundation" .) ; \
if [ -n "$${licRes}" ]; then \
echo "following files have incorrect license header:\n$${licRes}" ; \
exit 1; \
fi

# Local build and deploy with compose
.PHONY: deploy-prod
deploy-prod:
Expand All @@ -50,17 +59,19 @@ start-dev:
# Run the web interface from the production image
.PHONY: run
run: image
docker run -d -p ${PORT}:9889 ${TAG}:${VERSION}
docker run -d -p ${PORT}:9889 ${REGISTRY}/yunikorn:web-${VERSION}

# Build the web interface in a production ready version
.PHONY: build-prod
build-prod:
yarn install && yarn build:prod

# Build an image based on the production ready version
image: build-prod
.PHONY: image
image:
@echo "building web UI docker image"
@SHA=$$(git rev-parse --short=12 HEAD) ; \
docker build -t ${TAG}:${VERSION} . \
docker build -t ${REGISTRY}/yunikorn:web-${VERSION} . \
--label "GitRevision=$${SHA}" \
--label "Version=${VERSION}" \
--label "BuildTimeStamp=${DATE}"
Expand All @@ -82,3 +93,9 @@ clean:
rm -rf ./node_modules
rm -rf ./out
rm -rf ./out-tsc

.PHONY: push_image
push_image: image
@echo "push docker images"
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
docker push ${REGISTRY}/yunikorn:web-${VERSION}
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
* 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.
-->

# Yunikorn web UI
YuniKorn web provides a web interface on top of the scheduler. It provides insight in the current and historic scheduler status.
It depends on `yunikorn-core` which encapsulates all the actual scheduling logic.
Expand Down Expand Up @@ -31,11 +49,11 @@ Image builds are geared towards a production build and will always build with th
Run `make image` to build the docker image `yunikorn-web`.
Run `make run` to build the image and deploy the container from the docker image `yunikorn-web`.

You can set `TAG` and `VERSION` in the commandline to build docker image with a specified version and tag. For example,
You can set `REGISTRY` and `VERSION` in the commandline to build docker image with a specified version and registry. For example,
```
make image TAG=yunikorn/yunikorn-web VERSION=latest
make image REGISTRY=yunikorn VERSION=latest
```
this command will build binary with version `latest` and the docker image tag is `yunikorn/yunikorn-web:latest`.
This command will build binary with version `web-latest` and the docker full image tag is `yunikorn/yunikorn:web-latest`.

Run `make deploy-prod` to build and deploy the scheduler webapp using docker-compose.
The project uses [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) feature of the docker and requires Docker 17.05 or higher.
Expand Down
21 changes: 20 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
#
# 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.
#

version: '3'
services:
yunikornwebapp:
build: .
image: yunikorn/yunikorn-web
image: yunikorn/yunikorn:web-latest
ports:
- 9889:9889
8 changes: 4 additions & 4 deletions docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ yarn install
echo "[3/5] Building modules..."
yarn build:prod

echo "[4/5] Building docker image yunikorn/yunikorn-web:latest..."
docker build -t yunikorn/yunikorn-web:latest -f ./nginx/Dockerfile .
echo "[4/5] Building docker image apache/yunikorn:web-latest..."
docker build -t apache/yunikorn:web-latest -f ./nginx/Dockerfile .

echo "[5/5] Starting docker container using image yunikorn/yunikorn-web:latest..."
docker run -d -p 9889:9889 yunikorn/yunikorn-web:latest
echo "[5/5] Starting docker container using image apache/yunikorn:web-latest..."
docker run -d -p 9889:9889 apache/yunikorn:web-latest
17 changes: 17 additions & 0 deletions docs/how-to-contribute.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
* 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.
-->
# How do I contribute code?

### Find
Expand Down
Loading