-
Notifications
You must be signed in to change notification settings - Fork 938
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
lets just try dockah #15585
lets just try dockah #15585
Changes from 75 commits
610a4cf
fa266e1
b657159
94447d9
33c9609
b5635ae
08f5231
9617f25
e2207ee
bf62731
e8ef0b9
674df60
07f1f3c
0decba0
0acbded
b0fe768
864903f
d05e83b
d768e24
4a65dcd
bd4560e
c7b06a8
52b10ad
6bb72e0
b18d269
cb2f9a9
0aa5f30
6af126d
57fb2be
157441b
ce6e50b
285afe8
a19c5fd
153c653
ac8afa6
f01600a
28b54b8
36c2077
8629f4d
879a6c1
a356e2e
e5f76d4
d40a9ef
0c66f4b
e651330
0c708ee
ea18ba5
3675a5b
c99e2db
02b0b6d
f3794fa
9bf195e
5048aaa
86060af
dd3bacc
51fd10c
ef0beac
1551e5e
8c3bc52
e1614d5
dc90ffe
64a839b
11d76d1
ccf44d4
f03fd35
1bdb9f5
30acbe4
a7e40fa
ef0ebcc
dba0c7b
293bb1b
d8b5ea8
6519269
9e3a588
8ad6742
8f9faa6
2f1eed3
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 |
---|---|---|
|
@@ -9,60 +9,102 @@ on: | |
workflow_dispatch: # generally only for the "combine-prs" workflow | ||
permissions: | ||
contents: read | ||
packages: read | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
jobs: | ||
deps: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install platform dependencies | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config libxml2-dev libxslt-dev | ||
- uses: actions/setup-python@v5 | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache RUN --mount=type=cache /var/cache/apt | ||
uses: actions/cache@v3 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: pip cache | ||
uses: actions/cache@v4 | ||
path: var-cache-apt | ||
key: var-cache-apt-${{ hashFiles('Dockerfile') }} | ||
restore-keys: | | ||
var-cache-apt- | ||
- name: Cache RUN --mount=type=cache /var/lib/apt | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ runner.os }} | ||
- name: Cache built Python environment | ||
uses: actions/cache@v4 | ||
path: var-lib-apt | ||
key: var-lib-apt-${{ hashFiles('Dockerfile') }} | ||
restore-keys: | | ||
var-lib-apt- | ||
- name: Cache RUN --mount=type=cache /root/.cache/pip | ||
uses: actions/cache@v3 | ||
with: | ||
path: root-cache-pip | ||
key: root-cache-pip-${{ hashFiles('requirements/*.txt') }} | ||
restore-keys: | | ||
root-cache-pip- | ||
- name: Cache RUN --mount=type=cache /root/.npm | ||
uses: actions/cache@v3 | ||
with: | ||
path: root-npm | ||
key: root-npm-${{ hashFiles('package.json', 'package-lock.json') }} | ||
restore-keys: | | ||
root-npm- | ||
- name: inject var-cache-apt into docker | ||
uses: reproducible-containers/buildkit-cache-dance@v2.1.4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
- name: Install Python dependencies | ||
cache-source: var-cache-apt | ||
cache-target: /var/cache/apt | ||
skip-extraction: ${{ steps.cache-var-cache-apt.outputs.cache-hit }} | ||
- name: inject var-lib-apt into docker | ||
uses: reproducible-containers/buildkit-cache-dance@v2.1.4 | ||
with: | ||
cache-source: var-lib-apt | ||
cache-target: /var/lib/apt | ||
skip-extraction: ${{ steps.cache-var-lib-apt.outputs.cache-hit }} | ||
- name: inject root-cache-pip into docker | ||
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. these combined with the normal "cache" steps help us persist |
||
uses: reproducible-containers/buildkit-cache-dance@v2.1.4 | ||
with: | ||
cache-source: root-cache-pip | ||
cache-target: /root/.cache/pip | ||
skip-extraction: ${{ steps.cache-root-cache-pip.outputs.cache-hit }} | ||
- name: inject root-npm into docker | ||
uses: reproducible-containers/buildkit-cache-dance@v2.1.4 | ||
with: | ||
cache-source: root-npm | ||
cache-target: /root/.npm | ||
skip-extraction: ${{ steps.cache-root-npm.outputs.cache-hit }} | ||
- name: Build Docker Image | ||
run: | | ||
pip install -U setuptools wheel pip | ||
pip install -r requirements.txt --no-deps | ||
pip install -r requirements/dev.txt | ||
pip check | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | ||
di marked this conversation as resolved.
Show resolved
Hide resolved
|
||
docker buildx build --build-arg="DEVEL=yes" --build-arg="CI=yes" --cache-to type=gha,mode=max --cache-from type=gha --push -t ghcr.io/pypi/warehouse:ci-${{ github.run_id }} . | ||
test: | ||
# Time out if our test suite has gotten hung | ||
timeout-minutes: 15 | ||
needs: deps | ||
needs: build | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Tests | ||
command: bin/tests --postgresql-host localhost | ||
command: bin/tests --postgresql-host postgres | ||
- name: Lint | ||
command: bin/lint | ||
- name: User Documentation | ||
command: bin/user-docs | ||
- name: Developer Documentation | ||
command: bin/dev-docs | ||
- name: Dependencies | ||
command: bin/github-actions-deps | ||
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. something goes wrong trying to run git in the container. without the gha specific deps job... we burn an extra minute of CI every run :/ |
||
command: bin/deps | ||
- name: Licenses | ||
command: bin/licenses | ||
- name: Translations | ||
command: bin/translations | ||
- name: User Documentation | ||
command: bin/user-docs | ||
- name: Developer Documentation | ||
command: bin/dev-docs | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/pypi/warehouse:ci-${{ github.run_id }} | ||
env: | ||
BILLING_BACKEND: warehouse.subscriptions.services.MockStripeBillingService api_base=http://stripe:12111 api_version=2020-08-27 | ||
services: | ||
postgres: | ||
image: ${{ (matrix.name == 'Tests') && 'postgres:14.11' || '' }} | ||
|
@@ -77,31 +119,15 @@ jobs: | |
ports: | ||
- 12111:12111 | ||
name: ${{ matrix.name }} | ||
env: | ||
BILLING_BACKEND: warehouse.subscriptions.services.MockStripeBillingService api_base=http://localhost:12111 api_version=2020-08-27 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install platform dependencies | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config libxml2-dev libxslt-dev | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Cache mypy results | ||
if: ${{ (matrix.name == 'Lint') }} | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
dev/.mypy_cache | ||
key: ${{ runner.os }}-mypy-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
- name: Restore built Python environment from deps | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
# Since we don't install deps again, we fail if we can't restore the cache (timeout, etc) | ||
fail-on-cache-miss: true | ||
key: ${{ runner.os }}-mypy-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
- name: Run ${{ matrix.name }} | ||
run: ${{ matrix.command }} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ build-mos: compile-pot | |
translations: compile-pot | ||
ifneq ($(GITHUB_ACTIONS), false) | ||
cd ../../; \ | ||
git diff --quiet ./warehouse/locale/messages.pot || (echo "There are outstanding translations, run 'make translations' and commit the changes."; exit 1) | ||
cmp -s ./warehouse/locale/messages.pot /opt/warehouse/src/warehouse/locale/messages.pot || (echo "There are outstanding translations, run 'make translations' and commit the changes."; exit 1) | ||
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. this leverages the fact that we have a copy of the messages.pot from the build step since git diff doesn't work in the container. |
||
else | ||
endif | ||
|
||
|
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.
Exposes the necessary variables for the
gha
cache type to work for docker layers, see https://docs.docker.com/build/cache/backends/gha/#authentication