Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7459ac5
Enable go modules (#124)
stevesloka Mar 9, 2020
395e9e2
CI: Github Actions (#127)
stevesloka Mar 11, 2020
3343f57
community: update contributing guide (#139)
mattklein123 May 26, 2020
48b45a7
add http 1 `/json` endpoint (#136)
dblackdblack May 26, 2020
6dcfe70
Use mockgen version from go.mod instead of from "make bootstrap" (#143)
dweitzman May 27, 2020
dd2dcc7
Upgrade gostats dependency from 0.2.6 to 0.4.0 (#141)
dweitzman May 27, 2020
265c596
Upgrade radix (#137)
May 28, 2020
adc8a04
cache_impl_test.go: fix failing test with ipv6 (#144)
dweitzman May 29, 2020
46fe2f1
Split redis-specific logic from generic key-value store logic (#142)
dweitzman May 29, 2020
23f32b5
json handler: return full ratelimit service response as json (#148)
dweitzman Jun 12, 2020
4a6c402
Update goruntime to latest, 0.2.5. Add new config for watching chang…
ysawa0 Jun 25, 2020
465e7bd
Drop support for legacy ratelimit.proto and upgrade to v3 rls.proto (…
Pchelolo Jul 1, 2020
af7b234
Followups to v3 upgrade (#155)
Jul 13, 2020
6e8dda7
Introduce a Dockerfile for running integration tests (#156)
dweitzman Jul 13, 2020
9281cc0
Add support for rate limit overrides. (#158)
Jul 14, 2020
e293fb3
redis client: default to use explicit pipelining (#163)
Aug 11, 2020
d95eea3
Clean go.mod file and update logrus to latest (#166)
ysawa0 Aug 25, 2020
c548990
Add full test environment example. Fix bug in existing docker-compose…
ysawa0 Sep 5, 2020
b065396
Implement LOG_FORMAT=json (#173)
svdba Sep 10, 2020
02ae72a
Add cluster support
Sep 15, 2020
c5f24c6
Fix tests
Sep 15, 2020
7d5ed80
Add documentation
Sep 16, 2020
4098dde
Update integration_test.go
kriti-shaw Sep 18, 2020
5e50b8a
Update Makefile
kriti-shaw Sep 18, 2020
a9decc4
fixes and debug statements
Sep 22, 2020
7017fcb
Update Makefile
kriti-shaw Sep 22, 2020
b15b97d
Fix integration tests: separate ports and enable implicit pipelining
Sep 23, 2020
68f8823
Create sentinel.conf
kriti-shaw Sep 23, 2020
cedd3a0
Create sentinel-pre-second.conf
kriti-shaw Sep 23, 2020
8ea3315
Update Makefile
kriti-shaw Sep 23, 2020
9b19bb1
Update README.md
kriti-shaw Sep 23, 2020
76467fe
Update driver_impl.go
kriti-shaw Sep 23, 2020
2a0dde2
Update integration_test.go
kriti-shaw Sep 23, 2020
f01202e
Update integration_test.go
kriti-shaw Sep 23, 2020
20a1788
Update README.md
kriti-shaw Sep 23, 2020
858bd4d
Update driver_impl.go
kriti-shaw Sep 23, 2020
b930783
Update integration_test.go
kriti-shaw Sep 23, 2020
2d2869d
Update integration_test.go
kriti-shaw Sep 23, 2020
76ac5a4
Update README.md
kriti-shaw Sep 23, 2020
27eb963
Update driver_impl.go
kriti-shaw Sep 23, 2020
cf50f23
Update integration_test.go
kriti-shaw Sep 24, 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
27 changes: 27 additions & 0 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and push :master image

on:
push:
branches:
- master

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check format
run: make check_format
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: build and push docker image
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
make docker_push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: master
21 changes: 21 additions & 0 deletions .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI Build and Test for PR

on:
pull_request:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check format
run: make check_format
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: build and test
run: |
make docker_tests
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and push :release image

on:
push:
tags:
- 'v*'

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check format
run: make check_format
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: build and push docker image
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
make docker_push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ cover.out
bin/
.idea/
vendor
cert.pem
key.pem
private.pem
redis-per-second.conf
redis.conf
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
This project is governed by [Lyft's code of conduct](https://github.com/lyft/code-of-conduct). All contributors and participants agree to abide by its terms.
## Community Code of Conduct

ratelimit follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
85 changes: 79 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,85 @@ We welcome contributions from the community. Here are some guidelines.

* Fork the repo and create your PR.
* Tests will automatically run for you.
* When all of the tests are passing, tag @lyft/network-team and we will review it and
merge once our CLA has been signed (see below).
* When all of the tests are passing, tag @envoyproxy/ratelimit-maintainers and
we will review it and merge.
* Party time.

# CLA
# DCO: Sign your work

* We require a CLA for code contributions, so before we can accept a pull request we need
to have a signed CLA. Please visit our [CLA service](https://oss.lyft.com/cla) and follow
the instructions to sign the CLA.
The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as an open-source patch. The rules are pretty simple: if you
can certify the below (from
[developercertificate.org](https://developercertificate.org/)):

```
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

then you just add a line to every git commit message:

Signed-off-by: Joe Smith <joe@gmail.com>

using your real name (sorry, no pseudonyms or anonymous contributions.)

You can add the sign off when creating the git commit via `git commit -s`.

If you want this to be automatic you can set up some aliases:

```bash
git config --add alias.amend "commit -s --amend"
git config --add alias.c "commit -s"
```

## Fixing DCO

If your PR fails the DCO check, it's necessary to fix the entire commit history in the PR. Best
practice is to [squash](https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)
the commit history to a single commit, append the DCO sign-off as described above, and [force
push](https://git-scm.com/docs/git-push#git-push---force). For example, if you have 2 commits in
your history:

```bash
git rebase -i HEAD^^
(interactive squash + DCO append)
git push origin -f
```

Note, that in general rewriting history in this way is a hindrance to the review process and this
should only be done to correct a DCO mistake.
37 changes: 37 additions & 0 deletions DCO
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
21 changes: 9 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
FROM golang:1.10.4 AS build
WORKDIR /go/src/github.com/lyft/ratelimit
FROM golang:1.14 AS build
WORKDIR /ratelimit

ENV GOPROXY=https://proxy.golang.org
COPY go.mod go.sum /ratelimit/
RUN go mod download

COPY src src
COPY script script
COPY vendor vendor
COPY glide.yaml glide.yaml
COPY glide.lock glide.lock
COPY proto proto

RUN script/install-glide
RUN glide install

RUN CGO_ENABLED=0 GOOS=linux go build -o /usr/local/bin/ratelimit -ldflags="-w -s" -v github.com/lyft/ratelimit/src/service_cmd
RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/ratelimit -ldflags="-w -s" -v github.com/envoyproxy/ratelimit/src/service_cmd

FROM alpine:3.8 AS final
FROM alpine:3.11 AS final
RUN apk --no-cache add ca-certificates
COPY --from=build /usr/local/bin/ratelimit /bin/ratelimit
COPY --from=build /go/bin/ratelimit /bin/ratelimit
17 changes: 17 additions & 0 deletions Dockerfile.integration
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Running this docker image runs the integration tests.
FROM golang:1.14

RUN apt-get update -y && apt-get install sudo stunnel4 redis -y && rm -rf /var/lib/apt/lists/*

WORKDIR /workdir

ENV GOPROXY=https://proxy.golang.org
COPY go.mod go.sum /workdir/
RUN go mod download

COPY Makefile /workdir
RUN make bootstrap

COPY src /workdir/src
COPY test /workdir/test
CMD make tests_with_redis
Loading