Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker build github action #7718

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build docker image
# Note: This doesn't push images to the repository,
# since GCP authorization hasn't been set up.

on:
pull_request:
workflow_dispatch:
release:
types: [published]

env:
USE_BAZEL_VERSION: "7.2.1"

jobs:
build_docker:
name: Build docker
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: install python dependencies
run: |
pip install pip --upgrade --quiet
pip install wheel setuptools pipdeptree --upgrade --quiet

- name: install docker
run: |
docker --version

- name: Build docker
run: |
export BUILD_ID="$(date +%s)-$(LC_ALL=C tr -dc a-z0-9 </dev/urandom | head -c 10)"
export DOCKER_IMAGE="gcr.io/tfx-oss-public/tfx_smoke_test:${BUILD_ID}"
export docker_image_repo=$(echo "${DOCKER_IMAGE}" | cut -d ':' -f 1)
export docker_image_tag=$(echo "${DOCKER_IMAGE}" | cut -d ':' -f 2)
DOCKER_IMAGE_REPO="${docker_image_repo}" DOCKER_IMAGE_TAG="${docker_image_tag}" tfx/tools/docker/build_docker_image.sh
docker inspect ${DOCKER_IMAGE}
5 changes: 4 additions & 1 deletion tfx/tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ RUN cd ${TFX_DIR}/src; \
FROM apache/beam_python3.10_sdk:${BEAM_VERSION} as beam-worker

# Build stage to extend DLVM image.
FROM ${BASE_IMAGE} as install
RUN if [ -n "$BASE_IMAGE" ]; then \
echo "Using base image: $BASE_IMAGE"; \
FROM ${BASE_IMAGE} as install; \
fi

# Additional Python packages which will be installed.
ARG ADDITIONAL_PACKAGES
Expand Down
Loading