Skip to content

Commit

Permalink
docs: Documents shutdown strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
andyquinterom committed Oct 3, 2024
1 parent 8754bf4 commit d53dff0
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 19 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ jobs:
TAG_R: ixpantia/faucet:r4.4
TAG_LATEST: ixpantia/faucet:latest
run: |
# Extract the minor version (e.g., from 1.2.3 to 1.2)
TAG_MINOR=$(echo "${{ github.ref_name }}" | cut -d'.' -f1-2)
docker buildx build \
--platform $PLATFORM \
--push \
-t $TAG_V \
-t $TAG_R \
-t $TAG_LATEST \
-t $TAG_MINOR \
--build-arg R_VERSION=4.4 \
.
build-r43:
Expand All @@ -93,11 +97,16 @@ jobs:
TAG_R: ixpantia/faucet:r4.3
TAG_LATEST: ixpantia/faucet:latest
run: |
# Extract the minor version (e.g., from 1.2.3 to 1.2)
TAG_MINOR=$(echo "${{ github.ref_name }}" | cut -d'.' -f1-2)
docker buildx build \
--platform $PLATFORM \
--push \
-t $TAG_V \
-t $TAG_R \
-t $TAG_LATEST \
-t $TAG_MINOR \
--build-arg R_VERSION=4.3 \
.
build-r42:
Expand All @@ -122,11 +131,16 @@ jobs:
TAG_V: ixpantia/faucet:${{ github.ref_name }}-r4.2
TAG_R: ixpantia/faucet:r4.2
run: |
# Extract the minor version (e.g., from 1.2.3 to 1.2)
TAG_MINOR=$(echo "${{ github.ref_name }}" | cut -d'.' -f1-2)
docker buildx build \
--platform $PLATFORM \
--push \
-t $TAG_V \
-t $TAG_R \
-t $TAG_LATEST \
-t $TAG_MINOR \
--build-arg R_VERSION=4.2 \
.
build-r41:
Expand All @@ -151,11 +165,16 @@ jobs:
TAG_V: ixpantia/faucet:${{ github.ref_name }}-r4.1
TAG_R: ixpantia/faucet:r4.1
run: |
# Extract the minor version (e.g., from 1.2.3 to 1.2)
TAG_MINOR=$(echo "${{ github.ref_name }}" | cut -d'.' -f1-2)
docker buildx build \
--platform $PLATFORM \
--push \
-t $TAG_V \
-t $TAG_R \
-t $TAG_LATEST \
-t $TAG_MINOR \
--build-arg R_VERSION=4.1 \
.
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,29 +140,14 @@ set in Nginx.
faucet start --dir /path/to/plumber/api --ip-from x-forwarded-for
```

## Environment Variables

Every option / flag can also be set using an environment variable, this is useful
for example when using Docker.

| Option / Flag | Environment Variable | Description |
| ------------- | -------------------- | ---------------------------------------------- |
| `--dir` | `FAUCET_DIR` | Path to application |
| `--host` | `FAUCET_HOST` | Host and port to bind the server to |
| `--workers` | `FAUCET_WORKERS` | Number of workers to spawn |
| `--strategy` | `FAUCET_STRATEGY` | Load balancing strategy |
| `--type` | `FAUCET_TYPE` | Type of application (shiny or plumber) |
| `--ip-from` | `FAUCET_IP_FROM` | Header or method to get the client IP address |
| `--rscript` | `FAUCET_RSCRIPT` | Path to Rscript executable |

## Installation

### Option 1: Binary Download (Linux)

Download the latest release of faucet for Linux from the [GitHub Releases page](https://github.com/ixpantia/faucet/releases). This should work with most Linux distributions.

```bash
FAUCET_VERSION="v1.0.0"
FAUCET_VERSION="v1.1.0"

wget https://github.com/ixpantia/faucet/releases/download/$FAUCET_VERSION/faucet-x86_64-unknown-linux-musl -O faucet

Expand All @@ -186,7 +171,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2. Install faucet with Cargo.

```bash
cargo install faucet-server --version ^1.0
cargo install faucet-server --version ^1.1
```

### Option 3: Build from Source (Linux, macOS, Windows)
Expand Down
13 changes: 13 additions & 0 deletions docs/en/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,16 @@ multiple versions of R installed on your system. This should be the full path
to the `Rscript` binary/executable or an alias that is available in your
`$PATH`. This is also useful in platforms like _Windows_ where the `Rscript`
binary/executable may not be available in the `$PATH`.

## Shutdown

- CLI: `--shutdown`
- Environment: `FAUCET_SHUTDOWN`
- Default: `immediate`
- Possible values:
- `immediate`
- `graceful`

The strategy used for shutting down faucet. `immediate` kills every
active connection and shutdown the process. `graceful` waits
for all connections to close before shutting down.
12 changes: 12 additions & 0 deletions docs/es/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,15 @@ aplicación. También puede ser útil en plataformas como _Windows_ donde el
ejecutable de `Rscript` no está en el `PATH`.


## Apagado

- CLI: `--shutdown`
- Entorno: `FAUCET_SHUTDOWN`
- Por defecto: `immediate`
- Valores posibles:
- `immediate`
- `graceful`

La estrategia que debería utilizar faucet para apagarse. `immediate`
apaga el servidor interrumpiendo cualquier conexión active. `graceful`
espera a que no existan conexiones activas para apagarse.
2 changes: 1 addition & 1 deletion examples/plumber_in_packages/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ixpantia/faucet:v0.5.0-r4.3
FROM ixpantia/faucet:r4.3

RUN Rscript -e "install.packages('remotes')" && \
Rscript -e "remotes::install_github(\"sol-eng/plumbpkg\")"
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ extra_css:
- stylesheets/extra.css

extra:
FAUCET_VERSION: v1.0.0
FAUCET_VERSION: v1.1.0

0 comments on commit d53dff0

Please sign in to comment.