Skip to content

Commit fec665a

Browse files
author
Xiaochong Wei
committed
Fix
1 parent 4ca014c commit fec665a

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

.github/workflows/prestocpp-worker-with-clp-connector-runtime-image-build.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,31 @@ jobs:
3030
tags: |
3131
type=raw,value=ubuntu-22.04
3232
33-
- name: "Build and push"
33+
- name: "Update Metadata for Runtime Image"
34+
id: "meta-runtime"
35+
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
36+
with:
37+
images: >-
38+
ghcr.io/${{github.repository}}/prestissimo-with-clp-connector-runtime
39+
tags: |
40+
type=raw,value=ubuntu-22.04
41+
42+
- name: Check for dependency changes in presto-native-execution
43+
id: dependency-changes
44+
run: |
45+
git fetch origin ${{ github.event.before }} --depth=1 || true
46+
dep_changed=false
47+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^presto-native-execution/scripts'; then
48+
dep_changed=true
49+
fi
50+
cd presto-native-execution/velox
51+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^scripts'; then
52+
dep_changed=true
53+
fi
54+
echo "dep-changed=${dep_changed}" >> $GITHUB_OUTPUT
55+
56+
- name: "Build and push dependency image"
57+
if: steps.dependency-changes.outputs.dep-changed == 'true'
3458
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
3559
with:
3660
context: "./presto-native-execution/"
@@ -41,20 +65,16 @@ jobs:
4165
tags: "${{steps.meta-dependency.outputs.tags}}"
4266
labels: "${{steps.meta-dependency.outputs.labels}}"
4367

44-
- name: "Update Metadata for Runtime Image"
45-
id: "meta-runtime"
46-
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
47-
with:
48-
images: >-
49-
ghcr.io/${{github.repository}}/prestissimo-with-clp-connector-runtime
50-
tags: |
51-
type=raw,value=ubuntu-22.04
68+
- name: Get number of CPU
69+
id: get-cores
70+
run: |
71+
echo "num-threads=$(nproc)" >> $GITHUB_OUTPUT
5272
53-
- name: "Build and push"
73+
- name: "Build and push runtime image"
5474
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
5575
with:
5676
build-args: |-
57-
NUM_THREADS=4
77+
NUM_THREADS=${{ steps.get-cores.outputs.num-threads }}
5878
DEPENDENCY_IMAGE=${{ steps.meta-dependency.outputs.tags }}
5979
BASE_IMAGE=ubuntu:22.04
6080
OSNAME=ubuntu

presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ FROM ${BASE_IMAGE}
3939
ENV BUILD_BASE_DIR=_build
4040
ENV BUILD_DIR=""
4141

42+
# TODO: This is a temporary fix for issue: https://github.com/prestodb/presto/issues/25531
43+
# When there is a proper fix, update this piece of code.
44+
RUN apt-get update && \
45+
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata && \
46+
ln -snf /usr/share/zoneinfo/America/Toronto /etc/localtime && \
47+
echo "America/New_York" > /etc/timezone && \
48+
apt-get clean && \
49+
rm -rf /var/lib/apt/lists/*
50+
4251
COPY --chmod=0775 --from=prestissimo-image /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server /usr/bin/
4352
COPY --chmod=0775 --from=prestissimo-image /runtime-libraries/* /usr/lib64/prestissimo-libs/
4453
COPY --chmod=0755 ./etc /opt/presto-server/etc

0 commit comments

Comments
 (0)