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

GH-43951: [CI][Python] Use GitHub Packages for vcpkg cache #44644

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

kou
Copy link
Member

@kou kou commented Nov 5, 2024

Rationale for this change

We're using only Docker level cache for vcpkg used for wheels. If we have any vcpkg related changes, all vcpkg ports are rebuilt. It's time consuming.

What changes are included in this PR?

Enable NuGet + GitHub Packages based cache. It's port level cache. So we don't need to rebuild all ports when we have any vcpkg related changes.

See also: https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-packages

NuGet + GitHub Packages based cache isn't enabled with manylinux2014 + aarch64. Because EPEL for CentOS 7 + aarch64 provides old Mono. (FYI: EPEL for CentOS 7 + x86_64 provides newer Mono.) We can't use old Mono to run NuGet on Linux.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Copy link

github-actions bot commented Nov 5, 2024

⚠️ GitHub issue #43951 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Nov 5, 2024
@kou
Copy link
Member Author

kou commented Nov 5, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

Copy link

github-actions bot commented Nov 5, 2024

Failed to render template `python-wheels/github.linux.yml` with UndefinedError: 'secrets' is undefined
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/11678507794

@kou kou force-pushed the ci-wheel-manylinux-vcpkg-cache branch from c931193 to f401684 Compare November 5, 2024 06:08
@kou
Copy link
Member Author

kou commented Nov 5, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 5, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 5, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 5, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 5, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

1 similar comment
@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

@kou kou changed the title GH-43951: [CI][Python] Use GitHub Packages for vcpkg cache GH-43951: [CI][Python] Use GitHub Actions cache for vcpkg cache Nov 6, 2024
@kou kou force-pushed the ci-wheel-manylinux-vcpkg-cache branch from 78ee981 to 8b4f8ab Compare November 6, 2024 08:00
@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

2 similar comments
@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

@kou kou changed the title GH-43951: [CI][Python] Use GitHub Actions cache for vcpkg cache GH-43951: [CI][Python] Use GitHub Packages for vcpkg cache Nov 6, 2024
@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

1 similar comment
@kou
Copy link
Member Author

kou commented Nov 6, 2024

@github-actions crossbow submit wheel-manylinux-2-28-cp39-cp39-amd64

This comment was marked as outdated.

@kou kou force-pushed the ci-wheel-manylinux-vcpkg-cache branch from acf6b87 to c75a117 Compare November 8, 2024 22:17
@kou
Copy link
Member Author

kou commented Nov 8, 2024

@github-actions crossbow submit java-jars wheel-manylinux-2014-cp39-cp39-*

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 9, 2024

@github-actions crossbow submit java-jars

This comment was marked as outdated.

@kou
Copy link
Member Author

kou commented Nov 9, 2024

@github-actions crossbow submit -g wheel java-jars

Copy link

github-actions bot commented Nov 9, 2024

Revision: 63d255c

Submitted crossbow builds: ursacomputing/crossbow @ actions-e75f942933

Task Status
java-jars GitHub Actions
python-sdist GitHub Actions
wheel-macos-monterey-cp310-cp310-amd64 GitHub Actions
wheel-macos-monterey-cp310-cp310-arm64 GitHub Actions
wheel-macos-monterey-cp311-cp311-amd64 GitHub Actions
wheel-macos-monterey-cp311-cp311-arm64 GitHub Actions
wheel-macos-monterey-cp312-cp312-amd64 GitHub Actions
wheel-macos-monterey-cp312-cp312-arm64 GitHub Actions
wheel-macos-monterey-cp313-cp313-amd64 GitHub Actions
wheel-macos-monterey-cp313-cp313-arm64 GitHub Actions
wheel-macos-monterey-cp313-cp313t-amd64 GitHub Actions
wheel-macos-monterey-cp313-cp313t-arm64 GitHub Actions
wheel-macos-monterey-cp39-cp39-amd64 GitHub Actions
wheel-macos-monterey-cp39-cp39-arm64 GitHub Actions
wheel-manylinux-2-28-cp310-cp310-amd64 GitHub Actions
wheel-manylinux-2-28-cp310-cp310-arm64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-amd64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-arm64 GitHub Actions
wheel-manylinux-2-28-cp312-cp312-amd64 GitHub Actions
wheel-manylinux-2-28-cp312-cp312-arm64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-amd64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-arm64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313t-amd64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313t-arm64 GitHub Actions
wheel-manylinux-2-28-cp39-cp39-amd64 GitHub Actions
wheel-manylinux-2-28-cp39-cp39-arm64 GitHub Actions
wheel-manylinux-2014-cp310-cp310-amd64 GitHub Actions
wheel-manylinux-2014-cp310-cp310-arm64 GitHub Actions
wheel-manylinux-2014-cp311-cp311-amd64 GitHub Actions
wheel-manylinux-2014-cp311-cp311-arm64 GitHub Actions
wheel-manylinux-2014-cp312-cp312-amd64 GitHub Actions
wheel-manylinux-2014-cp312-cp312-arm64 GitHub Actions
wheel-manylinux-2014-cp313-cp313-amd64 GitHub Actions
wheel-manylinux-2014-cp313-cp313-arm64 GitHub Actions
wheel-manylinux-2014-cp313-cp313t-amd64 GitHub Actions
wheel-manylinux-2014-cp313-cp313t-arm64 GitHub Actions
wheel-manylinux-2014-cp39-cp39-amd64 GitHub Actions
wheel-manylinux-2014-cp39-cp39-arm64 GitHub Actions
wheel-windows-cp310-amd64 GitHub Actions
wheel-windows-cp311-amd64 GitHub Actions
wheel-windows-cp312-amd64 GitHub Actions
wheel-windows-cp313-amd64 GitHub Actions
wheel-windows-cp39-amd64 GitHub Actions

Copy link
Member Author

@kou kou left a comment

Choose a reason for hiding this comment

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

This is ready.

manylinux and java-jar jobs use NuGet + GitHub Packages based cache.
Exception: manylinux2014 + aarch64 jobs don't use it. Because NuGet doesn't work on the platform. (Mono is old.)

We can't use GitHub Actions cache because Crossbow uses only feature (?) branches. We can't use GitHub Actions cache efficiently without the default branch integration.

GITHUB_TOKEN="${GITHUB_TOKEN}" \
VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \
VCPKG_ROOT=C:\\vcpkg
# TODO: Use --mount=type=secret for GITHUB_TOKEN
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll work on this in a follow-up task.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Nov 10, 2024

# TODO: Use --mount=type=secret for GITHUB_TOKEN
Copy link
Member

Choose a reason for hiding this comment

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

Is there an issue open for this? If so, can we mention the GH issue number?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. I'll open it when this is merged or someone agrees that we should do it.

VCPKG_FORCE_SYSTEM_BINARIES=1 \
VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg \
GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \
GITHUB_TOKEN="${GITHUB_TOKEN}" \
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should merge it like this, it bakes the token into the image. Even if the token is ephemeral it could still be abused (it lives a little longer than the job) and crossbow jobs have full permissions because they don't run as external pull requests.

In addition if people test/build the image locally it could leak their token as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes Awaiting changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants