Skip to content

Commit 89ce0f3

Browse files
ci: Build Presto coordinator and Presttimo worker runtime images. (#26)
Co-authored-by: kirkrodrigues <[email protected]>
1 parent 6613d6c commit 89ce0f3

File tree

3 files changed

+144
-2
lines changed

3 files changed

+144
-2
lines changed

.github/workflows/maven-checks.yml

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,70 @@ jobs:
4646
run: |
4747
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
4848
./mvnw install -B -V -T 1C -DskipTests -Dmaven.javadoc.skip=true --no-transfer-progress -P ci -pl '!presto-test-coverage,!:presto-docs'
49-
- name: Clean Maven Output
50-
run: ./mvnw clean -pl '!:presto-server,!:presto-cli,!presto-test-coverage'
49+
- name: "Upload presto-server"
50+
if: matrix.java == '8.0.442'
51+
uses: "actions/upload-artifact@v4"
52+
with:
53+
name: "presto-server"
54+
path: "presto-server/target/presto-server-0.293.tar.gz"
55+
if-no-files-found: "error"
56+
retention-days: 1
57+
- name: "Upload presto-cli"
58+
if: matrix.java == '8.0.442'
59+
uses: "actions/upload-artifact@v4"
60+
with:
61+
name: "presto-cli"
62+
path: "presto-cli/target/presto-cli-0.293-executable.jar"
63+
if-no-files-found: "error"
64+
retention-days: 1
65+
- name: "Clean Maven output"
66+
run: "./mvnw clean -pl '!:presto-server,!:presto-cli,!presto-test-coverage'"
67+
68+
presto-coordinator-image:
69+
name: "presto-coordinator-image"
70+
needs: "maven-checks"
71+
runs-on: "ubuntu-22.04"
72+
steps:
73+
- uses: "actions/checkout@v4"
74+
with:
75+
submodules: "recursive"
76+
77+
- name: "Download presto-server"
78+
uses: "actions/download-artifact@v4"
79+
with:
80+
name: "presto-server"
81+
path: "./docker"
82+
83+
- name: "Download presto-cli"
84+
uses: "actions/download-artifact@v4"
85+
with:
86+
name: "presto-cli"
87+
path: "./docker"
88+
89+
- name: "Login to image registry"
90+
uses: "docker/login-action@v3"
91+
with:
92+
registry: "ghcr.io"
93+
username: "${{github.actor}}"
94+
password: "${{secrets.GITHUB_TOKEN}}"
95+
96+
- name: "Set up container image metadata"
97+
id: "meta"
98+
uses: "docker/metadata-action@v5"
99+
with:
100+
images: "ghcr.io/${{github.repository}}/coordinator"
101+
tags: "type=raw,value=dev"
102+
103+
- name: "Build and push"
104+
uses: "docker/build-push-action@v6"
105+
with:
106+
build-args: |-
107+
JMX_PROMETHEUS_JAVA_AGENT_VERSION=0.20.0
108+
PRESTO_VERSION=0.293
109+
context: "./docker"
110+
file: "./docker/Dockerfile"
111+
push: >-
112+
${{github.event_name != 'pull_request'
113+
&& github.ref == 'refs/heads/release-0.293-clp-connector'}}
114+
tags: "${{steps.meta.outputs.tags}}"
115+
labels: "${{steps.meta.outputs.labels}}"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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}}"

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

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

42+
# Temporary fix for https://github.com/prestodb/presto/issues/25531
43+
# TODO: Update this code when there's a proper fix
44+
RUN apt-get update && \
45+
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata && \
46+
apt-get clean && \
47+
rm -rf /var/lib/apt/lists/*
48+
4249
COPY --chmod=0775 --from=prestissimo-image /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server /usr/bin/
4350
COPY --chmod=0775 --from=prestissimo-image /runtime-libraries/* /usr/lib64/prestissimo-libs/
4451
COPY --chmod=0755 ./etc /opt/presto-server/etc

0 commit comments

Comments
 (0)