viirya opened a new pull request, #62:
URL: https://github.com/apache/spark-connect-gateway/pull/62

   ### What changes were proposed in this pull request?
   
   This adds the LICENSE and NOTICE for the container image.
   
   - `LICENSE-binary` is `LICENSE` followed by an appendix that lists the 232 
third-party crates linked into the gateway binary on Linux x86_64. The crates 
are grouped by the license each one is used under. Where a crate offers 
Apache-2.0 as a choice, that is the license used.
   - `licenses-binary/<crate>/` holds the license files of the 81 crates that 
are not used under Apache-2.0 alone. The files are copied unchanged from the 
published crates:
     - MIT: 53
     - Unicode-3.0: 15
     - BSD-3-Clause: 5
     - ISC: 3
     - one each: MIT AND BSD-3-Clause (matchit), Apache-2.0 AND ISC (ring), 
Zlib, CDLA-Permissive-2.0 (webpki-roots) and BSL-1.0
   - The appendix also covers the Rust standard library, which is statically 
linked. It is used under Apache-2.0, apart from two parts:
     - `compiler_builtins` is MIT AND Apache-2.0 WITH LLVM-exception. Its 
license file is in `licenses-binary/compiler_builtins/`.
     - `memchr` is MIT and is already in the list.
   - `NOTICE-binary` is the same as `NOTICE`, because no linked crate ships a 
NOTICE file.
   - `dev/check-license-binary.py` regenerates the crate list from `cargo tree` 
and compares the result with `LICENSE-binary`. It also compares each 
`licenses-binary/` file byte-for-byte with the crate's own file. With `--fix`, 
it rewrites both and prints what it copied.
   - The Dockerfile installs the files as `/LICENSE`, `/NOTICE` and 
`/licenses/`.
     - `.dockerignore` gets an exception for `licenses-binary/`, because its 
`*.md` rule would otherwise drop `pem`'s `LICENSE.md`.
     - `.gitattributes` marks `licenses-binary/` as `-text`, so two CRLF files 
(generic-array, nu-ansi-term) are stored unchanged. Otherwise the repo-wide 
`eol=lf` rule would rewrite them.
   
   Some licenses are not on the resolved list, and some packaging was decided 
case by case:
   
   - CDLA-Permissive-2.0 is Category A per LEGAL-732.
   - The OS packages in the distroless base image are the "system" layer and 
stay out of the list, per LEGAL-437 and LEGAL-695. The appendix points to their 
copyright files in the image.
   - `tonic-prost` publishes no license file. It uses the LICENSE of `tonic`, 
which comes from the same repository and has the same MIT license.
   
   ### Why are the changes needed?
   
   The first release will ship the container image as a convenience binary. The 
gateway binary statically links its Rust dependencies, so ASF release policy 
requires the image's LICENSE and NOTICE to cover that third-party code.
   
   ### Does this PR introduce _any_ user-facing change?
   
   The container image now contains `/LICENSE`, `/NOTICE` and `/licenses/`. 
Nothing else changes.
   
   ### How was this patch tested?
   
   - `dev/check-license-binary.py` passes: `OK: 232 crates, 81 with license 
files`. It also passes in a fresh worktree of the commit. Before the 
`.gitattributes` change, it failed there on the two CRLF files.
   - Before writing the files, I checked the crate list against a separate 
census of `cargo tree -p gateway -e normal,no-proc-macro --target 
x86_64-unknown-linux-gnu`. I also read the license file of every crate that is 
not used under Apache-2.0, to confirm it matches the declared license.
   - I built an image from the three new `COPY` lines with this repo as the 
build context. `/licenses/` had all 82 directories, including `pem/LICENSE.md`.
   - The CI e2e jobs build the full image from the Dockerfile.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes, co-authored with Claude Code.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to