-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Dockerfile: llvm16 workarounds + doc + local test (#243)
* improve dockerfile and add a doc - improve Dockerfile ( new Alpine versions; workarounds LLVM 16 ) - add .dockerignore - add simple doc doc/docker_usage.md - add simple local ci ci/local_docker_matrix.sh * fix docker doc * add simple docker build test matrix * improve text in dockertest.yml
- Loading branch information
Showing
6 changed files
with
416 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Global excludes across all subdirectories | ||
**/*.o | ||
**/*.obj | ||
**/*.bc | ||
**/*.so | ||
**/*.so.[0-9] | ||
**/*.so.[0-9].[0-9] | ||
**/*.so.[0-9].[0-9][0-9] | ||
**/*.sl | ||
**/*.sl.[0-9] | ||
**/*.sl.[0-9].[0-9] | ||
**/*.sl.[0-9].[0-9][0-9] | ||
**/*.dylib | ||
**/*.dll | ||
**/*.exp | ||
**/*.a | ||
**/*.mo | ||
**/*.pot | ||
**/objfiles.txt | ||
**/.deps/ | ||
**/*.gcno | ||
**/*.gcda | ||
**/*.gcov | ||
**/*.gcov.out | ||
**/lcov*.info | ||
**/coverage/ | ||
**/coverage-html-stamp | ||
**/*.vcproj | ||
**/*.vcxproj | ||
**/win32ver.rc | ||
**/*.exe | ||
**/lib*dll.def | ||
**/lib*.pc | ||
|
||
# Local excludes in root directory | ||
t/__pycache__/ | ||
log/ | ||
log_docker_build/ | ||
results/ | ||
tmp_check/ | ||
tmp_check_iso/ | ||
output_iso/ | ||
include/utils/stopevents_defs.h | ||
include/utils/stopevents_data.h | ||
orioledb.typedefs | ||
!**/ci/antithesis/libvoidstar.so |
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,50 @@ | ||
name: dockerTEST | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test-docker-builds: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
postgres: [16, 13] | ||
compiler: [clang, gcc] | ||
alpine: [edge, 3.18, 3.13] | ||
|
||
name: docker ${{ matrix.postgres }}-${{ matrix.compiler }}-alpine${{ matrix.alpine }} | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.alpine == 'edge' }} | ||
|
||
steps: | ||
- name: Set DOCKER_PG_LLVM_DEPS | ||
run: | | ||
if [[ "${{ matrix.alpine }}" == "3.18" ]] || [[ "${{ matrix.alpine }}" == "edge" ]]; \ | ||
then echo "DOCKER_PG_LLVM_DEPS=llvm15-dev clang15" >> $GITHUB_ENV; \ | ||
else echo "DOCKER_PG_LLVM_DEPS=llvm-dev clang" >> $GITHUB_ENV; \ | ||
fi | ||
- name: Echo DOCKER_PG_LLVM_DEP | ||
run: echo "DOCKER_PG_LLVM_DEP = ${{ env.DOCKER_PG_LLVM_DEPS }} " | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: docker build orioletest:${{ matrix.postgres }}-${{ matrix.compiler }}-alpine${{ matrix.alpine }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: false | ||
pull: true | ||
tags: orioletest:${{ matrix.postgres }}-${{ matrix.compiler }}-alpine${{ matrix.alpine }} | ||
build-args: | | ||
ALPINE_VERSION=${{ matrix.alpine }} | ||
BUILD_CC_COMPILER=${{ matrix.compiler }} | ||
PG_MAJOR=${{ matrix.postgres }} | ||
DOCKER_PG_LLVM_DEPS=${{ env.DOCKER_PG_LLVM_DEPS }} |
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,45 @@ | ||
#!/usr/bin/env bash | ||
set -Eeo pipefail | ||
|
||
# Testing all possible docker builds on a local machine | ||
# run from project root: ./ci/local_docker_matrix.sh | ||
# and check the logs in ./log_docker_build/*.log | ||
|
||
# set and prepare $logpath for build logs | ||
logpath=./log_docker_build | ||
mkdir -p $logpath | ||
rm -f ${logpath}/*.log | ||
|
||
# simple local build matxix - for build all images | ||
for alpine in edge 3.18 3.17 3.16 3.15 3.14 3.13 ; do | ||
# Refresh alpine images! | ||
docker pull alpine:$alpine | ||
for pg_major in 16 15 14 13; do | ||
for compiler in clang gcc; do | ||
|
||
# LLVM 16 hack for setting the correct DOCKER_PG_LLVM_DEPS | ||
case "$alpine" in 3.18 | edge ) pg_llvm_deps='llvm15-dev clang15' ;; \ | ||
* ) pg_llvm_deps='llvm-dev clang' ;; \ | ||
esac ; \ | ||
|
||
docker_tag="${pg_major}-${compiler}-alpine${alpine}" | ||
echo "------------ $docker_tag ------------------" | ||
echo "params: ALPINE_VERSION=$alpine" | ||
echo "params: BUILD_CC_COMPILER=$compiler" | ||
echo "params: PG_MAJOR=$pg_major" | ||
echo "params: DOCKER_PG_LLVM_DEPS=$pg_llvm_deps" | ||
echo "----------------------------------------" | ||
|
||
rm -f ${logpath}/${docker_tag}.log | ||
time docker build --network=host --progress=plain \ | ||
--build-arg ALPINE_VERSION="$alpine" \ | ||
--build-arg BUILD_CC_COMPILER="$compiler" \ | ||
--build-arg PG_MAJOR="$pg_major" \ | ||
--build-arg DOCKER_PG_LLVM_DEPS="$pg_llvm_deps" \ | ||
-t orioletest:${docker_tag} . 2>&1 | tee ${logpath}/${docker_tag}.log | ||
|
||
done | ||
done | ||
done | ||
|
||
docker images orioletest:* | sort |
Oops, something went wrong.