Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

v1v
Copy link
Member

@v1v v1v commented Mar 25, 2024

What does this pull request do?

Use https://github.com/github-early-access/generate-build-provenance to create build attestations for binaries and docker images

https://github.com/elastic/apm-agent-python/attestations is the one with the different executions.

Comment on lines 31 to 32
- name: Build packages
run: ./dev-utils/make-packages.sh
Copy link
Member Author

Choose a reason for hiding this comment

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

This should help with reusing the script somewhere else and do some post-build steps

needs:
- build-distribution
runs-on: ubuntu-latest
permissions:
Copy link
Member Author

Choose a reason for hiding this comment

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

For the build attestation

if [ "${{ startsWith(github.ref, 'refs/tags') }}" == "false" ] ; then
# for testing purposes
echo "tag=test" >> "${GITHUB_OUTPUT}"
echo "latest=test-latest" >> "${GITHUB_OUTPUT}"
Copy link
Member Author

@v1v v1v Mar 25, 2024

Choose a reason for hiding this comment

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

To help with creating docker images on the fly and use them even for testing the release in a feature branch or main.

if: startsWith(github.ref, 'refs/tags')
run: |-
docker push --all-tags ${{ env.DOCKER_IMAGE_NAME }}
- name: Build and push image
Copy link
Member Author

Choose a reason for hiding this comment

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

Required for the attestation

secret/observability-team/ci/service-account/apm-agent-python access_key_id | AWS_ACCESS_KEY_ID ;
secret/observability-team/ci/service-account/apm-agent-python secret_access_key | AWS_SECRET_ACCESS_KEY
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
Copy link
Member Author

Choose a reason for hiding this comment

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

Faster builds

- "v*.*.*"
branches:
- main
- feature/sbom
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrequired

@v1v v1v changed the title github-action: sbom generation (initial attempt) github-action: provenance generation (initial attempt) Mar 25, 2024
@v1v v1v changed the title github-action: provenance generation (initial attempt) github-action: enable provenance Apr 23, 2024
@v1v v1v marked this pull request as ready for review April 23, 2024 12:04
@v1v v1v requested review from a team April 23, 2024 12:04
@v1v v1v self-assigned this Apr 23, 2024
@v1v v1v merged commit 186996f into main Apr 23, 2024
@v1v v1v deleted the feature/sbom branch April 23, 2024 16:19
- name: Attest image
uses: github-early-access/generate-build-provenance@main
with:
subject-name: "${{ env.DOCKER_IMAGE_NAME }}:${{ steps.setup-docker.outputs.tag }}"
Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/github-early-access/generate-build-provenance/tree/main?tab=readme-ov-file#container-image says:

... Do NOT include a tag as part of the image name -- the specific image being attested is identified by the supplied digest. ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!! Fixing it now

Copy link
Member Author

Choose a reason for hiding this comment

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

xrmx pushed a commit to xrmx/apm-agent-python that referenced this pull request May 17, 2024
xrmx pushed a commit to xrmx/apm-agent-python that referenced this pull request May 20, 2024
xrmx pushed a commit that referenced this pull request May 24, 2024
xrmx pushed a commit to xrmx/apm-agent-python that referenced this pull request Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants