Skip to content

Commit

Permalink
Merge branch 'main' into zp/fix-conn-for-user
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Feb 6, 2023
2 parents 08bbc18 + 4f54a70 commit d9eb72c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 88 deletions.
54 changes: 0 additions & 54 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions ci/scripts/common.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ export PROTOC_NO_VENDOR=true
export CARGO_HOME=/risingwave/.cargo
export RISINGWAVE_CI=true
export RUST_BACKTRACE=1
if [ -n "${BUILDKITE_COMMIT:-}" ]; then
export GIT_SHA=$BUILDKITE_COMMIT
fi
2 changes: 1 addition & 1 deletion ci/scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dockerhubaddr="risingwavelabs/risingwave"
arch="$(uname -m)"

echo "--- docker build and tag"
docker build -f docker/Dockerfile -t "${ghcraddr}:${BUILDKITE_COMMIT}-${arch}" --target risingwave .
docker build -f docker/Dockerfile --build-arg "GIT_SHA=${BUILDKITE_COMMIT}" -t "${ghcraddr}:${BUILDKITE_COMMIT}-${arch}" --target risingwave .

echo "--- check the image can start correctly"
container_id=$(docker run -d "${ghcraddr}:${BUILDKITE_COMMIT}-${arch}" playground)
Expand Down
2 changes: 2 additions & 0 deletions ci/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ steps:
run: rw-build-env
config: ci/docker-compose.yml
mount-buildkite-agent: true
env:
- BUILDKITE_COMMIT
timeout_in_minutes: 20
retry: *auto-retry

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ENV PATH /root/.cargo/bin/:$PATH

ENV IN_CONTAINER=1

ARG GIT_SHA
ENV GIT_SHA=$GIT_SHA

# We need to add the `rustfmt` dependency, otherwise `risingwave_pb` will not compile
RUN rustup self update \
&& rustup set profile minimal \
Expand Down
5 changes: 0 additions & 5 deletions src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
build = "build.rs"

[dependencies]
anyhow = "1"
Expand Down Expand Up @@ -85,10 +84,6 @@ criterion = "0.4"
rand = "0.8"
tempfile = "3"

[build-dependencies]
anyhow = "1"
vergen = { version = "7.5", default-features = false, features = ["git"] }

[[bench]]
name = "bench_encoding"
harness = false
Expand Down
23 changes: 0 additions & 23 deletions src/common/build.rs

This file was deleted.

3 changes: 2 additions & 1 deletion src/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#![feature(portable_simd)]
#![feature(array_chunks)]
#![allow(incomplete_features)]
#![feature(const_option_ext)]

#[macro_use]
pub mod jemalloc;
Expand Down Expand Up @@ -62,4 +63,4 @@ pub mod test_prelude {

pub const RW_VERSION: &str = env!("CARGO_PKG_VERSION");

pub const GIT_SHA: &str = env!("VERGEN_GIT_SHA_SHORT");
pub const GIT_SHA: &str = option_env!("GIT_SHA").unwrap_or("unknown");
10 changes: 6 additions & 4 deletions src/tests/sqlsmith/src/sql_gen/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl<'a, R: Rng> SqlGenerator<'a, R> {
}

fn gen_with(&mut self) -> (Option<With>, Vec<Table>) {
match self.flip_coin() {
match self.rng.gen_bool(0.4) {
true => (None, vec![]),
false => {
let (with, tables) = self.gen_with_inner();
Expand Down Expand Up @@ -240,7 +240,7 @@ impl<'a, R: Rng> SqlGenerator<'a, R> {
// Generate CROSS JOIN
let mut lateral_contexts = vec![];
for _ in 0..self.tables.len() {
if self.flip_coin() {
if self.rng.gen_bool(0.3) {
let (table_with_join, mut table) = self.gen_from_relation();
from.push(table_with_join);
lateral_contexts.append(&mut table);
Expand All @@ -259,12 +259,14 @@ impl<'a, R: Rng> SqlGenerator<'a, R> {
}
}

/// GROUP BY will constrain the generated columns.
fn gen_group_by(&mut self) -> Vec<Expr> {
let mut available = self.bound_columns.clone();
if !available.is_empty() {
available.shuffle(self.rng);
let n_group_by_cols = self.rng.gen_range(1..=available.len());
let group_by_cols = available.drain(0..n_group_by_cols).collect_vec();
let upper_bound = (available.len() + 1) / 2;
let n = self.rng.gen_range(1..=upper_bound);
let group_by_cols = available.drain(..n).collect_vec();
self.bound_columns = group_by_cols.clone();
group_by_cols
.into_iter()
Expand Down

0 comments on commit d9eb72c

Please sign in to comment.