Skip to content

Commit

Permalink
Merge branch 'master' into bq-retries
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-lyons authored Aug 26, 2024
2 parents 9af1c97 + ca4c436 commit 239e163
Show file tree
Hide file tree
Showing 298 changed files with 40,091 additions and 5,195 deletions.
11 changes: 4 additions & 7 deletions .github/actions/ci-optimization/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Identify CI Optimizations'
description: 'Determine if code changes are specific to certain modules.'
name: "Identify CI Optimizations"
description: "Determine if code changes are specific to certain modules."

outputs:
frontend-only:
Expand Down Expand Up @@ -44,27 +44,25 @@ outputs:
runs:
using: "composite"
steps:
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
token: "" # Empty token forces it to use raw git commands.
filters: |
frontend:
- "datahub-frontend/**"
- "datahub-web-react/**"
- "smoke-test/tests/cypress/**"
- "docker/datahub-frontend/**"
ingestion:
- "metadata-ingestion-modules/**"
- "metadata-ingestion/**"
- "metadata-models/**"
- "smoke-test/**"
- "docker/datahub-ingestion**"
ingestion-base:
- "docker/datahub-ingestion-base/**"
docker:
- "docker/**"
backend:
- ".github/**"
- "metadata-models/**"
- "datahub-upgrade/**"
- "entity-registry/**"
Expand All @@ -78,7 +76,6 @@ runs:
- "metadata-utils/**"
- "metadata-operation-context/**"
- "datahub-graphql-core/**"
- "smoke-test/**"
- "docker/**"
kafka-setup:
- "docker/kafka-setup/**"
Expand Down
29 changes: 19 additions & 10 deletions .github/actions/docker-custom-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ inputs:
build-args:
description: "List of build-time variables. Same as docker/build-push-action"
required: false
tags:
# e.g. latest,head,sha12345
description: "List of tags to use for the Docker image"
image_tag:
# e.g. pr12345 OR head OR v0.1.2.3
description: "Main tag to use for the Docker image"
required: true
flavor:
description: 'Image flavor (e.g., slim, full)'
required: false
target:
description: "Sets the target stage to build"
required: false
Expand All @@ -45,13 +48,16 @@ runs:
steps:
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: ${{ inputs.images }}
# add git short SHA as Docker tag
tag-custom: ${{ inputs.tags }}
tag-custom-only: true
flavor: |
latest=false
suffix=${{ inputs.flavor && format('-{0}', inputs.flavor) || '' }}
tags: |
type=raw,value=${{ inputs.image_tag }}
type=raw,value=head,enable={{is_default_branch}}
type=sha,prefix=,format=short
# Code for testing the build when not pushing to Docker Hub.
- name: Build and Load image for testing (if not publishing)
Expand All @@ -74,10 +80,13 @@ runs:
if: ${{ inputs.publish != 'true' }}
shell: bash
run: |
IMAGES="""
${{ inputs.images }}
"""
TAGS="""
${{ steps.docker_meta.outputs.tags }}
${{ inputs.image_tag }}
"""
echo "SINGLE_TAG=$(echo $TAGS | tr '\n' ' ' | awk -F' ' '{ print $1 }')" >> $GITHUB_OUTPUT
echo "SINGLE_TAG=$(echo $IMAGES | tr '\n' ' ' | awk -F' |,' '{ print $1 }'):$(echo $TAGS | tr '\n' ' ' | awk -F' |,' '{ print $1 }')" >> $GITHUB_OUTPUT
id: single_tag
- name: Upload image locally for testing (if not publishing)
uses: ishworkh/docker-image-artifact-upload@v1
Expand Down
16 changes: 12 additions & 4 deletions .github/scripts/docker_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ export MAIN_BRANCH="master"
export MAIN_BRANCH_TAG="head"

function get_short_sha {
echo $(git rev-parse --short "$GITHUB_SHA")
echo $(git rev-parse --short "$GITHUB_SHA"|head -c7)
}

export SHORT_SHA=$(get_short_sha)
echo "SHORT_SHA: $SHORT_SHA"

function get_tag {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG},g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1,g'),${SHORT_SHA}
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG},g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1,g')
}

function get_tag_slim {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-slim,g" -e 's,refs/tags/\(.*\),\1-slim,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-slim,g'),${SHORT_SHA}-slim
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-slim,g" -e 's,refs/tags/\(.*\),\1-slim,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-slim,g')
}

function get_tag_full {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-full,g" -e 's,refs/tags/\(.*\),\1-full,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-full,g'),${SHORT_SHA}-full
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-full,g" -e 's,refs/tags/\(.*\),\1-full,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-full,g')
}

function get_python_docker_release_v {
Expand All @@ -38,3 +38,11 @@ function get_unique_tag_slim {
function get_unique_tag_full {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${SHORT_SHA}-full,g" -e 's,refs/tags/\(.*\),\1-full,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-full,g')
}

function get_platforms_based_on_branch {
if [ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == "refs/heads/${MAIN_BRANCH}" ]; then
echo "linux/amd64,linux/arm64"
else
echo "linux/amd64"
fi
}
8 changes: 8 additions & 0 deletions .github/scripts/docker_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
TARGET_DIR="${TARGET_DIR:=docker_logs}"
TEST_STRATEGY="${TEST_STRATEGY:=}"

mkdir -p "$TARGET_DIR"
for name in `docker ps -a --format '{{.Names}}'`;
do
docker logs "$name" >& "${TARGET_DIR}/${name}${TEST_STRATEGY}.log" || true
done
7 changes: 7 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
timeout-minutes: 60
needs: setup
steps:
- name: Free up disk space
run: |
sudo apt-get remove 'dotnet-*' azure-cli || true
sudo rm -rf /usr/local/lib/android/ || true
sudo docker image prune -a -f || true
- uses: szenius/[email protected]
with:
timezoneLinux: ${{ matrix.timezone }}
Expand Down Expand Up @@ -86,6 +91,8 @@ jobs:
-x :metadata-ingestion-modules:airflow-plugin:check \
-x :metadata-ingestion-modules:dagster-plugin:build \
-x :metadata-ingestion-modules:dagster-plugin:check \
-x :metadata-ingestion-modules:gx-plugin:build \
-x :metadata-ingestion-modules:gx-plugin:check \
-x :datahub-frontend:build \
-x :datahub-web-react:build \
--parallel
Expand Down
Loading

0 comments on commit 239e163

Please sign in to comment.