Skip to content

Commit

Permalink
Rename the library.
Browse files Browse the repository at this point in the history
  • Loading branch information
inikulin committed Jan 19, 2024
1 parent 74a986d commit 3475480
Show file tree
Hide file tree
Showing 78 changed files with 327 additions and 301 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "bedrock/src/security/libseccomp"]
path = bedrock/src/security/libseccomp
[submodule "foundations/src/security/libseccomp"]
path = foundations/src/security/libseccomp
url = https://github.com/seccomp/libseccomp.git
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[workspace]
members = [
"bedrock",
"bedrock-macros",
"foundations",
"foundations-macros",
"examples",
"tools/gen-syscall-enum"
]
resolver = "2"

[workspace.package]
version = "2.2.0"
repository = "https://bitbucket.cfdata.org/projects/OXY/repos/bedrock"
repository = "https://bitbucket.cfdata.org/projects/OXY/repos/foundations"
edition = "2021"
authors = ["Cloudflare"]

Expand All @@ -24,8 +24,8 @@ debug = 1

[workspace.dependencies]
anyhow = "1.0.75"
bedrock = { version = "2", path = "./bedrock" }
bedrock-macros = { version = "2", path = "./bedrock-macros" }
foundations = { version = "2", path = "./foundations" }
foundations-macros = { version = "2", path = "./foundations-macros" }
bindgen = { version = "0.68.1", default-features = false }
cc = "1.0"
clap = "4.4"
Expand All @@ -34,8 +34,9 @@ darling = "0.14"
erased-serde = "0.3.28"
futures-util = "0.3.28"
governor = "0.6"
hyper = { version = "0.14.27", default-features = false }
hyper = { version = "0.14", default-features = false }
indexmap = "2.0.0"
ipnetwork = "0.20"
once_cell = "1.5"
parking_lot = "0.12"
proc-macro2 = { version = "1", default-features = false }
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Bedrock
# Foundations

<p align="center">
<a href="https://github.com/cloudflare/bedrock">
<a href="https://github.com/cloudflare/foundations">
<img src="media/banner.png" alt="banner" style="width:472px; height: 375px" />
</a>
</p>

Bedrock is a foundational Rust library, designed to help scale programs for distributed,
Foundations is a foundational Rust library, designed to help scale programs for distributed,
production-grade systems. It enables engineers to concentrate on the core business logic
of their services, rather than the intricacies of production operation setups.

Expand All @@ -20,11 +20,11 @@ If you need any of those:
* service configuration with documentation
* CLI helper that takes care of the configuration loading

then Bedrock is a tool of choice for you.
then Foundations is a tool of choice for you.

## Documentation

https://docs.rs/bedrock/
https://docs.rs/foundations/


## License
Expand Down
6 changes: 3 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- 2024-01-02 OXY-1298: Disable MacOS build due to errors
- 2023-12-21 Add PID to root logger
- 2023-12-12 Drop zero histogram bucket
- 2023-11-30 TUN-8005: Document how to use jemalloc from bedrock
- 2023-11-30 TUN-8005: Document how to use jemalloc from foundations

2.1.0
- 2023-10-13 Release 2.1.0
Expand Down Expand Up @@ -66,7 +66,7 @@

1.2.0
- 2023-08-29 Release 1.2.0
- 2023-06-16 ROCK-4: Implement bedrock::telemetry::metrics
- 2023-06-16 ROCK-4: Implement foundations::telemetry::metrics
- 2023-08-29 Remove unnecessary cast
- 2023-08-23 ZTC-885: Updates heap profiling code slightly to be usable by oxy
- 2023-06-19 Fix unused_variables lint
Expand Down Expand Up @@ -116,7 +116,7 @@
- 2023-05-20 ROCK-9, ROCK-13 Part 1: Add the rest of the tracing API and document telemetry
- 2023-05-12 Move settings macro into the settings module
- 2023-05-12 ROCK-9, ROCK-10 Implement tracing internals and testing
- 2023-05-11 GATE-4093: change bedrock package version to use the standard indexed field
- 2023-05-11 GATE-4093: change foundations package version to use the standard indexed field
- 2023-05-04 ROCK-2 Implement logging
- 2023-05-02 Get rid of owned keys feature in slog to not introduce breaking changes
- 2023-05-02 ROCK-11 Add toggle to disable Debug impl in Settings macro
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false

[dev-dependencies]
anyhow = { workspace = true }
bedrock = { workspace = true }
foundations = { workspace = true }
futures-util = { workspace = true }
hyper = { workspace = true }
tokio = { workspace = true }
Expand Down
16 changes: 9 additions & 7 deletions examples/http_server/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ mod settings;

use self::settings::{EndpointSettings, HttpServerSettings, ResponseSettings};
use anyhow::anyhow;
use bedrock::cli::{Arg, ArgAction, Cli};
use bedrock::settings::collections::Map;
use bedrock::telemetry::{init_with_server, log, tracing, TelemetryContext};
use bedrock::BootstrapResult;
use foundations::cli::{Arg, ArgAction, Cli};
use foundations::settings::collections::Map;
use foundations::telemetry::{init_with_server, log, tracing, TelemetryContext};
use foundations::BootstrapResult;
use futures_util::stream::{FuturesUnordered, StreamExt};
use hyper::server::conn::Http;
use hyper::service::service_fn;
Expand All @@ -29,7 +29,7 @@ use tokio::net::{TcpListener, TcpStream};
#[tokio::main]
async fn main() -> BootstrapResult<()> {
// Obtain service information from Cargo.toml
let service_info = bedrock::service_info!();
let service_info = foundations::service_info!();

// Parse command line arguments. Add additional command line option that allows checking
// the config without running the server.
Expand Down Expand Up @@ -237,8 +237,10 @@ async fn respond(

#[cfg(target_os = "linux")]
fn sandbox_syscalls() -> BootstrapResult<()> {
use bedrock::security::common_syscall_allow_lists::{ASYNC, NET_SOCKET_API, SERVICE_BASICS};
use bedrock::security::{allow_list, enable_syscall_sandboxing, ViolationAction};
use foundations::security::common_syscall_allow_lists::{
ASYNC, NET_SOCKET_API, SERVICE_BASICS,
};
use foundations::security::{allow_list, enable_syscall_sandboxing, ViolationAction};

allow_list! {
static ALLOWED = [
Expand Down
2 changes: 1 addition & 1 deletion examples/http_server/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bedrock::telemetry::metrics::{metrics, Counter, Gauge};
use foundations::telemetry::metrics::{metrics, Counter, Gauge};
use std::sync::Arc;

#[metrics]
Expand Down
8 changes: 4 additions & 4 deletions examples/http_server/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//!
//! `examples/http_server/example_conf.yaml` file included in the repo shows generated default
//! config.
use bedrock::settings::collections::Map;
use bedrock::settings::net::SocketAddr;
use bedrock::settings::settings;
use bedrock::telemetry::settings::TelemetrySettings;
use foundations::settings::collections::Map;
use foundations::settings::net::SocketAddr;
use foundations::settings::settings;
use foundations::telemetry::settings::TelemetrySettings;

#[settings]
pub(crate) struct HttpServerSettings {
Expand Down
4 changes: 2 additions & 2 deletions bedrock-macros/Cargo.toml → foundations-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bedrock-macros"
description = "Procedural macros used by bedrock."
name = "foundations-macros"
description = "Procedural macros used by foundations."
version = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Default for MacroArgs {

impl MacroArgs {
fn default_crate_path() -> Path {
parse_quote!(::bedrock)
parse_quote!(::foundations)
}
}

Expand Down Expand Up @@ -76,7 +76,7 @@ pub(crate) fn expand(args: TokenStream, item: TokenStream) -> TokenStream {

fn expand_from_parsed(args: MacroArgs, struct_: Struct) -> Result<proc_macro2::TokenStream> {
let MacroArgs {
crate_path: bedrock,
crate_path: foundations,
name: metric_name,
} = args;

Expand All @@ -90,15 +90,15 @@ fn expand_from_parsed(args: MacroArgs, struct_: Struct) -> Result<proc_macro2::T

let metric_name = metric_name.unwrap_or_else(|| to_snake_case(&struct_name.to_string()));
let help = str::trim(&doc);
let serde_with = quote! { #bedrock::reexports_for_macros::serde_with };
let serde_with = quote! { #foundations::reexports_for_macros::serde_with };
let serde_with_str = LitStr::new(&serde_with.to_string(), Span::call_site());

let serde_as_attr = fields
.iter()
.any(|arg| arg.attrs.serde_as.is_some())
.then(|| quote! { #[#serde_with::serde_as(crate = #serde_with_str)] });

let serde = quote! { #bedrock::reexports_for_macros::serde };
let serde = quote! { #foundations::reexports_for_macros::serde };
let serde_str = LitStr::new(&serde.to_string(), Span::call_site());

Ok(quote! {
Expand All @@ -112,7 +112,7 @@ fn expand_from_parsed(args: MacroArgs, struct_: Struct) -> Result<proc_macro2::T
}

#(#cfg)*
impl #bedrock::telemetry::metrics::InfoMetric for #struct_name {
impl #foundations::telemetry::metrics::InfoMetric for #struct_name {
const NAME: &'static str = #metric_name;
const HELP: &'static str = #help;
}
Expand Down Expand Up @@ -171,11 +171,11 @@ mod tests {

let expected = code_str! {
#[doc = " Some info metric"]
#[derive(::bedrock::reexports_for_macros::serde::Serialize)]
#[serde(crate = ":: bedrock :: reexports_for_macros :: serde")]
#[derive(::foundations::reexports_for_macros::serde::Serialize)]
#[serde(crate = ":: foundations :: reexports_for_macros :: serde")]
struct SomeInfoMetric {}

impl ::bedrock::telemetry::metrics::InfoMetric for SomeInfoMetric {
impl ::foundations::telemetry::metrics::InfoMetric for SomeInfoMetric {
const NAME: &'static str = "some_info_metric";
const HELP: &'static str = "Some info metric";
}
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3475480

Please sign in to comment.