Skip to content

Commit

Permalink
Merge branch 'master' into feat/PRD-789
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored Nov 27, 2023
2 parents e68a91b + a9650b6 commit 3d041cd
Show file tree
Hide file tree
Showing 370 changed files with 16,935 additions and 13,594 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/node_modules/
datahub-frontend/build/
metadata-ingestion/venv/
*/build/
*/*/build/
*/venv/
out
**/*.class
# Have to copy gradle/wrapper/gradle-wrapper.jar, can't exclude ALL jars
Expand Down
11 changes: 10 additions & 1 deletion .github/actions/docker-custom-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,20 @@ runs:
push: false
cache-from: type=registry,ref=${{ steps.docker_meta.outputs.tags }}
cache-to: type=inline
- name: Single Tag
if: ${{ inputs.publish != 'true' }}
shell: bash
run: |
TAGS="""
${{ steps.docker_meta.outputs.tags }}
"""
echo "SINGLE_TAG=$(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
if: ${{ inputs.publish != 'true' }}
with:
image: ${{ steps.docker_meta.outputs.tags }}
image: ${{ steps.single_tag.outputs.SINGLE_TAG }}

# Code for building multi-platform images and pushing to Docker Hub.
- name: Set up QEMU
Expand Down
28 changes: 20 additions & 8 deletions .github/scripts/check_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
elif urn == "urn:li:dataHubPolicy:editor-platform-policy":
editor_platform_policy_privileges = policy["info"]["privileges"]
elif urn == "urn:li:dataHubPolicy:7":
all_user_platform_policy_privilges = policy["info"]["privileges"]
all_user_platform_policy_privileges = policy["info"]["privileges"]
try:
doc_type = policy["info"]["type"]
privileges = policy["info"]["privileges"]
Expand Down Expand Up @@ -54,10 +54,22 @@
)
assert len(diff_policies) == 0, f"Missing privileges for root user are {diff_policies}"

diff_policies = set(editor_platform_policy_privileges).difference(
set(all_user_platform_policy_privilges)
)
assert "MANAGE_POLICIES" not in all_user_platform_policy_privilges
assert (
len(diff_policies) == 0
), f"Missing privileges for all user policies are {diff_policies}"
# All users privileges checks
assert "MANAGE_POLICIES" not in all_user_platform_policy_privileges
assert "MANAGE_USERS_AND_GROUPS" not in all_user_platform_policy_privileges
assert "MANAGE_SECRETS" not in all_user_platform_policy_privileges
assert "MANAGE_USER_CREDENTIALS" not in all_user_platform_policy_privileges
assert "MANAGE_ACCESS_TOKENS" not in all_user_platform_policy_privileges
assert "EDIT_ENTITY" not in all_user_platform_policy_privileges
assert "DELETE_ENTITY" not in all_user_platform_policy_privileges

# Editor checks
assert "MANAGE_POLICIES" not in editor_platform_policy_privileges
assert "MANAGE_USERS_AND_GROUPS" not in editor_platform_policy_privileges
assert "MANAGE_SECRETS" not in editor_platform_policy_privileges
assert "MANAGE_USER_CREDENTIALS" not in editor_platform_policy_privileges
assert "MANAGE_ACCESS_TOKENS" not in editor_platform_policy_privileges
# These don't prevent a user from modifying entities they are an asset owner of, i.e. their own profile info
assert "EDIT_CONTACT_INFO" not in editor_platform_policy_privileges
assert "EDIT_USER_PROFILE" not in editor_platform_policy_privileges
assert "EDIT_ENTITY_OWNERS" not in editor_platform_policy_privileges
6 changes: 3 additions & 3 deletions .github/scripts/docker_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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}\,${SHORT_SHA},g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1,g')
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}
}

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

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

function get_python_docker_release_v {
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
command: [
# metadata-ingestion and airflow-plugin each have dedicated build jobs
"except_metadata_ingestion",
"frontend"
"frontend",
]
timezone: ["UTC", "America/New_York"]
runs-on: ubuntu-latest
Expand All @@ -36,9 +36,7 @@ jobs:
- uses: szenius/[email protected]
with:
timezoneLinux: ${{ matrix.timezone }}
- uses: actions/checkout@v3
with:
fetch-depth: 800
- uses: hsheth2/sane-checkout-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/check-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
command: ["datahub-client", "datahub-protobuf", "spark-lineage"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 800
- uses: hsheth2/sane-checkout-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docker-ingestion-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ jobs:
if: ${{ needs.setup.outputs.publish == 'true' }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docker-postgres-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
78 changes: 39 additions & 39 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,26 @@ jobs:
unique_full_tag: ${{ steps.tag.outputs.unique_full_tag }}
publish: ${{ steps.publish.outputs.publish }}
python_release_version: ${{ steps.tag.outputs.python_release_version }}
short_sha: ${{ steps.tag.outputs.short_sha }}
branch_name: ${{ steps.tag.outputs.branch_name }}
repository_name: ${{ steps.tag.outputs.repository_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compute Tag
id: tag
run: |
source .github/scripts/docker_helpers.sh
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "tag=$(get_tag)" >> $GITHUB_OUTPUT
echo "slim_tag=$(get_tag_slim)" >> $GITHUB_OUTPUT
echo "full_tag=$(get_tag_full)" >> $GITHUB_OUTPUT
echo "unique_tag=$(get_unique_tag)" >> $GITHUB_OUTPUT
echo "unique_slim_tag=$(get_unique_tag_slim)" >> $GITHUB_OUTPUT
echo "unique_full_tag=$(get_unique_tag_full)" >> $GITHUB_OUTPUT
echo "python_release_version=$(get_python_docker_release_v)" >> $GITHUB_OUTPUT
echo "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
echo "repository_name=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT
- name: Check whether publishing enabled
id: publish
env:
Expand All @@ -74,9 +80,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Pre-build artifacts for docker image
run: |
./gradlew :metadata-service:war:build -x test --parallel
Expand Down Expand Up @@ -132,9 +136,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Pre-build artifacts for docker image
run: |
./gradlew :metadata-jobs:mae-consumer-job:build -x test --parallel
Expand Down Expand Up @@ -190,9 +192,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Pre-build artifacts for docker image
run: |
./gradlew :metadata-jobs:mce-consumer-job:build -x test --parallel
Expand Down Expand Up @@ -248,9 +248,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Pre-build artifacts for docker image
run: |
./gradlew :datahub-upgrade:build -x test --parallel
Expand Down Expand Up @@ -306,9 +304,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Pre-build artifacts for docker image
run: |
./gradlew :datahub-frontend:dist -x test -x yarnTest -x yarnLint --parallel
Expand Down Expand Up @@ -366,9 +362,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand All @@ -388,9 +382,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand All @@ -410,9 +402,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand All @@ -434,9 +424,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down Expand Up @@ -468,9 +456,7 @@ jobs:
needs: [setup, datahub_ingestion_base_build]
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down Expand Up @@ -510,9 +496,7 @@ jobs:
needs: [setup, datahub_ingestion_base_build]
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down Expand Up @@ -554,9 +538,7 @@ jobs:
needs: [setup, datahub_ingestion_base_slim_build]
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down Expand Up @@ -637,9 +619,7 @@ jobs:
needs: [setup, datahub_ingestion_base_full_build]
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down Expand Up @@ -886,3 +866,23 @@ jobs:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: github-activities
deploy_datahub_head:
name: Deploy to Datahub HEAD
runs-on: ubuntu-latest
needs:
[
setup,
smoke_test
]
steps:
- uses: aws-actions/configure-aws-credentials@v1
if: ${{ needs.setup.outputs.publish != 'false' }}
with:
aws-access-key-id: ${{ secrets.AWS_SQS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SQS_ACCESS_KEY }}
aws-region: us-west-2
- uses: isbang/[email protected]
if: ${{ needs.setup.outputs.publish != 'false' }}
with:
sqs-url: ${{ secrets.DATAHUB_HEAD_SYNC_QUEUE }}
message: '{ "command": "git-sync", "args" : {"repoName": "${{ needs.setup.outputs.repository_name }}", "repoOrg": "${{ github.repository_owner }}", "repoBranch": "${{ needs.setup.outputs.branch_name }}", "repoShaShort": "${{ needs.setup.outputs.short_sha }}" }}'
4 changes: 1 addition & 3 deletions .github/workflows/publish-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ jobs:
needs: ["check-secret", "setup"]
if: ${{ needs.check-secret.outputs.publish-enabled == 'true' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 800
- uses: hsheth2/sane-checkout-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/spark-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ jobs:
spark-smoke-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 800
fetch-tags: true
- uses: hsheth2/sane-checkout-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ venv.bak/
dmypy.json
MANIFEST
*.pyc
.python-version

# Generated files
**/bin
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Here are the companies that have officially adopted DataHub. Please feel free to
- [SpotHero](https://spothero.com)
- [Stash](https://www.stash.com)
- [Shanghai HuaRui Bank](https://www.shrbank.com)
- [s7 Airlines](https://www.s7.ru/)
- [ThoughtWorks](https://www.thoughtworks.com)
- [TypeForm](http://typeform.com)
- [Udemy](https://www.udemy.com/)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Reporting security issues
# Reporting Security Issues

If you think you have found a security vulnerability, please send a report to [email protected]. This address can be used for all of Acryl Data’s open source and commercial products (including but not limited to DataHub and Acryl Data). We can accept only vulnerability reports at this address.

Expand Down
Loading

0 comments on commit 3d041cd

Please sign in to comment.