-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native] Add dockerfiles for dependencies and runtime and remove existing dockerfiles #21929
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
version: '3.5' | ||
|
||
services: | ||
ubuntu-native-dependency: | ||
# Usage: | ||
# docker-compose build ubuntu-native-dependency | ||
# podman compose build ubuntu-native-dependency | ||
image: presto/prestissimo-dependency:amd64-ubuntu-22.04 | ||
build: | ||
args: | ||
- BUILD_TYPE=Release | ||
context: . | ||
dockerfile: scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile | ||
|
||
ubuntu-native-runtime: | ||
# Usage: | ||
# docker-compose build ubuntu-native-runtime | ||
# podman compose build ubuntu-native-runtime | ||
image: presto/prestissimo-runtime:amd64-ubuntu-22.04 | ||
build: | ||
args: | ||
- BUILD_TYPE=Release | ||
- DEPENDENCY_IMAGE=presto/prestissimo-dependency:amd64-ubuntu-22.04 | ||
- BASE_IMAGE=amd64/ubuntu:22.04 | ||
- OSNAME=ubuntu | ||
context: . | ||
dockerfile: scripts/dockerfiles/prestissimo-runtime.dockerfile | ||
environment: | ||
NUM_THREADS: 8 # default value for NUM_THREADS | ||
|
||
centos-native-dependency: | ||
# Usage: | ||
# docker-compose build centos-native-dependency | ||
# podman compose build centos-native-dependency | ||
image: presto/prestissimo-dependency:centos8 | ||
build: | ||
args: | ||
- BUILD_TYPE=Release | ||
context: . | ||
dockerfile: scripts/dockerfiles/centos-8-stream-dependency.dockerfile | ||
|
||
centos-native-runtime: | ||
# Usage: | ||
# docker-compose build centos-native-runtime | ||
# podman compose build centos-native-runtime | ||
image: presto/prestissimo-runtime:centos8 | ||
build: | ||
args: | ||
- BUILD_TYPE=Release | ||
context: . | ||
dockerfile: scripts/dockerfiles/prestissimo-runtime.dockerfile | ||
environment: | ||
NUM_THREADS: 8 # default value for NUM_THREADS |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Prestissimo - Dockerfile build | ||
|
||
> 📝 _**Note:** Please post in Presto Slack if you have any questions_ | ||
|
||
There are two kinds of Dockerfiles: | ||
1) A platform specific file to build dependencies. Current supported platforms are | ||
1) Centos-8-stream with gcc9. | ||
2) Ubuntu-22.04 with gcc11. | ||
2) A platform-agnostic file to build Prestissimo runtime on top of the dependency image. | ||
### Dependency Dockerfiles | ||
These Dockerfiles install all the dependencies including those needed for testing. | ||
A list of dependencies can be found [here](../../README.md). | ||
By default, the dependencies are built in Release mode. | ||
The Dependency Image needs to be built only when some dependency is updated. | ||
Prestissimo dependencies change infrequently. | ||
|
||
### Runtime Dockerfile | ||
This Dockerfile builds Prestissimo on top of the dependency image. | ||
There are 2 stages: | ||
* The first stage builds the Prestissimo binary. | ||
* The second stage creates a Prestissimo runtime image from | ||
a base image and copies the binary and shared libraries that are required | ||
for execution. | ||
|
||
Run the following command to see the services available to build images. | ||
``` | ||
podman compose config --services | ||
``` | ||
|
||
## Quick Start | ||
|
||
### 1. Clone the Presto repository and checkout Prestissimo submodules | ||
|
||
```bash | ||
git clone https://github.com/prestodb/presto | ||
cd presto/presto-native-execution && make submodules | ||
``` | ||
|
||
### 2. Build Dependency Image using docker/podman compose | ||
|
||
Specify the build type using the ``BUILD_TYPE`` (defaults to Release) | ||
environment variable. | ||
|
||
```bash | ||
podman compose build centos-native-dependency | ||
``` | ||
|
||
### 3. Build Runtime Image | ||
|
||
Specify the build type using ``BUILD_TYPE`` (defaults to Release) | ||
environment variable. | ||
|
||
```bash | ||
podman compose build centos-native-runtime | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG DEPENDENCY_IMAGE=presto/prestissimo-dependency:centos8 | ||
ARG BASE_IMAGE=quay.io/centos/centos:stream8 | ||
FROM ${DEPENDENCY_IMAGE} as prestissimo-image | ||
|
||
ARG OSNAME=centos | ||
ARG BUILD_TYPE=Release | ||
ARG EXTRA_CMAKE_FLAGS='' | ||
ARG NUM_THREADS=8 | ||
|
||
ENV PROMPT_ALWAYS_RESPOND=n | ||
ENV BUILD_BASE_DIR=_build | ||
ENV BUILD_DIR="" | ||
|
||
RUN mkdir -p /prestissimo /runtime-libraries | ||
COPY . /prestissimo/ | ||
RUN EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} \ | ||
make -j${NUM_THREADS} --directory="/prestissimo/" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR} | ||
RUN ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }' | ||
|
||
#///////////////////////////////////////////// | ||
# prestissimo-runtime | ||
#////////////////////////////////////////////// | ||
|
||
FROM ${BASE_IMAGE} | ||
|
||
ENV BUILD_BASE_DIR=_build | ||
ENV BUILD_DIR="" | ||
|
||
COPY --chmod=0775 --from=prestissimo-image /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server /usr/local/bin/ | ||
COPY --chmod=0775 --from=prestissimo-image /runtime-libraries/* /usr/local/lib/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you update presto-native-execution/README.md since it has references to these deleted targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! done!