mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-18 14:16:48 +00:00
chore(ci): fix flakiness, misc improvements (#7605)
This commit is contained in:
parent
38555385e1
commit
c43d7dd9d2
23
.github/workflows/check-datahub-jars.yml
vendored
23
.github/workflows/check-datahub-jars.yml
vendored
@ -24,6 +24,15 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_jars:
|
check_jars:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
command:
|
||||||
|
[
|
||||||
|
"datahub-client",
|
||||||
|
"datahub-protobuf",
|
||||||
|
"spark-lineage"
|
||||||
|
]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -37,15 +46,7 @@ jobs:
|
|||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.7"
|
python-version: "3.7"
|
||||||
- name: check datahub-client jar
|
- name: check ${{ matrix.command }} jar
|
||||||
run: |
|
run: |
|
||||||
./gradlew :metadata-integration:java:datahub-client:build
|
./gradlew :metadata-integration:java:${{ matrix.command }}:build --info
|
||||||
./gradlew :metadata-integration:java:datahub-client:javadoc
|
./gradlew :metadata-integration:java:${{ matrix.command }}:javadoc
|
||||||
- name: check spark-lineage jar
|
|
||||||
run: |
|
|
||||||
./gradlew :metadata-integration:java:spark-lineage:build
|
|
||||||
./gradlew :metadata-integration:java:spark-lineage:javadoc
|
|
||||||
- name: check datahub-protobuf jar
|
|
||||||
run: |
|
|
||||||
./gradlew :metadata-integration:java:datahub-protobuf:build
|
|
||||||
./gradlew :metadata-integration:java:datahub-protobuf:javadoc
|
|
||||||
|
14
.github/workflows/docker-unified.yml
vendored
14
.github/workflows/docker-unified.yml
vendored
@ -490,20 +490,6 @@ jobs:
|
|||||||
if: ${{ needs.setup.outputs.publish != 'true' }}
|
if: ${{ needs.setup.outputs.publish != 'true' }}
|
||||||
with:
|
with:
|
||||||
image: ${{ env.DATAHUB_UPGRADE_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
|
image: ${{ env.DATAHUB_UPGRADE_IMAGE }}:${{ needs.setup.outputs.unique_tag }}
|
||||||
- name: Calculate pip install plan
|
|
||||||
id: "packages_checksum"
|
|
||||||
run: |
|
|
||||||
pip install pip -U # only 22.2 and above contains the --dry-run flag
|
|
||||||
|
|
||||||
# only the last line of the output is the packages that will be installed
|
|
||||||
pip install --dry-run -r ./smoke-test/requirements.txt | tail -n 1 > /tmp/would_be_installed.txt
|
|
||||||
CHECKSUM=$(shasum /tmp/would_be_installed.txt | awk '{print $1}')
|
|
||||||
echo "packages_checksum=$CHECKSUM" >> $GITHUB_OUTPUT
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
id: cache-venv
|
|
||||||
with:
|
|
||||||
path: ./smoke-test/venv/
|
|
||||||
key: smoke-venv-${{ runner.os }}-${{ steps.packages_checksum.outputs.packages_checksum }}
|
|
||||||
- name: run quickstart
|
- name: run quickstart
|
||||||
env:
|
env:
|
||||||
DATAHUB_TELEMETRY_ENABLED: false
|
DATAHUB_TELEMETRY_ENABLED: false
|
||||||
|
22
.github/workflows/metadata-ingestion.yml
vendored
22
.github/workflows/metadata-ingestion.yml
vendored
@ -54,26 +54,10 @@ jobs:
|
|||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: ./metadata-ingestion/scripts/install_deps.sh
|
run: ./metadata-ingestion/scripts/install_deps.sh
|
||||||
- name: Calculate pip install plan
|
- name: Install package
|
||||||
id: "packages_checksum"
|
run: ./gradlew :metadata-ingestion:installPackageOnly
|
||||||
run: |
|
|
||||||
cd metadata-ingestion
|
|
||||||
pip install pip -U # only 22.2 and above contains the --dry-run flag
|
|
||||||
|
|
||||||
# only the last line of the output is the packages that will be installed
|
|
||||||
pip install --dry-run -e .[dev] ${{ matrix.extraPythonRequirement }} | tail -n 1 > /tmp/would_be_installed.txt
|
|
||||||
CHECKSUM=$(shasum /tmp/would_be_installed.txt | awk '{print $1}')
|
|
||||||
echo "packages_checksum=$CHECKSUM" >> $GITHUB_OUTPUT
|
|
||||||
- name: print dependencies
|
|
||||||
id: print-dependency
|
|
||||||
run: cat /tmp/would_be_installed.txt
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
id: cache-venv
|
|
||||||
with:
|
|
||||||
path: ./metadata-ingestion/venv/
|
|
||||||
key: ${{ runner.os }}-venv-${{ steps.packages_checksum.outputs.packages_checksum }}-${{ matrix.python-version }}
|
|
||||||
- name: Run metadata-ingestion tests (extras ${{ matrix.extraPythonRequirement }})
|
- name: Run metadata-ingestion tests (extras ${{ matrix.extraPythonRequirement }})
|
||||||
run: ./gradlew -Pextra_pip_requirements='${{ matrix.extraPythonRequirement }}' :metadata-ingestion:${{ matrix.command }}
|
run: ./gradlew -Pextra_pip_requirements='${{ matrix.extraPythonRequirement }}' :metadata-ingestion:${{ matrix.command }} -x :metadata-ingestion:installPackageOnly
|
||||||
- name: pip freeze show list installed
|
- name: pip freeze show list installed
|
||||||
if: always()
|
if: always()
|
||||||
run: source metadata-ingestion/venv/bin/activate && pip freeze
|
run: source metadata-ingestion/venv/bin/activate && pip freeze
|
||||||
|
1
metadata-ingestion/.gitignore
vendored
1
metadata-ingestion/.gitignore
vendored
@ -140,3 +140,4 @@ dmypy.json
|
|||||||
|
|
||||||
# Generated classes
|
# Generated classes
|
||||||
src/datahub/metadata/
|
src/datahub/metadata/
|
||||||
|
.preflight_sentinel
|
@ -12,7 +12,8 @@ if (!project.hasProperty("extra_pip_requirements")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task checkPythonVersion(type: Exec) {
|
task checkPythonVersion(type: Exec) {
|
||||||
commandLine python_executable, '-c', 'import sys; assert sys.version_info >= (3, 7)'
|
commandLine python_executable, '-c',
|
||||||
|
'import sys; assert (3, 11) > sys.version_info >= (3, 7), f"Python version {sys.version_info[:2]} not allowed"'
|
||||||
}
|
}
|
||||||
|
|
||||||
task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
|
task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
|
||||||
@ -22,10 +23,22 @@ task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task runPreFlightScript(type: Exec, dependsOn: environmentSetup) {
|
task runPreFlightScript(type: Exec, dependsOn: environmentSetup) {
|
||||||
|
def sentinel_file = ".preflight_sentinel"
|
||||||
|
outputs.file(sentinel_file)
|
||||||
commandLine "scripts/datahub_preflight.sh"
|
commandLine "scripts/datahub_preflight.sh"
|
||||||
|
commandLine 'bash', '-c', "touch ${sentinel_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
task installPackage(type: Exec, dependsOn: runPreFlightScript) {
|
task installPackageOnly(type: Exec, dependsOn: runPreFlightScript) {
|
||||||
|
def sentinel_file = "${venv_name}/.build_install_package_only_sentinel"
|
||||||
|
inputs.file file('setup.py')
|
||||||
|
outputs.dir("${venv_name}")
|
||||||
|
outputs.file(sentinel_file)
|
||||||
|
commandLine 'bash', '-x', '-c', "${venv_name}/bin/pip install -e ."
|
||||||
|
commandLine 'bash', '-c', "touch ${sentinel_file}"
|
||||||
|
}
|
||||||
|
|
||||||
|
task installPackage(type: Exec, dependsOn: installPackageOnly) {
|
||||||
inputs.file file('setup.py')
|
inputs.file file('setup.py')
|
||||||
outputs.dir("${venv_name}")
|
outputs.dir("${venv_name}")
|
||||||
commandLine 'bash', '-x', '-c', "${venv_name}/bin/pip install -e . ${extra_pip_requirements}"
|
commandLine 'bash', '-x', '-c', "${venv_name}/bin/pip install -e . ${extra_pip_requirements}"
|
||||||
@ -40,25 +53,27 @@ task codegen(type: Exec, dependsOn: [environmentSetup, installPackage, ':metadat
|
|||||||
task install(dependsOn: [installPackage, codegen])
|
task install(dependsOn: [installPackage, codegen])
|
||||||
|
|
||||||
task installDev(type: Exec, dependsOn: [install]) {
|
task installDev(type: Exec, dependsOn: [install]) {
|
||||||
|
def sentinel_file = "${venv_name}/.build_install_dev_sentinel"
|
||||||
inputs.file file('setup.py')
|
inputs.file file('setup.py')
|
||||||
outputs.dir("${venv_name}")
|
outputs.dir("${venv_name}")
|
||||||
outputs.file("${venv_name}/.build_install_dev_sentinel")
|
outputs.file(sentinel_file)
|
||||||
commandLine 'bash', '-c',
|
commandLine 'bash', '-c',
|
||||||
"source ${venv_name}/bin/activate && set -x && " +
|
"source ${venv_name}/bin/activate && set -x && " +
|
||||||
"${venv_name}/bin/pip install -e .[dev] ${extra_pip_requirements} && " +
|
"${venv_name}/bin/pip install -e .[dev] ${extra_pip_requirements} && " +
|
||||||
"./scripts/install-sqlalchemy-stubs.sh && " +
|
"./scripts/install-sqlalchemy-stubs.sh && " +
|
||||||
"touch ${venv_name}/.build_install_dev_sentinel"
|
"touch ${sentinel_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
task installAll(type: Exec, dependsOn: [install]) {
|
task installAll(type: Exec, dependsOn: [install]) {
|
||||||
|
def sentinel_file = "${venv_name}/.build_install_all_sentinel"
|
||||||
inputs.file file('setup.py')
|
inputs.file file('setup.py')
|
||||||
outputs.dir("${venv_name}")
|
outputs.dir("${venv_name}")
|
||||||
outputs.file("${venv_name}/.build_install_all_sentinel")
|
outputs.file(sentinel_file)
|
||||||
commandLine 'bash', '-c',
|
commandLine 'bash', '-c',
|
||||||
"source ${venv_name}/bin/activate && set -x && " +
|
"source ${venv_name}/bin/activate && set -x && " +
|
||||||
"${venv_name}/bin/pip install -e .[all] ${extra_pip_requirements} && " +
|
"${venv_name}/bin/pip install -e .[all] ${extra_pip_requirements} && " +
|
||||||
"./scripts/install-sqlalchemy-stubs.sh && " +
|
"./scripts/install-sqlalchemy-stubs.sh && " +
|
||||||
"touch ${venv_name}/.build_install_all_sentinel"
|
"touch ${sentinel_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -111,11 +126,12 @@ task testQuick(type: Exec, dependsOn: [installDev, ':metadata-models:generateJso
|
|||||||
}
|
}
|
||||||
|
|
||||||
task installDevTest(type: Exec, dependsOn: [install]) {
|
task installDevTest(type: Exec, dependsOn: [install]) {
|
||||||
|
def sentinel_file = "${venv_name}/.build_install_dev_test_sentinel"
|
||||||
inputs.file file('setup.py')
|
inputs.file file('setup.py')
|
||||||
outputs.dir("${venv_name}")
|
outputs.dir("${venv_name}")
|
||||||
outputs.file("${venv_name}/.build_install_dev_test_sentinel")
|
outputs.file(sentinel_file)
|
||||||
commandLine 'bash', '-c',
|
commandLine 'bash', '-c',
|
||||||
"${venv_name}/bin/pip install -e .[dev,integration-tests] ${extra_pip_requirements} && touch ${venv_name}/.build_install_dev_test_sentinel"
|
"${venv_name}/bin/pip install -e .[dev,integration-tests] ${extra_pip_requirements} && touch ${sentinel_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
def testFile = hasProperty('testFile') ? testFile : 'unknown'
|
def testFile = hasProperty('testFile') ? testFile : 'unknown'
|
||||||
@ -176,6 +192,7 @@ clean {
|
|||||||
delete 'generated'
|
delete 'generated'
|
||||||
delete '.mypy_cache'
|
delete '.mypy_cache'
|
||||||
delete '.pytest_cache'
|
delete '.pytest_cache'
|
||||||
|
delete '.preflight_sentinel'
|
||||||
}
|
}
|
||||||
clean.dependsOn cleanPythonCache
|
clean.dependsOn cleanPythonCache
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user