debug OpenFace build #10
Workflow file for this run
This file contains hidden or 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
| name: build-docker-images | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths-ignore: [ "*.md" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| paths-ignore: [ "*.md" ] | |
| workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| BUILDKIT_PROGRESS: "plain" # Full logs for CI build. | |
| REGISTRY_SRC: ${{ vars.REGISTRY_SRC || 'docker.io' }} # For BASE_NAMESPACE of images: where to pull base images from, docker.io or other source registry URL. | |
| REGISTRY_DST: ${{ vars.REGISTRY_DST || 'docker.io' }} # For tags of built images: where to push images to, docker.io or other destination registry URL. | |
| # DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD is required for docker image push, they should be set in CI secrets. | |
| DOCKER_REGISTRY_USERNAME: ${{ vars.DOCKER_REGISTRY_USERNAME }} | |
| DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
| # used to sync image to mirror registry | |
| DOCKER_MIRROR_REGISTRY_USERNAME: ${{ vars.DOCKER_MIRROR_REGISTRY_USERNAME }} | |
| DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }} | |
| jobs: | |
| qpod_OpenCV: | |
| name: 'opencv' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: source ./tool.sh && build_image opencv latest docker_OpenCV/Dockerfile && push_image | |
| # paddleocr-models: temp disable the build caused by the paddle run on CPU server | |
| qpod_PaddleOCR_cuda112: | |
| name: 'paddleocr-cuda112' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| source ./tool.sh && free_diskspace | |
| build_image paddleocr-cuda112 latest docker_PaddleOCR/Dockerfile --build-arg "BASE_IMG=cuda_11.2" | |
| echo 'build_image paddleocr-models latest docker_PaddleOCR/models.Dockerfile --build-arg "BASE_IMG=paddleocr-cuda112" --build-arg "BASE_NAMESPACE_SRC=docker.io/library"' | |
| push_image | |
| qpod_PaddleOCR_cuda120: | |
| name: 'paddleocr-cuda120,doc-ai-cuda120' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| source ./tool.sh && free_diskspace | |
| build_image paddleocr-cuda120 latest docker_PaddleOCR/Dockerfile --build-arg "BASE_IMG=cuda_12.0" | |
| build_image doc-ai-cuda120 latest docker_PaddleOCR/Dockerfile --build-arg "BASE_IMG=py-nlp-cuda120" | |
| push_image | |
| qpod_OpenFace: | |
| name: 'openface-src,openface' | |
| needs: [ "qpod_OpenCV" ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| source ./tool.sh | |
| export IMG_PREFIX_SRC="docker.io/library" && build_image openface-src latest docker_OpenFace/OpenFace-src.Dockerfile && push_image src | |
| export IMG_PREFIX_SRC="${IMG_PREFIX_DST}" && build_image openface latest docker_OpenFace/OpenFace.Dockerfile && push_image openface | |
| # To build HF model image for a single model, simple run: `build_image_hf_model bert-base-cased` | |
| qpod_HuggingFaceModels: | |
| name: 'huggingface-model' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - env: | |
| HF_MODEL_NAME: ${{ vars.HF_MODEL_NAME }} | |
| run: | | |
| source tool.sh && export IMG_PREFIX_SRC="docker.io/library" | |
| source docker_HuggingFace-model/script-setup-huggingface.sh | |
| export -f download_hf_model build_image_hf_model build_image_no_tag push_image | |
| HF_MODEL_RANDOM=$(sort --random-sort docker_HuggingFace-model/list_hf_models.txt | head -n1) | |
| download_hf_model ${HF_MODEL_NAME:-$HF_MODEL_RANDOM} && build_image_hf_model ${HF_MODEL_NAME} | |
| ## Sync all images in this build (listed by "names") to mirror registry. | |
| sync_images: | |
| needs: ["qpod_OpenCV", "qpod_HuggingFaceModels", "qpod_PaddleOCR_cuda112", "qpod_PaddleOCR_cuda120"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - env: | |
| AUTH_FILE_CONTENT: ${{ secrets.AUTH_FILE_CONTENT }} | |
| DOCKER_MIRROR_REGISTRY: ${{ vars.DOCKER_MIRROR_REGISTRY }} | |
| run: | | |
| source ./tool.sh | |
| printf '%s' "$AUTH_FILE_CONTENT" > .github/workflows/auth.json && ls -alh ./.github/workflows | |
| printenv | grep -v 'PATH' > /tmp/docker.env && echo "REGISTRY_URL=${REGISTRY_DST}" >> /tmp/docker.env | |
| docker run --rm --env-file /tmp/docker.env -v $(pwd):/tmp -w /tmp ${IMG_PREFIX_DST:-qpod}/docker-kit \ | |
| python /opt/utils/image-syncer/run_jobs.py --auth-file=/tmp/.github/workflows/auth.json |