|
1 | 1 | name: data-generation run |
2 | | -run-name: data-generation run - sf${{ github.event.inputs.scale_factor }} - ${{ github.event.inputs.num_steps }} steps |
| 2 | +run-name: data-generation run - ${{ github.event.inputs.scenario }} - sf${{ github.event.inputs.scale_factor }} |
3 | 3 |
|
4 | 4 | on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + scenario: |
| 8 | + required: false |
| 9 | + default: 'tpch' |
| 10 | + type: string |
| 11 | + scale_factor: |
| 12 | + required: false |
| 13 | + default: '1.0' |
| 14 | + type: string |
| 15 | + bucket: |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + prefix: |
| 19 | + required: false |
| 20 | + default: 'data-gen' |
| 21 | + type: string |
| 22 | + max_concurrency: |
| 23 | + required: false |
| 24 | + default: '8' |
| 25 | + type: string |
| 26 | + region: |
| 27 | + required: false |
| 28 | + default: 'us-east-1' |
| 29 | + type: string |
| 30 | + skip_initial: |
| 31 | + required: false |
| 32 | + default: false |
| 33 | + type: boolean |
| 34 | + runner_type: |
| 35 | + required: false |
| 36 | + default: 'ubuntu-latest' |
| 37 | + type: string |
| 38 | + secrets: |
| 39 | + AWS_ACCESS_KEY_ID: |
| 40 | + required: true |
| 41 | + AWS_SECRET_ACCESS_KEY: |
| 42 | + required: true |
5 | 43 | workflow_dispatch: |
6 | 44 | inputs: |
| 45 | + scenario: |
| 46 | + description: 'Dataset/scenario to generate (e.g. tpch)' |
| 47 | + required: true |
| 48 | + default: 'tpch' |
| 49 | + type: string |
| 50 | + runner_type: |
| 51 | + description: 'GitHub runner label to execute on' |
| 52 | + required: false |
| 53 | + default: 'ubuntu-latest' |
| 54 | + type: string |
7 | 55 | scale_factor: |
8 | 56 | description: 'TPC-H scale factor' |
9 | 57 | required: true |
10 | 58 | default: '1.0' |
11 | 59 | type: string |
12 | | - num_steps: |
13 | | - description: 'Number of data generation steps' |
14 | | - required: false |
15 | | - default: '100' |
16 | | - type: string |
17 | 60 | bucket: |
18 | 61 | description: 'S3 bucket name' |
19 | 62 | required: true |
20 | 63 | type: string |
21 | 64 | prefix: |
22 | | - description: 'S3 key prefix for generated files' |
| 65 | + description: 'Base S3 key prefix for generated files (scenario is appended automatically)' |
23 | 66 | required: false |
24 | | - default: 'data-gen/tpch' |
| 67 | + default: 'data-gen' |
25 | 68 | type: string |
26 | 69 | max_concurrency: |
27 | 70 | description: 'Maximum number of concurrent S3 writes' |
|
42 | 85 | jobs: |
43 | 86 | run-data-generation: |
44 | 87 | name: Run data generation |
45 | | - runs-on: ${{ github.event.inputs.runner_type }} |
| 88 | + runs-on: ${{ inputs.runner_type || github.event.inputs.runner_type || 'ubuntu-latest' }} |
46 | 89 | timeout-minutes: 600 |
47 | 90 | steps: |
48 | 91 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 |
49 | 92 |
|
50 | | - - name: Install Rust |
51 | | - uses: dtolnay/rust-toolchain@stable |
| 93 | + - name: Cache data-generation binary |
| 94 | + id: cache-data-generation |
| 95 | + uses: actions/cache@v4 |
| 96 | + with: |
| 97 | + path: ~/.spice/bin/data-generation |
| 98 | + key: data-generation-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '**/*.rs') }} |
| 99 | + restore-keys: | |
| 100 | + data-generation-${{ runner.os }}- |
| 101 | +
|
| 102 | + - name: Setup Rust toolchain |
| 103 | + if: steps.cache-data-generation.outputs.cache-hit != 'true' |
| 104 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 105 | + with: |
| 106 | + toolchain: 1.91 |
| 107 | + cache: true |
52 | 108 |
|
53 | 109 | - name: Build data-generation |
54 | | - run: cargo build --release -p data-generation |
| 110 | + if: steps.cache-data-generation.outputs.cache-hit != 'true' |
| 111 | + run: | |
| 112 | + mkdir -p ~/.spice/bin |
| 113 | + cargo build --release -p data-generation |
| 114 | + install -m 755 target/release/data-generation ~/.spice/bin/data-generation |
55 | 115 |
|
56 | 116 | - name: Run data generation |
| 117 | + env: |
| 118 | + SCENARIO: ${{ inputs.scenario || github.event.inputs.scenario || 'tpch' }} |
| 119 | + SCALE_FACTOR: ${{ inputs.scale_factor || github.event.inputs.scale_factor || '1.0' }} |
| 120 | + BUCKET: ${{ inputs.bucket || github.event.inputs.bucket }} |
| 121 | + PREFIX_BASE: ${{ inputs.prefix || github.event.inputs.prefix || 'data-gen' }} |
| 122 | + MAX_CONCURRENCY: ${{ inputs.max_concurrency || github.event.inputs.max_concurrency || '8' }} |
| 123 | + REGION: ${{ inputs.region || github.event.inputs.region || 'us-east-1' }} |
| 124 | + SKIP_INITIAL: ${{ inputs.skip_initial || github.event.inputs.skip_initial || false }} |
| 125 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 126 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 127 | + RUST_LOG: info |
57 | 128 | run: | |
58 | | - ARGS="--scale-factor ${{ github.event.inputs.scale_factor }}" |
59 | | - ARGS="${ARGS} --num-steps ${{ github.event.inputs.num_steps }}" |
60 | | - ARGS="${ARGS} --bucket ${{ github.event.inputs.bucket }}" |
61 | | - ARGS="${ARGS} --prefix ${{ github.event.inputs.prefix }}" |
62 | | - ARGS="${ARGS} --max-concurrency ${{ github.event.inputs.max_concurrency }}" |
63 | | - ARGS="${ARGS} --region ${{ github.event.inputs.region }}" |
| 129 | + PREFIX="${PREFIX_BASE}" |
| 130 | + PREFIX="${PREFIX%/}/${SCENARIO}" |
64 | 131 |
|
65 | | - if [ "${{ github.event.inputs.skip_initial }}" = "true" ]; then |
| 132 | + ARGS="--dataset ${SCENARIO}" |
| 133 | + ARGS="${ARGS} --scale-factor ${SCALE_FACTOR}" |
| 134 | + ARGS="${ARGS} --bucket ${BUCKET}" |
| 135 | + ARGS="${ARGS} --prefix ${PREFIX}" |
| 136 | + ARGS="${ARGS} --max-concurrency ${MAX_CONCURRENCY}" |
| 137 | + ARGS="${ARGS} --region ${REGION}" |
| 138 | +
|
| 139 | + if [ "${SKIP_INITIAL}" = "true" ]; then |
66 | 140 | ARGS="${ARGS} --skip-initial" |
67 | 141 | fi |
68 | 142 |
|
69 | 143 | echo "Running: data-generation run ${ARGS}" |
70 | | - ./target/release/data-generation run ${ARGS} |
71 | | - env: |
72 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
73 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
74 | | - RUST_LOG: info |
| 144 | + ~/.spice/bin/data-generation run ${ARGS} |
0 commit comments