-
Notifications
You must be signed in to change notification settings - Fork 34
DevOps ~ Building ABLATE Dependencies Locally
Matt McGurn edited this page Aug 3, 2023
·
8 revisions
When testing for PETSc or other dependencies api changes it is often useful to build the docker dependency file locally for testing.
-
Install docker locally using the official docker or alternative:
-
Build the CHREST BaseImage
- Clone chrest-base-image
- From cloned chrest-base-image directory build the chrest-base-image image
docker buildx build . --file Dockerfile --tag=chrest-base-image-local --load
-
Building Petsc-Docker
- Clone petcs-docker
- From cloned pets-docker directory build the petsc-docker image
docker buildx build . --file Dockerfile --tag=petsc-build-local --build-arg CHREST_BASE_IMAGE=chrest-base-image-local --load
- The following build arguments can be set when building using the
--build-arg argument_name=value
Build Argument Description Example Values PETSC_BUILD_COMMIT the branch/commit of PETSc to build main,099c1ef3aaa CC c complier gcc,clang CXX c++ complier g++,clang++ Index64Bit enables –with-64-bit-indices flag in PETSc 0,1 DEBUGFLAGS optional debug build flags "-g -O0" OPTFLAGS optional opt build flags "-g -O" -
Build ABLATE Dependency Image
- Within the ablate directory build the ablateDepencyFile using the new petsc-build image
docker build . --file DockerDependencyFile --tag=ablate-dependencies-local --build-arg PETSC_BASE_IMAGE=petsc-build-local
-
Build and test ABLATE Test File
- Within the ablate directory build the AblateTestFile using the new dependency image
docker build -t ablate_testing_image-local -f DockerTestFile . --build-arg ABLATE_DEPENDENCY_IMAGE=ablate-dependencies-local
- Run all ABLATE tests with the built image
docker run --rm ablate_testing_image-local
- Individual tests can be run using interactive docker mode
docker run -it --rm ablate_testing_image-local /bin/bash