Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
428b88b
add @swc/core
KSDaemon Feb 7, 2025
473c0e8
remove unused
KSDaemon Feb 10, 2025
a1c2459
Convert transpiler worker to use swc/plugins
KSDaemon Feb 10, 2025
747c166
init swc plugins
KSDaemon Feb 10, 2025
bc9386e
Add passing contextSymbols to cube prop context transpiler
KSDaemon Feb 11, 2025
d5e398b
update build target to wasm32-wasip1 (as wasm32-wasi is deprecated)
KSDaemon Feb 11, 2025
d5aafd3
add basic readme
KSDaemon Feb 11, 2025
c877eb9
add regex crate
KSDaemon Feb 11, 2025
668ccf9
implement validation transpiler
KSDaemon Feb 11, 2025
0ad4598
tests for validation transpiler
KSDaemon Feb 11, 2025
623be19
implement check duplicate properties transpiler
KSDaemon Feb 11, 2025
6422042
tests for check duplicate properties transpiler
KSDaemon Feb 11, 2025
6393804
implement import-export-transpiler
KSDaemon Feb 12, 2025
ab7ee16
tests for import-export-transpiler
KSDaemon Feb 12, 2025
e7de90b
implement cube-property-ctx-transpiler
KSDaemon Feb 12, 2025
0d12996
tests for cube-property-ctx-transpiler
KSDaemon Feb 12, 2025
13ea8cd
fine tuned swc compiler
KSDaemon Feb 12, 2025
38792a2
update readmes
KSDaemon Feb 12, 2025
2520956
update CI to run swc tests
KSDaemon Feb 12, 2025
b741bcc
add .swc dir to ignore
KSDaemon Feb 12, 2025
30b54cb
fix err message and test
KSDaemon Feb 12, 2025
0882acc
fix for cube-prop
KSDaemon Feb 12, 2025
07d0ce7
more tests for cube-prop
KSDaemon Feb 12, 2025
f8777dc
sync versions
KSDaemon Feb 12, 2025
ae6b763
add wasm32-wasip1 target to rust setup
KSDaemon Feb 12, 2025
29ad79f
add isModule to swc config
KSDaemon Feb 12, 2025
538acfb
fix docker image builds for swc plugins
KSDaemon Feb 12, 2025
edd937b
fix docker ignore
KSDaemon Feb 12, 2025
99806aa
fix build cmd for swc plugins
KSDaemon Feb 13, 2025
3e26af0
fix import-export transpiler for export consts
KSDaemon Feb 13, 2025
f5f4aef
tests for export consts
KSDaemon Feb 13, 2025
7ae1449
attempt to fix build of dev image
KSDaemon Feb 13, 2025
ab07ec7
attempt to reduce layers number in dev.Dockerfile
KSDaemon Feb 13, 2025
2b7e519
implement wasm module cache for cube-prop-ctx-transpiler + optimize j…
KSDaemon Feb 13, 2025
e24ef9d
implement swc+cache+workerpool
KSDaemon Feb 13, 2025
a9a32b5
sync versions
KSDaemon Feb 13, 2025
af437b0
some refactoring/renaming
KSDaemon Feb 13, 2025
ed263d0
some refactoring/improvement
KSDaemon Feb 13, 2025
65d49ab
add useful links to readme
KSDaemon Feb 13, 2025
3a512cb
add Debug to TransformConfig
KSDaemon Feb 13, 2025
33b2a98
remove errorsReport from worker_thread as it is useless
KSDaemon Feb 13, 2025
d696202
add worker's cache
KSDaemon Feb 13, 2025
d0a2719
revert wasm module cache for cube-prop-ctx-transpile as it doesn't work
KSDaemon Feb 13, 2025
0b38b14
fix versions in cubestore
KSDaemon Feb 13, 2025
b076599
remove unused anymore
KSDaemon Feb 14, 2025
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
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
!rust/cubestore/package.json
!rust/cubestore/bin
!rust/cubesql/package.json
!rust/check-dup-prop-transpiler-swc-plugin/package.json
!rust/cube-prop-ctx-transpiler-swc-plugin/package.json
!rust/import-export-transpiler-swc-plugin/package.json
!rust/validation-transpiler-swc-plugin/package.json
!rust/check-dup-prop-transpiler-swc-plugin/Cargo.toml
!rust/cube-prop-ctx-transpiler-swc-plugin/Cargo.toml
!rust/import-export-transpiler-swc-plugin/Cargo.toml
!rust/validation-transpiler-swc-plugin/Cargo.toml
!rust/check-dup-prop-transpiler-swc-plugin/target/wasm32-wasip1/release/*.wasm
!rust/cube-prop-ctx-transpiler-swc-plugin/target/wasm32-wasip1/release/*.wasm
!rust/import-export-transpiler-swc-plugin/target/wasm32-wasip1/release/*.wasm
!rust/validation-transpiler-swc-plugin/target/wasm32-wasip1/release/*.wasm

# Ignoring builds for native from local machime to protect a problem with different architecture
packages/cubejs-backend-native/index.node
Expand All @@ -21,3 +33,8 @@ packages/*/dist/
packages/*/coverage/
# Other
packages/cubejs-server-core/playground/
# Rust swc caches
rust/check-dup-prop-transpiler-swc-plugin/target
rust/cube-prop-ctx-transpiler-swc-plugin/target
rust/import-export-transpiler-swc-plugin/target
rust/validation-transpiler-swc-plugin/target
2 changes: 1 addition & 1 deletion .github/workflows/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu wasm32-wasip1
cache: false
- uses: Swatinem/rust-cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu wasm32-wasip1
cache: false
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -189,7 +190,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
- name: Install Python
uses: actions/setup-python@v5
if: (matrix.python-version != 'fallback')
Expand Down Expand Up @@ -264,6 +265,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Python
uses: actions/setup-python@v5
if: (matrix.python-version != 'fallback')
Expand Down Expand Up @@ -618,7 +620,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-01-29
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down Expand Up @@ -705,7 +707,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-01-29
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
# override: true # this is by default on
rustflags: ""
components: rustfmt
Expand Down
55 changes: 54 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
- 'rust/cubeorchestrator/**'
- 'rust/cubeshared/**'
- 'rust/cubesqlplanner/**'
- 'rust/check-dup-prop-transpiler-swc-plugin/**'
- 'rust/cube-prop-ctx-transpiler-swc-plugin/**'
- 'rust/import-export-transpiler-swc-plugin/**'
- 'rust/validation-transpiler-swc-plugin/**'
- '.eslintrc.js'
- '.prettierrc'
- 'package.json'
Expand All @@ -32,6 +36,10 @@ on:
- 'rust/cubeorchestrator/**'
- 'rust/cubeshared/**'
- 'rust/cubesqlplanner/**'
- 'rust/check-dup-prop-transpiler-swc-plugin/**'
- 'rust/cube-prop-ctx-transpiler-swc-plugin/**'
- 'rust/import-export-transpiler-swc-plugin/**'
- 'rust/validation-transpiler-swc-plugin/**'
- '.eslintrc.js'
- '.prettierrc'
- 'package.json'
Expand Down Expand Up @@ -76,6 +84,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -111,6 +120,8 @@ jobs:
run: yarn tsc
- name: Build client
run: yarn build
- name: Build transpilers swc plugins
run: yarn lerna run build-swc-plugin
- name: Build cubejs-backend-native (with Python)
run: yarn run native:build-release-python
working-directory: ./packages/cubejs-backend-native
Expand Down Expand Up @@ -139,6 +150,18 @@ jobs:
# - name: Cargo test cubesqlplanner
# run: |
# cargo test --manifest-path rust/cubesqlplanner/cubesqlplanner/Cargo.toml -j 1
- name: Cargo test check-dup-prop-transpiler-swc-plugin
run: |
cargo test --manifest-path rust/check-dup-prop-transpiler-swc-plugin/Cargo.toml -j 1
- name: Cargo test cube-prop-ctx-transpiler-swc-plugin
run: |
cargo test --manifest-path rust/cube-prop-ctx-transpiler-swc-plugin/Cargo.toml -j 1
- name: Cargo test import-export-transpiler-swc-plugin
run: |
cargo test --manifest-path rust/import-export-transpiler-swc-plugin/Cargo.toml -j 1
- name: Cargo test validation-transpiler-swc-plugin
run: |
cargo test --manifest-path rust/validation-transpiler-swc-plugin/Cargo.toml -j 1

lint:
runs-on: ubuntu-20.04
Expand All @@ -156,6 +179,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -202,6 +226,18 @@ jobs:
# - name: Cargo fmt cubesqlplanner
# run: |
# cargo fmt --manifest-path rust/cubesqlplanner/cubesqlplanner/Cargo.toml -- --check
- name: Cargo fmt check-dup-prop-transpiler-swc-plugin
run: |
cargo fmt --manifest-path rust/check-dup-prop-transpiler-swc-plugin/Cargo.toml -- --check
- name: Cargo fmt cube-prop-ctx-transpiler-swc-plugin
run: |
cargo fmt --manifest-path rust/cube-prop-ctx-transpiler-swc-plugin/Cargo.toml -- --check
- name: Cargo fmt import-export-transpiler-swc-plugin
run: |
cargo fmt --manifest-path rust/import-export-transpiler-swc-plugin/Cargo.toml -- --check
- name: Cargo fmt validation-transpiler-swc-plugin
run: |
cargo fmt --manifest-path rust/validation-transpiler-swc-plugin/Cargo.toml -- --check

build:
runs-on: ubuntu-20.04
Expand All @@ -219,6 +255,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -418,6 +455,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -484,8 +522,11 @@ jobs:
matrix:
node-version: [ 20.x ]
python-version: [ 3.11 ]
transpile-worker-threads: [false, true]
fail-fast: false

env:
CUBEJS_TRANSPILATION_WORKER_THREADS: ${{ matrix.transpile-worker-threads }}
steps:
- name: Maximize build space (disk space limitations)
run: |
Expand All @@ -509,6 +550,14 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-07-15
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: wasm32-wasip1
- name: Install Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -540,6 +589,8 @@ jobs:
uses: GoodManWEN/oracle-client-action@main
- name: Build client
run: yarn build
- name: Build transpilers swc plugins
run: yarn lerna run build-swc-plugin
- name: Build cubejs-backend-native (with Python)
run: yarn run native:build-release-python
working-directory: ./packages/cubejs-backend-native
Expand Down Expand Up @@ -645,7 +696,7 @@ jobs:
# override: true # this is by default on
rustflags: ""
components: rustfmt
target: ${{ matrix.target }}
target: ${{ matrix.target }} wasm32-wasip1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -686,6 +737,8 @@ jobs:
run: yarn build
- name: Lerna tsc
run: yarn tsc
- name: Build transpilers swc plugins
run: yarn lerna run build-swc-plugin
- name: Build cubejs-backend-native (without Python)
run: yarn run native:build-release
working-directory: ./packages/cubejs-backend-native
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ rust/cubesql/profile.json
.cubestore
.env
.vimspector.json
.swc
19 changes: 12 additions & 7 deletions packages/cubejs-docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,14 @@ ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:$PATH

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- --profile minimal --default-toolchain nightly-2022-03-08 -y
sh -s -- --profile minimal --default-toolchain nightly-2022-03-08 -y --target wasm32-wasip1

ENV CUBESTORE_SKIP_POST_INSTALL=true
ENV NODE_ENV=development

WORKDIR /cubejs

COPY package.json .
COPY lerna.json .
COPY yarn.lock .
COPY tsconfig.base.json .
COPY rollup.config.js .
COPY packages/cubejs-linter packages/cubejs-linter
COPY package.json lerna.json yarn.lock tsconfig.base.json rollup.config.js ./

# Backend
COPY rust/cubesql/package.json rust/cubesql/package.json
Expand Down Expand Up @@ -88,6 +83,11 @@ COPY packages/cubejs-client-ngx/package.json packages/cubejs-client-ngx/package.
COPY packages/cubejs-client-ws-transport/package.json packages/cubejs-client-ws-transport/package.json
COPY packages/cubejs-playground/package.json packages/cubejs-playground/package.json

COPY rust/check-dup-prop-transpiler-swc-plugin/package.json rust/check-dup-prop-transpiler-swc-plugin/Cargo.toml rust/check-dup-prop-transpiler-swc-plugin/
COPY rust/cube-prop-ctx-transpiler-swc-plugin/package.json rust/cube-prop-ctx-transpiler-swc-plugin/Cargo.toml rust/cube-prop-ctx-transpiler-swc-plugin/
COPY rust/import-export-transpiler-swc-plugin/package.json rust/import-export-transpiler-swc-plugin/Cargo.toml rust/import-export-transpiler-swc-plugin/
COPY rust/validation-transpiler-swc-plugin/package.json rust/validation-transpiler-swc-plugin/Cargo.toml rust/validation-transpiler-swc-plugin/

RUN yarn policies set-version v1.22.22
# Yarn v1 uses aggressive timeouts with summing time spending on fs, https://github.com/yarnpkg/yarn/issues/4890
RUN yarn config set network-timeout 120000 -g
Expand Down Expand Up @@ -166,6 +166,11 @@ COPY packages/cubejs-client-ngx/ packages/cubejs-client-ngx/
COPY packages/cubejs-client-ws-transport/ packages/cubejs-client-ws-transport/
COPY packages/cubejs-playground/ packages/cubejs-playground/

COPY rust/check-dup-prop-transpiler-swc-plugin/ rust/check-dup-prop-transpiler-swc-plugin/
COPY rust/cube-prop-ctx-transpiler-swc-plugin/ rust/cube-prop-ctx-transpiler-swc-plugin/
COPY rust/import-export-transpiler-swc-plugin/ rust/import-export-transpiler-swc-plugin/
COPY rust/validation-transpiler-swc-plugin/ rust/validation-transpiler-swc-plugin/

RUN yarn build
RUN yarn lerna run build

Expand Down
10 changes: 10 additions & 0 deletions packages/cubejs-docker/testing-drivers.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ COPY packages/cubejs-ksql-driver/package.json packages/cubejs-ksql-driver/packag
COPY packages/cubejs-dbt-schema-extension/package.json packages/cubejs-dbt-schema-extension/package.json
COPY packages/cubejs-jdbc-driver/package.json packages/cubejs-jdbc-driver/package.json

COPY rust/check-dup-prop-transpiler-swc-plugin/package.json rust/check-dup-prop-transpiler-swc-plugin/package.json
COPY rust/cube-prop-ctx-transpiler-swc-plugin/package.json rust/cube-prop-ctx-transpiler-swc-plugin/package.json
COPY rust/import-export-transpiler-swc-plugin/package.json rust/import-export-transpiler-swc-plugin/package.json
COPY rust/validation-transpiler-swc-plugin/package.json rust/validation-transpiler-swc-plugin/package.json

# We dont need client libraries
#COPY packages/cubejs-templates/package.json packages/cubejs-templates/package.json
#COPY packages/cubejs-client-core/package.json packages/cubejs-client-core/package.json
Expand Down Expand Up @@ -147,6 +152,11 @@ COPY packages/cubejs-dbt-schema-extension/ packages/cubejs-dbt-schema-extension/
COPY packages/cubejs-jdbc-driver/ packages/cubejs-jdbc-driver/
COPY packages/cubejs-databricks-jdbc-driver/ packages/cubejs-databricks-jdbc-driver/

COPY rust/check-dup-prop-transpiler-swc-plugin/ rust/check-dup-prop-transpiler-swc-plugin/
COPY rust/cube-prop-ctx-transpiler-swc-plugin/ rust/cube-prop-ctx-transpiler-swc-plugin/
COPY rust/import-export-transpiler-swc-plugin/ rust/import-export-transpiler-swc-plugin/
COPY rust/validation-transpiler-swc-plugin/ rust/validation-transpiler-swc-plugin/

# We dont need client libraries
#COPY packages/cubejs-templates/ packages/cubejs-templates/
#COPY packages/cubejs-client-core/ packages/cubejs-client-core/
Expand Down
5 changes: 5 additions & 0 deletions packages/cubejs-schema-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"@babel/types": "^7.24",
"@cubejs-backend/native": "1.2.5",
"@cubejs-backend/shared": "1.2.5",
"@cubejs-backend/check-dup-prop-transpiler-swc-plugin": "1.2.5",
"@cubejs-backend/cube-prop-ctx-transpiler-swc-plugin": "1.2.5",
"@cubejs-backend/import-export-transpiler-swc-plugin": "1.2.5",
"@cubejs-backend/validation-transpiler-swc-plugin": "1.2.5",
"@swc/core": "^1.10.14",
"antlr4ts": "0.5.0-alpha.4",
"camelcase": "^6.2.0",
"cron-parser": "^4.9.0",
Expand Down
Loading
Loading