Skip to content

Commit

Permalink
Merge branch 'master' into rgibert/add-de-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Dec 11, 2023
2 parents 3678d77 + e60f1b7 commit 33c12c9
Show file tree
Hide file tree
Showing 16 changed files with 445 additions and 213 deletions.
568 changes: 397 additions & 171 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ default-members = ["crates/symbolicator", "crates/symbolicli", "crates/symsorter
[profile.release]
# For release builds, we do want line-only debug information to be able to symbolicate panic stack traces.
debug = 1
codegen-units = 1
lto = true

[profile.local]
# For running a local symbolicator, we want the best of both worlds: a fast executable, with quick
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ FROM symbolicator-chef AS symbolicator-build

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends build-essential ca-certificates curl libssl-dev pkg-config git zip \
&& apt-get install -y --no-install-recommends build-essential ca-certificates curl libssl-dev pkg-config git zip clang mold \
# below required for sentry-native
cmake clang libcurl4-openssl-dev \
&& rm -rf /var/lib/apt/lists/*

ARG SYMBOLICATOR_FEATURES=symbolicator-crash
ENV SYMBOLICATOR_FEATURES=${SYMBOLICATOR_FEATURES}
ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=/usr/bin/mold"

COPY --from=symbolicator-planner /work/recipe.json recipe.json

Expand Down
6 changes: 3 additions & 3 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ steps:
waitFor: ["builder"]
entrypoint: "bash"
args:
- '-c'
- "-c"
- |-
cp /opt/symbolicator-debug.zip /opt/symbolicator.src.zip .
Expand All @@ -55,7 +55,7 @@ steps:
waitFor: ["builder-extract-difs"]
entrypoint: "bash"
args:
- '-c'
- "-c"
- |-
gsutil -m cp \
./symbolicator-debug.zip ./symbolicator.src.zip \
Expand Down Expand Up @@ -111,7 +111,7 @@ images:
timeout: 3600s
options:
# Run on bigger machines
machineType: "N1_HIGHCPU_8"
machineType: "E2_HIGHCPU_32"
secrets:
- kmsKeyName: projects/sentryio/locations/global/keyRings/service-credentials/cryptoKeys/cloudbuild
secretEnv:
Expand Down
2 changes: 1 addition & 1 deletion crates/process-event/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ clap = { version = "4.3.2", features = ["derive"] }
reqwest = { version = "0.11.0", features = ["blocking", "json", "multipart", "trust-dns"] }
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
symbolic-common = "12.4.0"
symbolic-common = "12.7.1"
2 changes: 1 addition & 1 deletion crates/symbolicator-js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sentry = { version = "0.31.7", features = ["tracing"] }
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
sha2 = "0.10.6"
symbolic = { version = "12.4.0", features = ["common-serde", "sourcemapcache"] }
symbolic = { version = "12.7.1", features = ["common-serde", "sourcemapcache"] }
symbolicator-service = { path = "../symbolicator-service" }
symbolicator-sources = { path = "../symbolicator-sources" }
tempfile = "3.2.0"
Expand Down
8 changes: 4 additions & 4 deletions crates/symbolicator-native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ apple-crash-report-parser = "0.5.1"
async-trait = "0.1.53"
chrono = { version = "0.4.19", features = ["serde"] }
futures = "0.3.12"
minidump = "0.18.0"
minidump-processor = "0.18.0"
minidump-unwind = "0.18.0"
minidump = "0.19.1"
minidump-processor = "0.19.1"
minidump-unwind = "0.19.1"
moka = { version = "0.12.1", features = ["future", "sync"] }
once_cell = "1.18.0"
regex = "1.5.5"
sentry = { version = "0.31.7", features = ["tracing"] }
serde = { version = "1.0.137", features = ["derive", "rc"] }
symbolic = { version = "12.4.0", features = ["cfi", "common-serde", "debuginfo", "demangle", "symcache", "il2cpp", "ppdb"] }
symbolic = { version = "12.7.1", features = ["cfi", "common-serde", "debuginfo", "demangle", "symcache", "il2cpp", "ppdb"] }
symbolicator-service = { path = "../symbolicator-service" }
symbolicator-sources = { path = "../symbolicator-sources" }
tempfile = "3.2.0"
Expand Down
12 changes: 6 additions & 6 deletions crates/symbolicator-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ https = []

[dependencies]
anyhow = "1.0.57"
aws-config = "0.56.0"
aws-sdk-s3 = "0.33.0"
aws-types = "0.56.0"
aws-credential-types = { version = "0.56.0", features = ["hardcoded-credentials"] }
aws-config = { version = "1.0.1", features = ["behavior-version-latest"] }
aws-credential-types = { version = "1.0.1", features = ["hardcoded-credentials"] }
aws-sdk-s3 = "1.4.0"
aws-types = "1.0.1"
cadence = "0.29.0"
chrono = { version = "0.4.19", features = ["serde"] }
filetime = "0.2.16"
Expand All @@ -22,7 +22,7 @@ futures = "0.3.12"
gcp_auth = "0.9.0"
humantime = "2.1.0"
humantime-serde = "1.1.1"
idna = "0.4.0"
idna = "0.5.0"
ipnetwork = "0.20.0"
jsonwebtoken = "9.1.0"
moka = { version = "0.12.1", features = ["future", "sync"] }
Expand All @@ -34,7 +34,7 @@ serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
serde_yaml = "0.9.14"
sha2 = "0.10.6"
symbolic = { version = "12.4.0", features = ["cfi", "common-serde", "debuginfo", "symcache"] }
symbolic = { version = "12.7.1", features = ["cfi", "common-serde", "debuginfo", "symcache"] }
symbolicator-sources = { path = "../symbolicator-sources" }
tempfile = "3.2.0"
thiserror = "1.0.31"
Expand Down
3 changes: 2 additions & 1 deletion crates/symbolicator-service/src/caching/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl<T: CacheItemRequest> Cacher<T> {

if let Some(cache_dir) = self.config.cache_dir() {
// Cache is enabled, write it!
let mut cache_path = cache_dir.join(&cache_path);
let cache_path = cache_dir.join(&cache_path);

sentry::configure_scope(|scope| {
scope.set_extra(
Expand Down Expand Up @@ -258,6 +258,7 @@ impl<T: CacheItemRequest> Cacher<T> {

#[cfg(debug_assertions)]
{
let mut cache_path = cache_path;
// NOTE: we only create the metadata file once, but do not regularly touch it for now
cache_path.set_extension("txt");
if let Err(err) = std::fs::write(cache_path, key.metadata()) {
Expand Down
37 changes: 18 additions & 19 deletions crates/symbolicator-service/src/download/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ use aws_sdk_s3::error::ProvideErrorMetadata;
use aws_sdk_s3::error::SdkError;
use aws_sdk_s3::Client;
pub use aws_sdk_s3::Error as S3Error;
use futures::TryStreamExt;
use reqwest::StatusCode;

use futures::TryStreamExt as _;
use symbolicator_sources::{AwsCredentialsProvider, S3Region, S3RemoteFile, S3SourceKey};
use tokio::fs::File;

Expand Down Expand Up @@ -146,7 +144,7 @@ impl S3Downloader {

// NOTE: leaving the credentials empty as our unit / integration tests do
// leads to a `AuthorizationHeaderMalformed` error.
if matches!(status, StatusCode::FORBIDDEN | StatusCode::UNAUTHORIZED)
if matches!(status.as_u16(), 401 | 403)
|| code == Some("AuthorizationHeaderMalformed")
{
let details =
Expand All @@ -162,10 +160,6 @@ impl S3Downloader {
S3Error::NoSuchBucket(_) | S3Error::NoSuchKey(_) | S3Error::NotFound(_) => {
Err(CacheError::NotFound)
}
S3Error::Unhandled(unhandled) => {
let details = unhandled.to_string();
Err(CacheError::DownloadError(details))
}
_ => {
tracing::error!(
error = &err as &dyn std::error::Error,
Expand All @@ -179,21 +173,26 @@ impl S3Downloader {
}
};

let stream = if response.content_length == 0 {
if response.content_length == Some(0) {
tracing::debug!("Empty response from s3:{}{}", &bucket, &key);
return Err(CacheError::NotFound);
} else {
response
.body
.map_err(|err| CacheError::download_error(&err))
};
let future = super::download_stream(source_name, stream, destination);
}

let timeout = content_length_timeout(response.content_length, self.timeouts.streaming);
let timeout = response
.content_length
.map(|cl| content_length_timeout(cl, self.timeouts.streaming));

tokio::time::timeout(timeout, future)
.await
.map_err(|_| CacheError::Timeout(timeout))?
let mut body = std::pin::pin!(response.body);
let stream = futures::stream::poll_fn(move |cx| body.as_mut().poll_next(cx))
.map_err(|err| CacheError::download_error(&err));
let future = super::download_stream(source_name, stream, destination);

match timeout {
Some(timeout) => tokio::time::timeout(timeout, future)
.await
.map_err(|_| CacheError::Timeout(timeout))?,
None => future.await,
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/symbolicator-sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ license = "MIT"

[dependencies]
anyhow = "1.0.68"
aws-types = "0.56.0"
aws-types = "1.0.1"
glob = "0.3.0"
serde = { version = "1.0.137", features = ["derive", "rc"] }
symbolic = "12.4.0"
symbolic = "12.7.1"
url = { version = "2.2.0", features = ["serde"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hostname = "0.3.1"
sentry = { version = "0.31.7", features = ["anyhow", "debug-images", "tracing", "tower", "tower-http"] }
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
symbolic = "12.4.0"
symbolic = "12.7.1"
symbolicator-crash = { path = "../symbolicator-crash", optional = true }
symbolicator-js = { path = "../symbolicator-js" }
symbolicator-native = { path = "../symbolicator-native" }
Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ reqwest = { version = "0.11.12", features = ["json"] }
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
serde_yaml = "0.9.14"
symbolic = "12.4.0"
symbolic = "12.7.1"
symbolicator-js = { path = "../symbolicator-js" }
symbolicator-native = { path = "../symbolicator-native" }
symbolicator-service = { path = "../symbolicator-service" }
Expand Down
2 changes: 1 addition & 1 deletion crates/symsorter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rayon = "1.5.2"
regex = "1.5.5"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
symbolic = { version = "12.4.0", features = ["debuginfo-serde"] }
symbolic = { version = "12.7.1", features = ["debuginfo-serde"] }
walkdir = "2.3.1"
# NOTE: zip:0.6 by default depends on a version of zstd which conflicts with our other dependencies
zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2"] }
Expand Down
3 changes: 2 additions & 1 deletion gocd/templates/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"subdir": "libs"
}
},
"version": "v2.5"

"version": "v2.7"
}
],
"legacyImports": true
Expand Down
2 changes: 2 additions & 0 deletions gocd/templates/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
},
"version": "3bf82872351389af174fdc471e29768dc381b850",
"sum": "LHNV5r7rjuh9F06UtMawnq9Zn2RICJYEWSUIJ8OUqxg="
"version": "97af8955747da4f68ce4f70a5128b4e53956e9b2",
"sum": "qQiTUU6BkUbKBGblpBppxFBewhIqqQaWlz01ZTGEpi4="
}
],
"legacyImports": false
Expand Down

0 comments on commit 33c12c9

Please sign in to comment.