Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Book: Switch to docker cluster and adjust URIs
This aims to make development easier. Typically, developers run the
cluster from our docker compose, using `make up`. It would be great for
default URIs to match that, in order to not require passing
`SCYLLA_URI`. This requires changing CI: either to pass SCYLLA_URI, or
to use the docker cluster. For consistency, using docker cluster seemes
like a better option to me.
  • Loading branch information
Lorak-mmk committed Jan 19, 2026
commit e29cfdea99b6e8ea3b8390775171847e2f25a73d
10 changes: 4 additions & 6 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
scylladb:
image: scylladb/scylla
ports:
- 9042:9042
options: --health-cmd "cqlsh --debug scylladb" --health-interval 5s --health-retries 10
steps:
- uses: actions/checkout@v3
- name: Setup 3-node ScyllaDB cluster
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
docker compose -f test/cluster/docker-compose.yml up -d --wait
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/connecting/compression.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

let session: Session = SessionBuilder::new()
.known_node(uri)
Expand All @@ -30,4 +30,4 @@ async fn main() -> Result<(), Box<dyn Error>> {

Ok(())
}
```
```
2 changes: 1 addition & 1 deletion docs/source/connecting/connecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::net::{IpAddr, Ipv4Addr, SocketAddr};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

let session: Session = SessionBuilder::new()
.known_node(uri)
Expand Down
6 changes: 3 additions & 3 deletions docs/source/logging/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
tracing_subscriber::fmt::init();

let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

info!("Connecting to {}", uri);

Expand Down Expand Up @@ -80,7 +80,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
// verbosity.
env_logger::init();

let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "172.42.0.2:9042".to_string());
info!("Connecting to {}", uri);

let session: Session = SessionBuilder::new().known_node(uri).build().await?;
Expand All @@ -93,4 +93,4 @@ async fn main() -> Result<(), Box<dyn Error>> {
```

The full [example](https://github.com/scylladb/scylla-rust-driver/tree/main/examples/logging_log.rs) is available in the `examples` folder.
You can run it from main folder of driver repository using `RUST_LOG=trace SCYLLA_URI=<scylla_ip>:9042 cargo run --example logging_log`.
You can run it from main folder of driver repository using `RUST_LOG=trace SCYLLA_URI=<scylla_ip>:9042 cargo run --example logging_log`.
2 changes: 1 addition & 1 deletion docs/source/quickstart/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
// Create a new Session which connects to node at 127.0.0.1:9042
// (or SCYLLA_URI if specified)
let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

let session: Session = SessionBuilder::new()
.known_node(uri)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/schema/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Fetching database schema occurs periodically, but it can also be done on-demand.
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

let session: Session = SessionBuilder::new().known_node(uri).build().await?;
// Schema metadata will be fetched below
Expand Down Expand Up @@ -49,7 +49,7 @@ Example showing how to print obtained schema information:
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

let session: Session = SessionBuilder::new().known_node(uri).build().await?;
// Schema metadata will be fetched below
Expand Down
2 changes: 1 addition & 1 deletion docs/source/statements/timeouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use scylla::statement::unprepared::Statement;
use std::time::Duration;

let uri = std::env::var("SCYLLA_URI")
.unwrap_or_else(|_| "127.0.0.1:9042".to_string());
.unwrap_or_else(|_| "172.42.0.2:9042".to_string());

let no_timeout_profile_handle = ExecutionProfile::builder()
.request_timeout(None) // no timeout
Expand Down