-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(actions): Moving datahub-actions into oss datahub #13120
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
base: master
Are you sure you want to change the base?
Changes from all commits
c0089cd
dfad52c
9fce982
eb6d642
f9ce69f
8729ef4
9e53c96
3a6f20b
c66b5fd
f0393af
3b936eb
3bc1271
582fbeb
461cd9f
42d646b
dbae264
53008fe
838ca9c
491d7e9
f0d927a
8cff48b
3d3b366
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: DataHub Actions | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- ".github/workflows/actions.yml" | ||
- "datahub-actions/**" | ||
- "metadata-ingestion/**" | ||
- "metadata-models/**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- ".github/workflows/actions.yml" | ||
- "datahub-actions/**" | ||
- "metadata-ingestion/**" | ||
- "metadata-models/**" | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Test packages are correct | ||
run: | | ||
cd datahub-actions; | ||
python -c 'import setuptools; where="./src"; assert setuptools.find_packages(where) == setuptools.find_namespace_packages(where), "you seem to be missing or have extra __init__.py files"' | ||
- name: Gradle build (and test) | ||
run: | | ||
./gradlew :datahub-actions:build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: Test Results (build) | ||
path: | | ||
**/build/reports/tests/test/** | ||
**/build/test-results/test/** | ||
**/junit.*.xml | ||
- name: Upload datahub-actions coverage to Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
#handle_no_reports_found: true | ||
fail_ci_if_error: false | ||
name: datahub-actions | ||
verbose: true | ||
|
||
event-file: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Event File | ||
path: ${{ github.event_path }} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 datahub/.github/workflows/docker-unified.yml Line 1123 in 3d3b366
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ env: | |
DATAHUB_UPGRADE_IMAGE: "acryldata/datahub-upgrade" | ||
DATAHUB_INGESTION_BASE_IMAGE: "acryldata/datahub-ingestion-base" | ||
DATAHUB_INGESTION_IMAGE: "acryldata/datahub-ingestion" | ||
DATAHUB_ACTIONS_IMAGE: "acryldata/datahub-actions" | ||
|
||
DOCKER_CACHE: "DEPOT" | ||
DEPOT_PROJECT_ID: "${{ vars.DEPOT_PROJECT_ID }}" | ||
|
@@ -60,6 +61,7 @@ jobs: | |
branch_name: ${{ steps.tag.outputs.branch_name }} | ||
repository_name: ${{ steps.tag.outputs.repository_name }} | ||
frontend_change: ${{ steps.ci-optimize.outputs.frontend-change == 'true' }} | ||
actions_change: ${{ steps.ci-optimize.outputs.actions-change == 'true' }} | ||
ingestion_change: ${{ steps.ci-optimize.outputs.ingestion-change == 'true' }} | ||
ingestion_base_change: ${{ steps.ci-optimize.outputs.ingestion-base-change == 'true' }} | ||
backend_change: ${{ steps.ci-optimize.outputs.backend-change == 'true' }} | ||
|
@@ -1030,6 +1032,72 @@ jobs: | |
with: | ||
sarif_file: "trivy-results.sarif" | ||
|
||
datahub_actions_build: | ||
name: Build and Push DataHub Actions Docker Image | ||
runs-on: depot-ubuntu-24.04 | ||
needs: [setup, base_build] | ||
if: ${{ needs.setup.outputs.actions_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true'}} | ||
steps: | ||
- name: Check out the repo | ||
uses: acryldata/sane-checkout-action@v3 | ||
|
||
- name: Set up Depot CLI | ||
if: ${{ env.DOCKER_CACHE == 'DEPOT' }} | ||
uses: depot/setup-action@v1 | ||
|
||
- uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ github.workspace }}/build/dockerBuildContext/ | ||
key: ${{ runner.os }}-docker-${{ github.sha }} | ||
|
||
- name: Build and push | ||
uses: ./.github/actions/docker-custom-build-and-push | ||
with: | ||
images: | | ||
${{ env.DATAHUB_ACTIONS_IMAGE }} | ||
image_tag: ${{ needs.setup.outputs.tag }} | ||
username: ${{ secrets.ACRYL_DOCKER_USERNAME }} | ||
password: ${{ secrets.ACRYL_DOCKER_PASSWORD }} | ||
publish: ${{ needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true' }} | ||
context: ./build/dockerBuildContext/datahub-frontend/docker | ||
file: ./docker/datahub-frontend/Dockerfile | ||
platforms: linux/amd64,linux/arm64/v8 | ||
datahub_actions_scan: | ||
name: "[Monitoring] Scan Datahub Actions images for vulnerabilities" | ||
runs-on: depot-ubuntu-24.04 | ||
needs: [setup, smoke_test_lint,datahub_actions_build] | ||
if: ${{ needs.setup.outputs.actions_change == 'true' || needs.setup.outputs.publish == 'true' }} | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
steps: | ||
- name: Checkout # adding checkout step just to make trivy upload happy | ||
uses: actions/checkout@v4 | ||
- name: Download image | ||
uses: ishworkh/[email protected] | ||
if: ${{ needs.setup.outputs.publish != 'true' && needs.setup.outputs.pr-publish != 'true' }} | ||
with: | ||
image: ${{ env.DATAHUB_ACTIONS_IMAGE }}:${{ needs.setup.outputs.unique_tag }} | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
env: | ||
TRIVY_OFFLINE_SCAN: true | ||
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2,ghcr.io/aquasecurity/trivy-db:2 | ||
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1,ghcr.io/aquasecurity/trivy-java-db:1 | ||
with: | ||
image-ref: ${{ env.DATAHUB_ACTIONS_IMAGE }}:${{ needs.setup.outputs.unique_tag }} | ||
format: "template" | ||
template: "@/contrib/sarif.tpl" | ||
output: "trivy-results.sarif" | ||
severity: "CRITICAL,HIGH" | ||
ignore-unfixed: true | ||
vuln-type: "os,library" | ||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: "trivy-results.sarif" | ||
|
||
smoke_test_matrix: | ||
runs-on: depot-ubuntu-24.04-small | ||
needs: setup | ||
|
@@ -1152,8 +1220,7 @@ jobs: | |
env: | ||
DATAHUB_TELEMETRY_ENABLED: false | ||
DATAHUB_VERSION: ${{ needs.setup.outputs.unique_tag }} | ||
DATAHUB_ACTIONS_IMAGE: ${{ env.DATAHUB_INGESTION_BASE_IMAGE }} | ||
ACTIONS_VERSION: ${{ needs.datahub_ingestion_slim_build.outputs.tag || 'head-slim' }} | ||
DATAHUB_ACTIONS_IMAGE: ${{ env.DATAHUB_ACTIONS_IMAGE }} | ||
ACTIONS_EXTRA_PACKAGES: "acryl-datahub-actions[executor] acryl-datahub-actions" | ||
ACTIONS_CONFIG: "https://raw.githubusercontent.com/acryldata/datahub-actions/main/docker/config/executor.yaml" | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
venv*/ | ||
.coverage | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
junit.*xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2059:info:2:24: Don't use variables in the printf format string. Use printf '..%s..' "$foo" [shellcheck]
datahub/.github/workflows/docker-unified.yml
Line 1123 in 3d3b366