Skip to content

Commit

Permalink
Fix docker builds in CI (flexflow#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
goliaro committed Jun 16, 2023
1 parent 0f13b90 commit d3d914b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ on:
push:
branches:
- "master"
paths:
- "docker/**"
- "!docker/README.md"
- ".github/workflows/docker-build.yml"
schedule:
# Run every week on Sunday at midnight PT (3am ET / 8am UTC) to keep the docker images updated
- cron: "0 8 * * 0"
workflow_dispatch:

# Cancel outdated workflows if they are still running
Expand Down Expand Up @@ -43,7 +42,7 @@ jobs:
# On push to master, build for all compatible architectures, so that we can publish
# a pre-built general-purpose image. On all other cases, only build for one architecture
# to save time.
if [[ ${{ github.event_name }} == 'push' && ${GITHUB_REF#refs/heads/} == "master" ]]; then
if [[ ( ${{ github.event_name }} == 'push' || ${{ github.event_name }} == 'schedule' ) && ${GITHUB_REF#refs/heads/} == "master" ]]; then
export FF_CUDA_ARCH=all
else
export FF_CUDA_ARCH=70
Expand All @@ -55,13 +54,26 @@ jobs:
run: docker run --entrypoint python flexflow-cuda:latest -c "import flexflow.core; exit()"

- name: Publish Docker environment image (on push to master)
if: github.repository_owner == 'flexflow'
env:
FLEXFLOW_CONTAINER_TOKEN: ${{ secrets.FLEXFLOW_CONTAINER_TOKEN }}
FF_GPU_BACKEND: ${{ matrix.gpu_backend }}
run: |
if [[ ${{ github.event_name }} == 'push' && ${GITHUB_REF#refs/heads/} == "master" ]]; then
if [[ ( ${{ github.event_name }} == 'push' || ${{ github.event_name }} == 'schedule' ) && ${GITHUB_REF#refs/heads/} == "master" ]]; then
./docker/publish.sh "flexflow-environment-${FF_GPU_BACKEND}"
./docker/publish.sh "flexflow-${FF_GPU_BACKEND}"
else
echo "No need to update Docker containers in ghrc.io registry at this time."
fi
notify-slack:
name: Notify Slack in case of failure
runs-on: ubuntu-20.04
needs: docker-build
if: ${{ failure() && github.event_name == 'schedule' && github.repository_owner == 'flexflow' }}
steps:
- name: Send Slack message
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"Weekly FlexFlow Docker images build failed! <https://github.com/flexflow/FlexFlow/actions/runs/$GITHUB_RUN_ID|(See here).> :x: \"}" $SLACK_WEBHOOK
5 changes: 3 additions & 2 deletions docker/flexflow-environment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ ENV CUDNN_DIR /usr/local/cuda
ENV CUDA_DIR /usr/local/cuda

# Install python packages and other dependencies
RUN conda install -c conda-forge cmake make pillow cmake-build-extension pybind11 numpy pandas keras-preprocessing
RUN conda install -c conda-forge cmake make pillow cmake-build-extension pybind11 numpy pandas keras-preprocessing
# Install CPU-only Pytorch and related dependencies
RUN conda install pytorch torchvision torchaudio cpuonly -c pytorch
RUN conda install -c conda-forge onnx tensorflow transformers sentencepiece
RUN conda install -c conda-forge onnx transformers sentencepiece
RUN pip3 install tensorflow

ENTRYPOINT ["/bin/bash"]

0 comments on commit d3d914b

Please sign in to comment.