AliceVision icon indicating copy to clipboard operation
AliceVision copied to clipboard

Add new Dockerfile and configure GH action to build & push

Open hammady opened this issue 2 years ago • 1 comments
trafficstars

Description

This PR introduces the following:

  1. A brand new Dockerfile (docker/Dockerfile_ubuntu_new) to build alicevision from scratch on the latest Ubuntu and CUDA.
  2. A new GitHub action which automatically builds a docker image and pushes it to ghcr.io on every push to the specified branches. This requires a secret to be configured by the repo owner: GHCR_PUSH_TOKEN which is a PAT with the packages:write action. This can be easily changed to push to Docker Hub if desired (or both). This has been tested thoroughly on my fork (check here). Moreover, tests can be run from the build arguments by setting the env var: RUN_TESTS to ON which is done in the latest run.
  3. Attempts to fix the old Dockerfiles, but I ended up disabling them in the GH action. I recommend removing them altogether.
  4. A new CMake build variable AV_BUILD_VPX which defaults to ON and controls the build of libvpx in case someone wants to install it externally and skip its build (I did this in the new Dockerfile).
  5. Fixed a bug in docker/check-cpu.sh which was causing builds to always use 1 CPU regardless of number of available CPUs on the build machine. I am not using it anyway in the new Dockerfile, but it was hard to miss!
  6. Removed dependency on the docker/build* scripts which is not the recommended way of invoking docker builds as they should be self-contained and independent of the host OS.

Features list

  1. New Docker build
  2. New GitHub action
  3. Some bug fixes

Implementation remarks

hammady avatar Feb 25 '23 23:02 hammady

Hi @hammady , Thanks for the nice contribution! That's really helpful. I have already cherry-picked 2 commits into https://github.com/alicevision/AliceVision/pull/1325 and it's merged into develop. It's better if you directly modify the Dockerfil_ubuntu, we don't need to maintain multiple ubuntu versions. Can you contact me at [email protected]? I like the idea of using the ci to push on dockerhub, but maybe only for AliceVision and not for the deps. I would like to discuss that with you and see in detail how we can get your PR merged. Thanks!

fabiencastan avatar Mar 20 '23 11:03 fabiencastan