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

feat(CI): add venv caching #6843

Merged
merged 9 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
15 changes: 15 additions & 0 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.7"
cache: 'pip'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

- name: Pull images in background
run: |
docker pull acryldata/datahub-actions:head &
Expand Down Expand Up @@ -514,6 +515,20 @@ jobs:
if: ${{ needs.setup.outputs.publish != 'true' }}
with:
image: ${{ env.DATAHUB_MAE_CONSUMER_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/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: check background image download status
run: |
jobs
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/metadata-ingestion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,28 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: vemonet/setup-spark@v1 # spark is required for pyspark+pydeequ data lake profiling
with:
spark-version: "3.0.3"
hadoop-version: "3.2"
- name: Install dependencies
run: ./metadata-ingestion/scripts/install_deps.sh
- name: Calculate pip install plan
id: "packages_checksum"
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 . ${{ matrix.extraPythonRequirement }} | tail -n 1 > /tmp/would_be_installed.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pip install --dry-run -e . ${{ matrix.extraPythonRequirement }} | tail -n 1 > /tmp/would_be_installed.txt
pip install --dry-run -e .[dev] ${{ matrix.extraPythonRequirement }} | tail -n 1 > /tmp/would_be_installed.txt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also add [integration-tests], but that's not used by all tests in the matrix

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: ./metadata-ingestion/venv/
key: ${{ runner.os }}-venv-${{ steps.packages_checksum.outputs.packages_checksum }}-${{ matrix.python-version }}-${{ matrix.command }}
- name: Run metadata-ingestion tests (extras ${{ matrix.extraPythonRequirement }})
run: ./gradlew -Pextra_pip_requirements='${{ matrix.extraPythonRequirement }}' :metadata-ingestion:${{ matrix.command }}
- name: pip freeze show list installed
Expand Down