Skip to content

Commit

Permalink
Merge branch 'main' into janpio/introspection-warning-rewording
Browse files Browse the repository at this point in the history
  • Loading branch information
janpio committed May 13, 2024
2 parents 7a9ecde + e9771e6 commit 6a0c59c
Show file tree
Hide file tree
Showing 181 changed files with 2,184 additions and 812 deletions.
2 changes: 1 addition & 1 deletion .buildkite/engineer
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fi
# Check if the system has engineer installed, if not, use a local copy.
if ! type "engineer" &> /dev/null; then
# Setup Prisma engine build & test tool (engineer).
curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.66/latest/$OS/engineer.gz" --output engineer.gz
curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.67/latest/$OS/engineer.gz" --output engineer.gz
gzip -d engineer.gz
chmod +x engineer

Expand Down
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export FMT_SQL=1 # Uncomment it to enable logging formatted SQL queries

### Uncomment to run driver adapters tests. See query-engine-driver-adapters.yml workflow for how tests run in CI.
# export EXTERNAL_TEST_EXECUTOR="napi"
# export DRIVER_ADAPTER=pg # Set to pg, neon or planetscale
# export DRIVER_ADAPTER=pg # Set to pg, neon, planetscale, libsql or cfd1
# export PRISMA_DISABLE_QUAINT_EXECUTORS=1 # Disable quaint executors for driver adapters
# export DRIVER_ADAPTER_URL_OVERRIDE ="postgres://USER:PASSWORD@DATABASExxxx" # Override the database url for the driver adapter tests

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-engines-apple-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
ref: ${{ github.event.inputs.commit }}

- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-engines-apple-silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
ref: ${{ github.event.inputs.commit }}

- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install aarch64 toolchain
run: rustup target add aarch64-apple-darwin
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/build-engines-react-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build Engines for React native
on:
workflow_dispatch:
inputs:
commit:
description: "Commit on the given branch to build"
required: false

jobs:
build-ios:
# Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit
name: "iOS build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}"
runs-on: macos-14

steps:
- name: Output link to real commit
run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }}

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}

- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
targets: x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-ios-cargo-${{ hashFiles('**/Cargo.lock') }}

- run: |
cd query-engine/query-engine-c-abi
make ios
- uses: actions/upload-artifact@v4
with:
name: ios
path: |
${{ github.workspace }}/query-engine/query-engine-c-abi/ios/*
build-android:
# Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit
name: "Android build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}"
runs-on: ubuntu-latest

steps:
- name: Output link to real commit
run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }}

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android

- uses: nttld/setup-ndk@v1
with:
ndk-version: r26d

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-android-cargo-${{ hashFiles('**/Cargo.lock') }}

- run: |
cd query-engine/query-engine-c-abi
make android
- uses: actions/upload-artifact@v4
with:
name: android
path: |
${{ github.workspace }}/query-engine/query-engine-c-abi/android/*
combine-artifacts:
# Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit
name: "Combine iOS and Android artifacts on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}"
runs-on: ubuntu-latest
needs:
- build-ios
- build-android
steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Upload combined artifact
uses: actions/upload-artifact@v4
with:
name: binaries
path: |
${{ github.workspace }}/ios
${{ github.workspace }}/android
2 changes: 1 addition & 1 deletion .github/workflows/build-engines-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
ref: ${{ github.event.inputs.commit }}

- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/cache@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install cargo-codspeed
run: cargo install cargo-codspeed
Expand All @@ -31,7 +31,7 @@ jobs:
run: cargo codspeed build -p schema --features all_connectors

- name: "Build the benchmark targets: request-handlers"
run: cargo codspeed build -p request-handlers --features native,all
run: cargo codspeed build -p request-handlers --features all

- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
targets: wasm32-unknown-unknown
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Check formatting
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/include/rust-wasm-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
shell: bash
run: |
cargo binstall -y \
wasm-bindgen-cli@0.2.89 \
wasm-bindgen-cli@0.2.92 \
wasm-opt@0.116.0
- name: Install bc
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Validate renovate.json"
on:
pull_request:
paths:
- "renovate.json"

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.0.1
with:
strict: "false"
2 changes: 1 addition & 1 deletion .github/workflows/test-compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- run: "cargo clean && cargo build --release -p schema-engine-cli"
name: "Compile Migration Engine"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-quaint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
features:
- "--lib --features=all"
- "--lib --features=all-native"
env:
TEST_MYSQL: "mysql://root:prisma@localhost:3306/prisma"
TEST_MYSQL8: "mysql://root:prisma@localhost:3307/prisma"
Expand All @@ -27,7 +27,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/cache@v4
with:
Expand All @@ -38,7 +38,7 @@ jobs:
key: ${{ runner.os }}-cargo-${{ matrix.features }}

- name: Start Databases
run: docker-compose -f docker-compose.yml up -d
run: docker compose -f docker-compose.yml up -d
working-directory: ./quaint

- name: Sleep for 20s
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-query-engine-black-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: "Start ${{ matrix.database.name }} (${{ matrix.engine_protocol }})"
run: make start-${{ matrix.database.name }}

- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- run: export WORKSPACE_ROOT=$(pwd) && cargo build --package query-engine
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-query-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest

- name: Login to Docker Hub
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-schema-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest

- name: Login to Docker Hub
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest

- name: Login to Docker Hub
Expand Down Expand Up @@ -206,9 +206,9 @@ jobs:
fail-fast: false
matrix:
db:
- name: mysql
- name: "mysql-lts"
url: "mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60"
- name: mariadb
- name: "mariadb"
url: "mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60"
rust:
- stable
Expand All @@ -221,7 +221,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest

- uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rust-lang/setup-rust-toolchain@v1

- run: |
cargo test --workspace --all-features \
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/wasm-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "*.md"
- "LICENSE"
- "CODEOWNERS"
- "renovate.json"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract Branch Name
run: |
branch="$(git show -s --format=%s | grep -o "DRIVER_ADAPTERS_BRANCH=[^ ]*" | cut -f2 -d=)"
Expand All @@ -59,11 +60,11 @@ jobs:
- name: Run benchmarks
id: bench
run: |
make run-bench | tee results.txt
make run-bench | tee results.txt
# Extract the values from the benchmark output
regressed_values=$(grep "slower than Web Assembly: Latest" results.txt | cut -f1 -d'x')
improved_values=$(grep "faster than Web Assembly: Latest" results.txt | cut -f1 -d'x')
regressed_values=$(grep "slower than Web Assembly: Latest" results.txt | cut -f1 -d'x')
improved_values=$(grep "faster than Web Assembly: Latest" results.txt | cut -f1 -d'x')
# Initialize sum variable and count
total_sum=0
Expand All @@ -85,7 +86,7 @@ jobs:
done
if [ $total_count -eq 0 ]; then
echo "💥 something was wrong running the benchmarks"
echo "💥 something was wrong running the benchmarks"
exit 1
fi
Expand All @@ -96,7 +97,7 @@ jobs:
echo "Total count: $total_count"
echo "Mean: $mean"
# Report improvement or worsening. Fails if >= 1.5% worsening.
# Report improvement or worsening. Fails if >= 1.5% worsening.
if (( $(echo "$mean < 0.985" | bc -l) )); then
percent=$(echo "scale=4; ((1 / $mean) - 1) * 100" | bc)
summary="❌ WASM query-engine performance will worsen by $(printf %.2f "$percent")%"
Expand Down
Loading

0 comments on commit 6a0c59c

Please sign in to comment.