Skip to content

Commit

Permalink
[GLUTEN-7514][VL] Reorganize Dockerfiles and document how to build gl…
Browse files Browse the repository at this point in the history
…uten in docker (#7515)
  • Loading branch information
PHILO-HE authored Oct 16, 2024
1 parent 072ba7e commit 66bb774
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 187 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
- main
paths:
- '.github/workflows/docker_image.yml'
- 'dev/docker/Dockerfile.centos7-static-build'
- 'dev/docker/Dockerfile.centos8-dynamic-build'
schedule:
- cron: '0 20 * * 0'

Expand All @@ -45,7 +47,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: dev/vcpkg/docker/Dockerfile.gha
file: dev/docker/Dockerfile.centos7-static-build
push: true
tags: apache/gluten:vcpkg-centos-7

Expand All @@ -69,6 +71,6 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: .github/workflows/docker/Dockerfile.gha
file: dev/docker/Dockerfile.centos8-dynamic-build
push: true
tags: apache/gluten:centos-8
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ thirdparty/*.tar*
CMakeFiles/
CMakeCache.txt
CTestTestfile.cmake
Makefile
cmake_install.cmake
build/
*-build/
Expand Down
3 changes: 3 additions & 0 deletions dev/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!/vcpkg/setup-build-depends.sh
!/docker/entrypoint.sh
4 changes: 2 additions & 2 deletions dev/vcpkg/docker/Dockerfile → dev/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM centos:7
RUN sed -i "s/enabled=1/enabled=0/" /etc/yum/pluginconf.d/fastestmirror.conf

WORKDIR /tmp/vcpkg
COPY setup-build-depends.sh setup-build-depends.sh
COPY vcpkg/setup-build-depends.sh setup-build-depends.sh
RUN ./setup-build-depends.sh

WORKDIR /
Expand All @@ -22,4 +22,4 @@ USER ${BUILDER_UID}:${BUILDER_GID}
ENV VCPKG_BINARY_SOURCES=default
COPY docker/entrypoint.sh /entrypoint
ENTRYPOINT ["/entrypoint"]
CMD ["sleep", "inf"]
CMD ["sleep", "inf"]
File renamed without changes.
File renamed without changes.
20 changes: 13 additions & 7 deletions dev/vcpkg/Makefile → dev/docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOCKER_IMAGE=apache/gluten:vcpkg-centos-7
DOCKER_IMAGE=apache/gluten:centos-7-vcpkg-build-depends
GLUTEN_REPO=$(shell realpath -L ../..)

CCACHE_DIR=$(HOME)/.ccache
Expand All @@ -17,26 +17,32 @@ build: $(CCACHE_DIR) $(VCPKG_BINARY_CACHE_DIR) $(MAVEN_M2_DIR)
-e http_proxy \
-e https_proxy \
--workdir $(GLUTEN_REPO) \
-ti \
$(DOCKER_IMAGE) \
./dev/package-vcpkg.sh

docker-image:
docker build \
--file docker/Dockerfile \
--file Dockerfile \
--build-arg BUILDER_UID=`id -u` \
--build-arg BUILDER_GID=`id -g` \
--tag "$(DOCKER_IMAGE)" \
.
..

docker-image-gha:
docker-image-static-build:
docker build \
--file docker/Dockerfile.gha \
--tag "$(DOCKER_IMAGE)" \
--file Dockerfile.centos7-static-build \
--tag "apache/gluten:vcpkg-centos-7" \
--build-arg HTTPS_PROXY="" \
--build-arg HTTP_PROXY="" \
.

docker-image-dynamic-build:
docker build \
--file Dockerfile.centos8-dynamic-build \
--tag "apache/gluten:centos-8" \
--build-arg HTTPS_PROXY="" \
--build-arg HTTP_PROXY="" \
.

$(CCACHE_DIR) $(VCPKG_BINARY_CACHE_DIR) $(MAVEN_M2_DIR): %:
mkdir -p $@
File renamed without changes.
5 changes: 0 additions & 5 deletions dev/vcpkg/.dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion docs/developers/ProfileMemoryOfGlutenWithVelox.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Profile memory consumption of Gluten
nav_order: 15
nav_order: 8
has_children: true
parent: /developer-overview/
---
Expand Down
53 changes: 0 additions & 53 deletions docs/developers/docker_centos7.md

This file was deleted.

49 changes: 0 additions & 49 deletions docs/developers/docker_centos8.md

This file was deleted.

65 changes: 0 additions & 65 deletions docs/developers/docker_ubuntu22.04.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/developers/velox-backend-CI.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
layout: page
title: Velox Backend CI
nav_order: 14
nav_order: 6
parent: Developer Overview
---
# Velox Backend CI

GHA workflows are defined under `.github/workflows/`.

## Docker Build
We have a weekly job to build a docker based on `Dockerfile.gha` for CI verification, defined in `docker_image.yml`.
We have a weekly job defined in `docker_image.yml` to build docker images based on `Dockerfile.centos7-static-build` and `Dockerfile.centos8-dynamic-build` for CI verification.

## Vcpkg Caching
Gluten main branch is pulled down during docker build. And vcpkg will cache binary data of all dependencies defined under dev/vcpkg.
Expand Down
21 changes: 21 additions & 0 deletions docs/developers/velox-backend-build-in-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: page
title: Build Gluten Velox backend in docker
nav_order: 7
parent: Developer Overview
---

Currently, Centos-7/8/9 and Ubuntu 20.04/22.04 are supported to build Gluten Velox backend. Please refer to
`.github/workflows/velox_weekly.yml` to install required tools before the build.

There are two docker images with almost all dependencies installed, respective for static build and dynamic build.
The according Dockerfiles are respectively `Dockerfile.centos7-static-build` and `Dockerfile.centos8-dynamic-build`
under `dev/docker/`.

```shell
# For static build on centos-7.
docker pull apache/gluten:vcpkg-centos-7

# For dynamic build on centos-8.
docker pull apache/gluten:centos-8 (dynamic build)
```

0 comments on commit 66bb774

Please sign in to comment.