|
| 1 | +name: "prestissimo-worker-images-build" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + |
| 7 | +jobs: |
| 8 | + prestissimo-worker-images-build: |
| 9 | + name: "prestissimo-worker-images-build" |
| 10 | + runs-on: "ubuntu-22.04" |
| 11 | + steps: |
| 12 | + - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" |
| 13 | + with: |
| 14 | + submodules: "recursive" |
| 15 | + |
| 16 | + - name: "Login to image registry" |
| 17 | + uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772" |
| 18 | + with: |
| 19 | + registry: "ghcr.io" |
| 20 | + username: "${{github.actor}}" |
| 21 | + password: "${{secrets.GITHUB_TOKEN}}" |
| 22 | + |
| 23 | + - name: "Set up metadata for dependency image" |
| 24 | + id: "metadata-deps-image" |
| 25 | + uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804" |
| 26 | + with: |
| 27 | + images: "ghcr.io/${{github.repository}}/prestissimo-worker-dev-env" |
| 28 | + tags: "type=raw,value=dev" |
| 29 | + |
| 30 | + - name: "Build and push dependency image" |
| 31 | + uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4" |
| 32 | + with: |
| 33 | + context: "./presto-native-execution" |
| 34 | + file: "./presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile" |
| 35 | + push: >- |
| 36 | + ${{github.event_name != 'pull_request' |
| 37 | + && github.ref == 'refs/heads/release-0.293-clp-connector'}} |
| 38 | + tags: "${{steps.metadata-deps-image.outputs.tags}}" |
| 39 | + labels: "${{steps.metadata-deps-image.outputs.labels}}" |
| 40 | + |
| 41 | + - name: "Set up metadata for runtime image" |
| 42 | + id: "metadata-runtime-image" |
| 43 | + uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804" |
| 44 | + with: |
| 45 | + images: "ghcr.io/${{github.repository}}/prestissimo-worker" |
| 46 | + tags: "type=raw,value=dev" |
| 47 | + |
| 48 | + - name: "Get number of cores" |
| 49 | + id: "get-cores" |
| 50 | + run: |- |
| 51 | + echo "num_cores=$(nproc)" >> $GITHUB_OUTPUT |
| 52 | +
|
| 53 | + - name: "Build and push runtime image" |
| 54 | + uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4" |
| 55 | + with: |
| 56 | + build-args: |- |
| 57 | + BASE_IMAGE=ubuntu:22.04 |
| 58 | + DEPENDENCY_IMAGE=${{steps.metadata-deps-image.outputs.tags}} |
| 59 | + EXTRA_CMAKE_FLAGS=-DPRESTO_ENABLE_TESTING=OFF \ |
| 60 | + -DPRESTO_ENABLE_PARQUET=ON \ |
| 61 | + -DPRESTO_ENABLE_S3=ON |
| 62 | + NUM_THREADS=${{steps.get-cores.outputs.num_cores}} |
| 63 | + OSNAME=ubuntu |
| 64 | + context: "./presto-native-execution" |
| 65 | + file: "./presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile" |
| 66 | + push: >- |
| 67 | + ${{github.event_name != 'pull_request' |
| 68 | + && github.ref == 'refs/heads/release-0.293-clp-connector'}} |
| 69 | + tags: "${{steps.metadata-runtime-image.outputs.tags}}" |
| 70 | + labels: "${{steps.metadata-runtime-image.outputs.labels}}" |
0 commit comments