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

Signing for compliance builder implemented and tested #113811

Closed
godofredoc opened this issue Oct 21, 2022 · 9 comments
Closed

Signing for compliance builder implemented and tested #113811

godofredoc opened this issue Oct 21, 2022 · 9 comments
Assignees
Labels
team-infra Owned by Infrastructure team

Comments

@godofredoc
Copy link
Contributor

Signing for compliance will be implemented as multiple small independent pieces with a final integration task. The list of tasks is the following:

  • Create a signer.py recipe in https://cs.opensource.google/flutter/recipes/+/main:recipes/engine_v2/
  • The recipe receives a property config_name. This property is used to read the configuration from a checkout of the engine repository and ci/builders/<config_name>
  • The json file is read to collect the final destination of the artifacts generated by the build. This includes both the artifacts generated by builders and for global generators.
  • The list is iterated running one signer tool command per file. This can be optimized using the multiprocessing API.
  • For simplicity we assume that every single artifacts needs to be codesigned and the action of signing or not is delegated to the signing tool
@godofredoc
Copy link
Contributor Author

To test the implementation we need to:

  • git add signer.py.
  • led get-builder 'luci.flutter.try:Mac Engine Drone' > signer.json
  • vim signer.json and replace recipe name with engine_v2/signer and add a property called config_name with a value of mac_host_engine
  • run the signer with led cat signer.json | led edit-recipe-bundle | led edit-system -p 20 | led launch -modernize
  • Add functionality to recipe, test, iterate

@godofredoc
Copy link
Contributor Author

Once we land this part I'll provide instructions for the second part and third parts.

@godofredoc godofredoc added the team-infra Owned by Infrastructure team label Oct 21, 2022
@godofredoc
Copy link
Contributor Author

\cc @khyati82

@XilaiZhang
Copy link
Contributor

XilaiZhang commented Oct 21, 2022

Yeah earlier today I re-studied schedule_builds and my understanding was that since each build in the builds will share the same recipe when we trigger them from shard_util_v2.schedule_builds, I would normalize the format of 'builds' and 'archives' in shard util v2, so that the signer recipe can use the same runsteps() for each build no matter it is in the format of 'builds' or the format of 'archives'. But yeah looking at the spec now I guess I implemented the wrong thing again. Fortunately this current spec seems very easy and I can do it 👍

@godofredoc
Copy link
Contributor Author

Signer recipe is ready: https://flutter-review.googlesource.com/c/recipes/+/35006

pbo-linaro pushed a commit to pbo-linaro/flutter-recipes that referenced this issue Nov 24, 2022
This recipe will be used to sign mac artifacts for compliance.

Bug: flutter/flutter#113811

Change-Id: I869ce06dfd0b18fb400af6cca4cdcdf82b8c2d4c
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/35006
Reviewed-by: Godofredo Contreras <godofredoc@google.com>
Reviewed-by: Xilai Zhang <xilaizhang@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
@godofredoc
Copy link
Contributor Author

Integrate signer builder with recipes v2:

  • At the end of the engine_v2 recipe add a new section for signing. https://cs.opensource.google/flutter/recipes/+/main:recipes/engine_v2/engine_v2.py;l=167
  • We need to iterate the builds list and pass every archive config to paths = api.archives.engine_v2_gcs_paths(checkout, archive_config) the will give us a DS with the local path and final destination.
  • Send the full list of archive artifacts to the signer recipes using the shard_util_v2 schedule method.

@XilaiZhang
Copy link
Contributor

As pointed out by sir Godofredo and Christopher, the new way of building it is through led get-build -real-build 8797863654106084673 > signer-2.json

@godofredoc
Copy link
Contributor Author

Closing this as complete, mac_ios and mac_host_engine are now code signing artifacts correctly in beta:

@github-actions
Copy link

github-actions bot commented May 3, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-infra Owned by Infrastructure team
Projects
None yet
Development

No branches or pull requests

2 participants