Skip to content

Commit

Permalink
#97: fix missing variable in docker base image
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 6, 2024
1 parent efb33ce commit 0cf007b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/pushbasedockerimage_ubuntu_any-py_3.all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build & push base Docker image (add ubuntu_*-py.all images)

on:
push:
branches:
- 97-add-more-environments-to-test-in-ci

jobs:
push_to_registry:
name: Build & Push
runs-on: ubuntu-latest
env:
DOCKER_REPOSITORY: lifflander1/vt
strategy:
matrix:
image:
- ubuntu_22.04-gcc_11-vtk_9.2.2-py_3.all
- ubuntu_22.04-clang_11-vtk_9.2.2-py_3.all
- ubuntu_22.04-gcc_12-vtk_9.3.0-py_3.all
- ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.all
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Extract build configuration
run: |
IFS='_-' read -r -a CONFIG <<< "${{ matrix.image }}"
echo "BASE_IMAGE=${CONFIG[0]}:${CONFIG[1]}" >> $GITHUB_ENV
echo "CC=${CONFIG[2]}-${CONFIG[3]}" >> $GITHUB_ENV
if [[ "${CONFIG[2]}" == "gcc" ]]; then
echo "CXX=g++-${CONFIG[3]}" >> $GITHUB_ENV
echo "GCOV=gcov-${CONFIG[3]}" >> $GITHUB_ENV
elif [[ "${CONFIG[2]}" == "clang" ]]; then
echo "CXX=clang++-${CONFIG[3]}" >> $GITHUB_ENV
echo "GCOV=gcov" >> $GITHUB_ENV
else
exit 1
fi
echo "VTK_VERSION=${CONFIG[5]}" >> $GITHUB_ENV
if [[ "${CONFIG[7]}" == "3.all" ]]; then
echo "PYTHON_VERSIONS=3.8,3.9,3.10,3.11,3.12" >> $GITHUB_ENV
else
echo "PYTHON_VERSIONS=${CONFIG[7]}" >> $GITHUB_ENV
fi
echo "DOCKER_TAG=${{ matrix.image }}" >> $GITHUB_ENV
- name: Build configuration
run: |
echo "Base image: $BASE_IMAGE"
echo "C Compiler: $CC"
echo "CXX Compiler: $CXX"
echo "GCOV: $GCOV"
echo "VTK: $VTK_VERSION"
echo "Python: $PYTHON_VERSIONS"
echo "Docker tag: $DOCKER_TAG"
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push to Docker Hub
uses: docker/build-push-action@v6
with:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
CC=${{ env.CC }}
CXX=${{ env.CXX }}
GCOV=${{ env.GCOV }}
VTK_VERSION=${{ env.VTK_VERSION }}
PYTHON_VERSIONS=${{ env.PYTHON_VERSIONS }}
file: ci/docker/make-base-ubuntu.dockerfile
push: true
tags: "${{ env.DOCKER_REPOSITORY }}:${{ env.DOCKER_TAG }}"
2 changes: 1 addition & 1 deletion ci/docker/build-and-test-ubuntu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FROM test-cpp AS test-python
# Create vizualization output directory (required)
RUN mkdir -p /opt/src/vt-tv/output/python_tests
RUN VTK_DIR=/opt/build/vtk bash /opt/src/vt-tv/ci/python_build.sh
RUN bash /opt/src/vt-tv/ci/python_test.sh
RUN VTK_DIR=/opt/build/vtk bash bash /opt/src/vt-tv/ci/python_test.sh

# CI test script run
RUN DEBUG=ON ACTUAL=/opt/src/vt-tv/output/tests/default0.png EXPECTED=/opt/src/vt-tv/tests/expected/default/default0.png TOLERANCE=0.1 /opt/src/vt-tv/tests/test_image.sh
Expand Down
3 changes: 2 additions & 1 deletion ci/docker/make-base-ubuntu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ RUN apt-get update -y -q && \
RUN bash /opt/scripts/setup_mesa.sh
RUN xvfb-run bash -c "glxinfo | grep 'OpenGL version'"

# Environment variables (conda path, python environments, compiler path)
# Environment variables (conda path, python environments, compiler path, vtk)
ENV CC=/usr/bin/$CC
ENV CXX=/usr/bin/$CXX
ENV GCOV=/usr/bin/$GCOV
ENV CONDA_PATH=/opt/conda
ENV VTK_DIR=/opt/build/vtk

# Setup conda with python environments
RUN bash /opt/scripts/setup_conda.sh ${PYTHON_VERSIONS}
Expand Down
1 change: 0 additions & 1 deletion ci/python_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ VT_TV_SRC_DIR=${VT_TV_SRC_DIR:-$PARENT_DIR}
VT_TV_OUTPUT_DIR=${VT_TV_OUTPUT_DIR:-"$VT_TV_SRC_DIR/output"}

pushd $VT_TV_SRC_DIR
chmod +x ./ci/python_test.sh

# Create vizualization output directory (required).
mkdir -p $VT_TV_OUTPUT_DIR/python_tests
Expand Down

0 comments on commit 0cf007b

Please sign in to comment.