Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #732 from openpitrix/master
Browse files Browse the repository at this point in the history
Merge master into release-0.3
  • Loading branch information
chilianyi committed Oct 26, 2018
2 parents a925dbd + 009c80d commit 0ac3b57
Show file tree
Hide file tree
Showing 46 changed files with 695 additions and 467 deletions.
76 changes: 42 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ go_import_path: openpitrix.io/openpitrix
addons:
apt:
packages:
- docker-ce
- docker-ce
before_install:
# Install nsenter.
- if [ "TRAVIS_REPO_SLUG" = "openpitrix/openpitrix" ]; then openssl aes-256-cbc -K $encrypted_31dac1cc4b44_key -iv $encrypted_31dac1cc4b44_iv -in key.yaml.enc -out key.yaml -d;fi
- sudo docker run -d -it --name nsenter ubuntu:16.04 bash
- sudo docker cp nsenter:/usr/bin/nsenter /usr/local/bin/nsenter
- sudo docker stop nsenter && sudo docker rm nsenter
# Install docker-compose.
- sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname
-s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl
&& chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64
&& chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.10.0
# Fix the kubectl context, as it's often stale.
- minikube update-context
# Wait for Kubernetes to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
# Install helm.
- DESIRED_VERSION=2.9.1 curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | DESIRED_VERSION=v2.9.1 bash
# Install tiller.
- ./deploy/kubernetes/scripts/init-helm.sh
# Wait for tiller to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}';
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
sleep 1; done
- DESIRED_VERSION=2.9.1 curl https://raw.githubusercontent.com/helm/helm/master/scripts/get
| DESIRED_VERSION=v2.9.1 bash
- "./deploy/kubernetes/scripts/init-helm.sh"
- until helm list -a; do sleep 1; done
install:
- curl https://pek3a.qingstor.com/releases-qs/qsctl/qsctl-latest-linux.tar.gz -O
- tar -xzvf qsctl-latest-linux.tar.gz
before_script:
- docker --version
- docker-compose --version
Expand All @@ -50,22 +51,29 @@ before_deploy:
- make clean
- make release-openpitrix-$TRAVIS_TAG
- make bin-release-openpitrix-$TRAVIS_TAG
- cd image/amazon-linux/; tar -czvf amazon-linux.tar.gz *;cd ../..
- cd image/ubuntu/; tar -czvf ubuntu.tar.gz *;cd ../..
deploy:
- provider: releases
api_key:
secure: k6pBb0kP99Sb0ZmJjncWZNugdUpT90dwWmvnlG4j8t+U61QarfgarR1RdDi8fYLKdioIOwfduH3SU5iq1Xtc4qV62f1J0mXvoRalcEhCeh16edaBxSIs1akUNirNjAvosKURcqmVpUXo+iRFhSI2708J2XBl8sogAqnuuW49LbcrsY7K4DrFFujjysBeSZDaRxPU8nMFykHNSrbEQgw2u/YK6PI0jg73RDhAfnr6cPfZr0ZJDr0ykLrra6faZLANR9khXKaTCN5JT3enI6ufd4bAY0WvjM6XeNLU9vWGeB5QbJErvLlkANrrtkCA6mRDVh6kUxkEM0R1VirGR4XJMk+kVdCzgJV4bpmQSzFhHVbr0g2+4hqeAvNrbVjGq6z9orbv//Lkg7IXhu21u/wcgSAzBWHZdMpoaAVPvySJSVAIhdCgJD5Q3Ebh7L3olLnQ0MWWf95Mz21jTaH0F76pe3Kcu/p3ATSsomZQL9ez+W1A0P+3Bxcjk4fjqjQDkrwBqxo4wTb0Oix66eZFJtwPWKqu0erzuViprSDi6+vwPydjt9ADxMWescFc53sfFPkQWzVC6Pfbxdqt4jCcgRBPipzchsbxHYaofKzfMJrJYIx67iR5Ai9Z8Nwwki6rGXocuR06uhuIyyN4j0yR6Y9qiCslvLUbptsU69WDkMlsOwI=
file:
- deploy/openpitrix-$TRAVIS_TAG-kubernetes.tar.gz
- deploy/openpitrix-$TRAVIS_TAG-bin.tar.gz
skip_cleanup: true
on:
repo: openpitrix/openpitrix
tags: true
- provider: script
script: bash docker_push latest
on:
branch: master
- provider: script
script: bash docker_push $TRAVIS_TAG
on:
tags: true
- provider: releases
api_key:
secure: k6pBb0kP99Sb0ZmJjncWZNugdUpT90dwWmvnlG4j8t+U61QarfgarR1RdDi8fYLKdioIOwfduH3SU5iq1Xtc4qV62f1J0mXvoRalcEhCeh16edaBxSIs1akUNirNjAvosKURcqmVpUXo+iRFhSI2708J2XBl8sogAqnuuW49LbcrsY7K4DrFFujjysBeSZDaRxPU8nMFykHNSrbEQgw2u/YK6PI0jg73RDhAfnr6cPfZr0ZJDr0ykLrra6faZLANR9khXKaTCN5JT3enI6ufd4bAY0WvjM6XeNLU9vWGeB5QbJErvLlkANrrtkCA6mRDVh6kUxkEM0R1VirGR4XJMk+kVdCzgJV4bpmQSzFhHVbr0g2+4hqeAvNrbVjGq6z9orbv//Lkg7IXhu21u/wcgSAzBWHZdMpoaAVPvySJSVAIhdCgJD5Q3Ebh7L3olLnQ0MWWf95Mz21jTaH0F76pe3Kcu/p3ATSsomZQL9ez+W1A0P+3Bxcjk4fjqjQDkrwBqxo4wTb0Oix66eZFJtwPWKqu0erzuViprSDi6+vwPydjt9ADxMWescFc53sfFPkQWzVC6Pfbxdqt4jCcgRBPipzchsbxHYaofKzfMJrJYIx67iR5Ai9Z8Nwwki6rGXocuR06uhuIyyN4j0yR6Y9qiCslvLUbptsU69WDkMlsOwI=
file:
- deploy/openpitrix-$TRAVIS_TAG-kubernetes.tar.gz
- deploy/openpitrix-$TRAVIS_TAG-bin.tar.gz
skip_cleanup: true
on:
repo: openpitrix/openpitrix
tags: true
- provider: script
script: bash docker_push latest
on:
branch: master
repo: openpitrix/openpitrix
- provider: script
script: bash docker_push $TRAVIS_TAG
on:
tags: true
repo: openpitrix/openpitrix
after_deploy:
- if [ "TRAVIS_REPO_SLUG" = "openpitrix/openpitrix" ]; then ./qsctl cp -f image/ubuntu/ubuntu.tar.gz qs://openpitrix/image/ubuntu.tar.gz -c key.yaml -z pek3a; fi
- if [ "TRAVIS_REPO_SLUG" = "openpitrix/openpitrix" ]; then ./qsctl cp -f image/amazon-linux/amazon-linux.tar.gz qs://openpitrix/image/amazon-linux.tar.gz -c key.yaml -z pek3a; fi
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ DOCKER_TAGS=latest
BUILDER_IMAGE=openpitrix/openpitrix-builder:release-v0.2.3
RUN_IN_DOCKER:=docker run -it -v `pwd`:/go/src/$(TRAG.Gopkg) -v `pwd`/tmp/cache:/root/.cache/go-build -w /go/src/$(TRAG.Gopkg) -e GOBIN=/go/src/$(TRAG.Gopkg)/tmp/bin -e USER_ID=`id -u` -e GROUP_ID=`id -g` $(BUILDER_IMAGE)
GO_FMT:=goimports -l -w -e -local=openpitrix -srcdir=/go/src/$(TRAG.Gopkg)
GO_RACE:=go build -race
GO_VET:=go vet
GO_FILES:=./cmd ./test ./pkg
GO_PATH_FILES:=./cmd/... ./test/... ./pkg/...
DB_TEST:=OP_DB_UNIT_TEST=1 OPENPITRIX_MYSQL_HOST=127.0.0.1 OPENPITRIX_MYSQL_PORT=13306
ETCD_TEST:=OP_ETCD_UNIT_TEST=1 OPENPITRIX_ETCD_ENDPOINTS=127.0.0.1:12379
define get_diff_files
Expand Down Expand Up @@ -84,6 +87,11 @@ fmt-all: ## Format all code
$(RUN_IN_DOCKER) $(GO_FMT) $(GO_FILES)
@echo "fmt done"

.PHONY: check
check: ## go vet and race
$(GO_RACE) $(GO_PATH_FILES)
$(GO_VET) $(GO_PATH_FILES)

.PHONY: fmt
fmt: ## Format changed files
$(call get_diff_files)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ The [Roadmap](docs/Roadmap.md) demonstrates a list of open source product develo

## Installation

Please follow the [Installation Guide](https://docs.openpitrix.io/v1.0/zh-CN/openpitrix-install-guide/) to install OpenPitrix.
Please follow the [Installation Guide](https://docs.openpitrix.io/v0.3/zh-CN/openpitrix-install-guide/) to install OpenPitrix.

## To start using OpenPitrix

To get started with OpenPitrix, please read the [Quick start guide](https://docs.openpitrix.io/v1.0/zh-CN/user-quick-start/).
To get started with OpenPitrix, please read the [Quick start guide](https://docs.openpitrix.io/v0.3/zh-CN/user-quick-start/).

For more information, please go to [openpitrix.io](http://openpitrix.io).

Expand Down
4 changes: 2 additions & 2 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ The [Roadmap](docs/Roadmap-zh.md) 是 OpenPitrix 核心开发团队预期的产

## 安装

请参考 [安装指南](https://docs.openpitrix.io/v1.0/zh-CN/openpitrix-install-guide/) 下载和体验 OpenPitrix。
请参考 [安装指南](https://docs.openpitrix.io/v0.3/zh-CN/openpitrix-install-guide/) 下载和体验 OpenPitrix。

## 使用

如果想快速了解如何使用 OpenPitrix,请参考 [快速入门](https://docs.openpitrix.io/v1.0/zh-CN/user-quick-start/).
如果想快速了解如何使用 OpenPitrix,请参考 [快速入门](https://docs.openpitrix.io/v0.3/zh-CN/user-quick-start/).

若想了解关于 OpenPitrix 更多的信息,请参阅我们的官网 [openpitrix.io](http://openpitrix.io).

Expand Down
11 changes: 6 additions & 5 deletions api/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,12 @@ message Cluster {
google.protobuf.StringValue runtime_id = 18;
google.protobuf.Timestamp create_time = 19;
google.protobuf.Timestamp status_time = 20;
repeated ClusterNode cluster_node_set = 21;
repeated ClusterRole cluster_role_set = 22;
repeated ClusterLink cluster_link_set = 23;
repeated ClusterCommon cluster_common_set = 24;
repeated ClusterLoadbalancer cluster_loadbalancer_set = 25;
google.protobuf.StringValue additional_info = 21;
repeated ClusterNode cluster_node_set = 22;
repeated ClusterRole cluster_role_set = 23;
repeated ClusterLink cluster_link_set = 24;
repeated ClusterCommon cluster_common_set = 25;
repeated ClusterLoadbalancer cluster_loadbalancer_set = 26;
}

message DescribeClustersRequest {
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/app-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-app-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/cluster-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-cluster-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/iam-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-iam-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/job-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-job-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/repo-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-repo-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/runtime-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-runtime-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/ctrl/task-db-ctrl-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-task-db-ctrl
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
1 change: 0 additions & 1 deletion deploy/kubernetes/db/db-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
job: openpitrix-db-init
version: ${VERSION}
spec:
activeDeadlineSeconds: 600
backoffLimit: 6
completions: 1
parallelism: 1
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes/db/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
command: ["sh", "-c", "rm -rf /var/lib/mysql/lost+found"]
args:
- --default-authentication-plugin=mysql_native_password
- --binlog-expire-logs-seconds=604800
- --max-binlog-size=1073741824
env:
# $ kubectl create secret generic mysql-pass --from-file=password.txt
# make sure password.txt does not have a trailing newline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ spec:
name: iam-client
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
8 changes: 4 additions & 4 deletions deploy/kubernetes/openpitrix/metadata/openpitrix-pilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ spec:
- name: OPENPITRIX_LOG_LEVEL
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
volumeMounts:
- mountPath: /opt/openpitrix/conf
name: config-volume
Expand Down
8 changes: 4 additions & 4 deletions deploy/kubernetes/openpitrix/openpitrix-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ spec:
name: iam-secret-key
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
16 changes: 8 additions & 8 deletions deploy/kubernetes/openpitrix/openpitrix-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -146,8 +146,8 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
8 changes: 4 additions & 4 deletions deploy/kubernetes/openpitrix/openpitrix-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
8 changes: 4 additions & 4 deletions deploy/kubernetes/openpitrix/openpitrix-iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ spec:
name: iam-account
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
8 changes: 4 additions & 4 deletions deploy/kubernetes/openpitrix/openpitrix-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi

16 changes: 8 additions & 8 deletions deploy/kubernetes/openpitrix/openpitrix-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -146,8 +146,8 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi
8 changes: 4 additions & 4 deletions deploy/kubernetes/openpitrix/openpitrix-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ spec:
name: mysql-pass
resources:
limits:
cpu: ${LIMITS}m
memory: ${LIMITS}Mi
cpu: ${CPU_LIMITS}m
memory: ${MEMORY_LIMITS}Mi
requests:
cpu: ${REQUESTS}m
memory: ${REQUESTS}Mi
cpu: ${CPU_REQUESTS}m
memory: ${MEMORY_REQUESTS}Mi

Loading

0 comments on commit 0ac3b57

Please sign in to comment.