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

🔥 Infinispan feature #330

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 0 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
services:
infinispan:
image: infinispan/server:11.0.9.Final
ports:
- 11222:11222
env:
USER: username
PASS: password
steps:
- uses: actions/checkout@v4
- uses: supercharge/[email protected]
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
services:
infinispan:
image: infinispan/server:11.0.9.Final
ports:
- 11222:11222
env:
USER: username
PASS: password
steps:
- uses: actions/checkout@v4
- uses: supercharge/[email protected]
Expand Down
131 changes: 1 addition & 130 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ Some tests need a redis deployed in `localhost:6379`. You can run it in Docker w
docker run --rm -p 6379:6379 -it redis
```

Some tests need a infinispan deployed in `localhost:11222`. You can run it in Docker with:
```bash
docker run --rm -p 11222:11222 -it -e USER=username -e PASS=password infinispan/server:11.0.9.Final
```

Then, run the tests:

```bash
Expand Down
53 changes: 0 additions & 53 deletions doc/server/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,31 +248,6 @@ Options:
-h, --help Print help
```

#### `infinispan` optional storage - _experimental_

The default binary will _not_ support [Infinispan](https://infinispan.org/) as a storage backend for counters. If you
want to give it a try, you would need to build your own binary of the server using:

```commandline
cargo build --release --features=infinispan
```

Which will add the `infinispan` to the supported `STORAGES`.

```
USAGE:
limitador-server <LIMITS_FILE> infinispan [OPTIONS] <URL>

ARGS:
<URL> Infinispan URL to use

OPTIONS:
-n, --cache-name <cache name> Name of the cache to store counters in [default: limitador]
-c, --consistency <consistency> The consistency to use to read from the cache [default:
Strong] [possible values: Strong, Weak]
-h, --help Print help information
```

For an in-depth coverage of the different topologies supported and how they affect the behavior, see the
[topologies' document](../topologies.md).

Expand Down Expand Up @@ -406,34 +381,6 @@ require Redis.
- Format: `enum`: `"debug"`, `"error"`, `"info"`, `"warn"`, or `"trace"`.


### When built with the `infinispan` feature - _experimental_

#### `INFINISPAN_CACHE_NAME`

- The name of the Infinispan cache that Limitador will use to store limits and
counters. This variable applies only when [`INFINISPAN_URL`](#infinispan_url) is
set.
- Optional. By default, Limitador will use a cache called `"limitador"`.
- Format: `string`.


#### `INFINISPAN_COUNTERS_CONSISTENCY`

- Defines the consistency mode for the Infinispan counters created by Limitador.
This variable applies only when [`INFINISPAN_URL`](#infinispan_url) is set.
- Optional. Defaults to `"strong"`.
- Format: `enum`: `"Strong"` or `"Weak"`.


#### `INFINISPAN_URL`

- Infinispan URL. Required only when you want to use Infinispan to store the
limits.
- Optional. By default, Limitador stores the limits in memory and does not
require Infinispan.
- Format: `URL`, in the format of `http://username:[email protected]:11222`.


#### `RATE_LIMIT_HEADERS`

- Enables rate limit response headers. Only supported by the RLS server.
Expand Down
3 changes: 0 additions & 3 deletions limitador-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ documentation = "https://kuadrant.io/docs/limitador"
readme = "README.md"
edition = "2021"

[features]
infinispan = ["limitador/infinispan_storage"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
9 changes: 0 additions & 9 deletions limitador-server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::process::Command;
fn main() -> Result<(), Box<dyn Error>> {
set_git_hash("LIMITADOR_GIT_HASH");
set_profile("LIMITADOR_PROFILE");
set_features("LIMITADOR_FEATURES");
generate_protobuf()
}

Expand All @@ -26,14 +25,6 @@ fn generate_protobuf() -> Result<(), Box<dyn Error>> {
Ok(())
}

fn set_features(env: &str) {
let mut features = vec![];
if cfg!(feature = "infinispan") {
features.push("+infinispan");
}
println!("cargo:rustc-env={env}={features:?}");
}

fn set_profile(env: &str) {
if let Ok(profile) = std::env::var("PROFILE") {
println!("cargo:rustc-env={env}={profile}");
Expand Down
4 changes: 0 additions & 4 deletions limitador-server/sandbox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ deploy-redis-otel: clean ## Uses Redis to store counters, instrumented with open
deploy-disk: clean ## Uses disk to store counters
$(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-disk.yaml up

deploy-infinispan: clean ## Uses Infinispan to store counters
$(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-infinispan.yaml up

##@ Helper targets

build: ## Build "limitador-testing" image
Expand Down Expand Up @@ -76,7 +73,6 @@ clean-containers: ## clean containers
- $(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-memory.yaml down --volumes --remove-orphans
- $(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-redis.yaml down --volumes --remove-orphans
- $(DOCKER)_compose -f docker-compose-envoy.yaml -f docker-compose-limitador-redis-cached.yaml down --volumes --remove-orphans
- $(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-infinispan.yaml down --volumes --remove-orphans
- $(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-disk.yaml down --volumes --remove-orphans
- $(DOCKER) compose -f docker-compose-envoy.yaml -f docker-compose-limitador-redis-otel.yaml down --volumes --remove-orphans
- $(MAKE) cleancerts
Expand Down
1 change: 0 additions & 1 deletion limitador-server/sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Check out `make help` for all the targets.
| Redis Secured | `make deploy-redis-tls` | Uses Redis with TLS and password protected to store counters |
| Redis Cached | `make deploy-redis-cached` | Uses Redis to store counters, with an in-memory cache |
| Redis Otel Instrumented | `make deploy-redis-otel` | Uses redis to store counters, [instrumented with opentelemetry](redis-otel/README.md) |
| Infinispan | `make deploy-infinispan` | Uses Infinispan to store counters |
| Disk | `make deploy-disk` | Uses disk to store counters |

### Limitador's admin HTTP endpoint
Expand Down
Loading
Loading