Skip to content

Commit

Permalink
Merge pull request #635 from bfenetworks/release/v0.12.0
Browse files Browse the repository at this point in the history
Release/v0.12.0
  • Loading branch information
iyangsj committed Sep 3, 2020
2 parents 701edf1 + dbf6e11 commit 7931440
Show file tree
Hide file tree
Showing 116 changed files with 2,149 additions and 228 deletions.
96 changes: 66 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,69 @@
name: Go
on: [push]
jobs:
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

build:
name: Build
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "ci"
ci:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
stable: 'true'
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Lint
run: |
echo "golang lint, suggest to use golangci-lint"
- name: Build
run: |
echo "start to build and test bfe"
go version
make
echo "finish"
- name: coverage
run: |
make coverage
bash <(curl -s https://codecov.io/bash)
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
with:
# Must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head of the pull request.
# Only include this option if you are running this workflow on pull requests.
fetch-depth: 2

# If this run was triggered by a pull request event then checkout
# the head of the pull request instead of the merge commit.
# Only include this step if you are running this workflow on pull requests.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Build
- name: Build
shell: bash
run: |
make
# Coverage
- name: Coverage
shell: bash
run: |
make coverage
bash <(curl -s https://codecov.io/bash)
# Setup Python and start a mock server for Test
- name: setup Python
uses: actions/setup-python@v2
with:
python-version: '2.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- run: python -m SimpleHTTPServer 8181&

# Modify Conf and Run
- name: Run
shell: bash
run: |
sed -i s/10.199.189.26/127.0.0.1/g output/conf/cluster_conf/cluster_table.data
cd output/bin/ && ./bfe -c ../conf -l ../log &
# A simple test to ensure bfe runs ok
- name: Test
shell: bash
run: |
status_code=`curl -l -s -o /dev/null -w %{http_code} http://localhost:8080 -H"Host:example.org"`
if [ "$status_code" != "200" ]; then exit 1; fi
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.12.0] - 2020-09-03

### Added
- Support gRPC over HTTP/2
- Support communication with FastCGI server
- Reduce objects number by release some objects that are not used as soon as possible
- Replace ffjson with json-iterator
- net/textproto: turn an ancient DoS BUG annotation into a comment
- Optimize processing of new connections under PROXY mode
- Support integration testing in CI


## [v0.11.0] - 2020-07-24

Expand Down Expand Up @@ -191,6 +202,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Flexible plugin framework to extend functionality. Based on the framework, developer can add new features rapidly
- Detailed built-in metrics available for service status monitor

[v0.12.0]: https://github.com/bfenetworks/bfe/compare/v0.11.0...v0.12.0
[v0.11.0]: https://github.com/bfenetworks/bfe/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/bfenetworks/bfe/compare/v0.9.0...v0.10.0
[v0.9.0]: https://github.com/bfenetworks/bfe/compare/v0.8.0...v0.9.0
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
| Jin Tong | cumirror |
| Jiyang Zhang | scriptkids |
| Kaiyu Zheng | kaiyuzheng |
| Lidong Chang | changlidong68 |
| Lihua Chen | clh651188968 |
| Limei Xiao | limeix |
| Lei Zhang | deancn |
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ COPY conf /bfe/output/conf/
EXPOSE 8080 8443 8421

WORKDIR /bfe/output/bin
CMD ["./bfe", "-c", "../conf/"]
ENTRYPOINT ["./bfe"]
CMD ["-c", "../conf/", "-l", "../log"]
66 changes: 65 additions & 1 deletion GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,22 @@ The BFE community adheres to the following principles:
- Merit: Ideas and contributions are accepted according to their technical merit and alignment with project objectives, scope, and design principles.


## Project Lead

The BFE project has a project lead.

A project lead in BFE is a single person that has a final say in any decision concerning the BFE project.

The term of the project lead is one year, with no term limit restriction.

The project lead is elected by BFE maintainers according to an individual's technical merit to BFE project.

The current project lead is identified in the [MAINTAINERS](MAINTAINERS.md) file`.


## Process for becoming a maintainer

* Express interest to the project leader that you are interested in becoming a
* Express interest to the [project lead](MAINTAINERS.md) that you are interested in becoming a
maintainer. Becoming a maintainer generally means that you are going to be spending substantial
time (>20%) on BFE for the foreseeable future. You are expected to have domain expertise and be extremely
proficient in golang.
Expand Down Expand Up @@ -51,3 +64,54 @@ should volunteer to be moved to emeritus status.
* In extreme cases this can also occur by a vote of the maintainers per the voting process. The voting
process is a simple majority in which each senior maintainer receives two votes and each normal maintainer
receives one vote.


## Changes in Project Lead

Changes in project lead is initiated by opening a github PR.

Anyone from BFE community can vote on the PR with either +1 or -1.

Only the following votes are binding:
1) Any maintainer that has been listed in the [MAINTAINERS](MAINTAINERS.md) file before the PR is opened.
2) Any maintainer from an organization may cast the vote for that organization. However, no organization
should have more binding votes than 1/5 of the total number of maintainers defined in 1).

The PR should only be opened no earlier than 6 weeks before the end of the project lead's term.
The PR should be kept open for no less than 4 weeks. The PR can only be merged after the end of the
last project lead's term, with more +1 than -1 in the binding votes.

When there are conflicting PRs about changes in project lead, the PR with the most binding +1 votes is merged.

The project lead can volunteer to step down.


## Changes in Project Governance
All substantive updates in Governance require a supermajority maintainers vote.


## Decision making process

Decisions are build on consensus between maintainers.
Proposals and ideas can either be submitted for agreement via a github issue or PR,
or by sending an email to `cncf-bfe-maintainers@lists.cncf.io`.

In general, we prefer that technical issues and maintainer membership are amicably worked out between the persons involved.
If a dispute cannot be decided independently, get a third-party maintainer (e.g. a mutual contact with some background
on the issue, but not involved in the conflict) to intercede.
If a dispute still cannot be decided, the project lead has the final say to decide an issue.

Decision making process should be transparent to adhere to the principles of BFE project.

All proposals, ideas, and decisions by maintainers or the project lead
should either be part of a github issue or PR, or be sent to `cncf-bfe-maintainers@lists.cncf.io`.


## Code of Conduct

The [BFE Code of Conduct](CODE_OF_CONDUCT.md) is aligned with the CNCF Code of Conduct.


## Credits

Sections of this documents have been borrowed from [Fluentd](https://github.com/fluent/fluentd/blob/master/GOVERNANCE.md) and [CoreDNS](https://github.com/coredns/coredns/blob/master/GOVERNANCE.md) projects.
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This file lists who are the maintainers of the BFE project. The responsibilities for maintainers are listed in the [GOVERNANCE.md](GOVERNANCE.md) file.

## Project Leader
## Project Lead
| Name | GitHub ID | Affiliation |
| ---- | --------- | ----------- |
| [Miao Zhang](mailto:zhangmiao02@baidu.com) | [mileszhang2016](https://github.com/mileszhang2016) | Baidu |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
BFE is a modern layer 7 load balancer from baidu.

## Advantages
- Multiple protocols supported, including HTTP, HTTPS, SPDY, HTTP2, WebSocket, TLS, etc.
- Multiple protocols supported, including HTTP, HTTPS, SPDY, HTTP2, WebSocket, TLS, FastCGI, etc.
- Content based routing, support user-defined routing rule in advanced domain-specific language.
- Support multiple load balancing policies.
- Flexible plugin framework to extend functionality. Based on the framework, developer can add new features rapidly.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.0
0.12.0
2 changes: 1 addition & 1 deletion bfe_balance/bal_gslb/bal_gslb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package bal_gslb

import (
"encoding/json"
"io/ioutil"
"net"
"testing"
Expand All @@ -27,6 +26,7 @@ import (
"github.com/bfenetworks/bfe/bfe_config/bfe_cluster_conf/cluster_table_conf"
"github.com/bfenetworks/bfe/bfe_config/bfe_cluster_conf/gslb_conf"
"github.com/bfenetworks/bfe/bfe_http"
"github.com/bfenetworks/bfe/bfe_util/json"
)

func loadJson(path string, v interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion bfe_balance/bal_slb/bal_rr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package bal_slb

import (
"encoding/json"
"fmt"
"math/rand"
"reflect"
Expand All @@ -25,6 +24,7 @@ import (
import (
"github.com/bfenetworks/bfe/bfe_balance/backend"
"github.com/bfenetworks/bfe/bfe_config/bfe_cluster_conf/cluster_table_conf"
"github.com/bfenetworks/bfe/bfe_util/json"
)

func populateBackend(name, addr string, port int, avail bool) *backend.BfeBackend {
Expand Down
2 changes: 1 addition & 1 deletion bfe_balance/bal_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,6 @@ func (t *BalTable) GetVersions() BalVersion {
t.lock.RLock()
versions := t.versions
t.lock.RUnlock()

return versions
}
2 changes: 1 addition & 1 deletion bfe_basic/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ package action

import (
"bytes"
"encoding/json"
"fmt"
"strings"
)

import (
"github.com/bfenetworks/bfe/bfe_basic"
"github.com/bfenetworks/bfe/bfe_util/json"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion bfe_basic/action/action_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func ReqHostSuffixReplace(req *bfe_basic.Request, originSuffix, newSuffix string
if !strings.HasSuffix(hostname, originSuffix) {
return
}

hostname = strings.TrimSuffix(hostname, originSuffix) + newSuffix
req.HttpRequest.Host = hostname
}
2 changes: 1 addition & 1 deletion bfe_basic/action/action_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func ReqQueryAdd(req *bfe_basic.Request, params []string) {
// if RawQuery is empty, remove prefix "&"
req.HttpRequest.URL.RawQuery = addQueryString[1:]
} else {
req.HttpRequest.URL.RawQuery = req.HttpRequest.URL.RawQuery + addQueryString
req.HttpRequest.URL.RawQuery += addQueryString
}
}

Expand Down
4 changes: 2 additions & 2 deletions bfe_bufio/bufio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ func TestWriteString(t *testing.T) {
t.Error("WriteString", err)
}
s := "01234567890abcdefghijklmnopqrstuvwxyz"
if string(buf.Bytes()) != s {
t.Errorf("WriteString wants %q gets %q", s, string(buf.Bytes()))
if buf.String() != s {
t.Errorf("WriteString wants %q gets %q", s, buf.String())
}
}

Expand Down

0 comments on commit 7931440

Please sign in to comment.