Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tensorchord/pgvecto.rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0
Choose a base ref
...
head repository: tensorchord/pgvecto.rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.0
Choose a head ref

Commits on Jun 27, 2024

  1. feat: increment build (#508)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jun 27, 2024
    Copy the full SHA
    64e8196 View commit details

Commits on Jul 2, 2024

  1. test: fix flaky test in bvector.slt (#512)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 2, 2024
    Copy the full SHA
    9e0edb0 View commit details

Commits on Jul 3, 2024

  1. fix: ivfflat options of pgvector compatibility (#514)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 3, 2024
    Copy the full SHA
    5e250f1 View commit details
  2. fix: fix elkan k means termination condition (#515)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 3, 2024
    Copy the full SHA
    bc4d8ad View commit details

Commits on Jul 4, 2024

  1. ci: skip zomible process in crash test (#516)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 4, 2024
    Copy the full SHA
    94f16ed View commit details

Commits on Jul 8, 2024

  1. fix: set immutable flags for vector util functions (#522)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 8, 2024
    Copy the full SHA
    8e5a8d1 View commit details
  2. feat: add util function pg_vector_index_fence (#521)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 8, 2024
    Copy the full SHA
    023328f View commit details

Commits on Jul 9, 2024

  1. feat: support distance pushdown (#510)

    * feat: support distance pushdown
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix: more corner cases
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix by comments
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * rename to sphere and datum ptr copy
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix: from_polymorphic_datum copy
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix: by comments
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix: do not return proceed
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix unreachable
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * split fetch_scanner_arguments
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix by comments
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * fix
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    
    * add support function mechanism
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
    Signed-off-by: usamoi <usamoi@outlook.com>
    Co-authored-by: usamoi <usamoi@outlook.com>
    cutecutecat and usamoi authored Jul 9, 2024
    Copy the full SHA
    8cb1a90 View commit details

Commits on Jul 10, 2024

  1. ci: lock version of sqllogictest-bin (#523)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 10, 2024
    Copy the full SHA
    98a7b6e View commit details

Commits on Jul 11, 2024

  1. fix: logger issues (#524)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 11, 2024
    Copy the full SHA
    ba390a5 View commit details
  2. chore: replace uuid with integer for segment id (#525)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 11, 2024
    Copy the full SHA
    152f94a View commit details

Commits on Jul 17, 2024

  1. fix: parsing for f32s with a 48-char representation (#531)

    Signed-off-by: Alex Quick <alex@appfigures.com>
    alexquick authored Jul 17, 2024
    Copy the full SHA
    6d64e97 View commit details

Commits on Jul 18, 2024

  1. fix: set fast math flags for c code (#532)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 18, 2024
    Copy the full SHA
    6611165 View commit details
  2. feat: quantization reranker (#530)

    * feat: quantization reranker
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * refactor: split hnsw graph into 4 files
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 18, 2024
    Copy the full SHA
    e182bcf View commit details

Commits on Jul 22, 2024

  1. feat: support CLI (#529)

    * feat: add cli (#26)
    
    * feat: add cli
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * support fvecs/ivecs and query cli
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * rm unused func
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix the conflicts
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    ---------
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * add topk for query
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    ---------
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    kemingy authored Jul 22, 2024
    Copy the full SHA
    97636d7 View commit details
  2. feat: kmeans1d (#533)

    * chore: do not require clang version =15
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * refactor: Vec2
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * feat: kmeans1d
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * ci: set clang-16 as default clang
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: kmeans1d boundary check
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 22, 2024
    Copy the full SHA
    3cd2ca5 View commit details
  3. fix: resolve cli conflicts (#536)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 22, 2024
    Copy the full SHA
    820aecd View commit details
  4. feat: quantization, 1/2/4 bits (#534)

    * feat: product quantization, 1/2/4 bits
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * feat: scalar quantization, 1/2/4 bits
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: panic while building scalar quantization codebook
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 22, 2024
    Copy the full SHA
    ac6a096 View commit details

Commits on Jul 23, 2024

  1. fix: quantization precision (#537)

    * refactor: deprecate veci8
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: only enable spherical k-means for IVF COS/DOT
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 23, 2024
    Copy the full SHA
    9667902 View commit details

Commits on Jul 26, 2024

  1. fix: load ivf_residual files with IvfResidual (#541)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Jul 26, 2024
    Copy the full SHA
    eb01e0d View commit details

Commits on Aug 2, 2024

  1. feat: support inverted index for sparse vector (#517)

    * feat: support inverted index for sparse vector
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fmt
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * ignore cargo clippy len_without_is_empty
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix lint
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * change to bm25 score
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * use fixed array instead of hash
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * adopt the reranker
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * address commments
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * use heap to replace the vec sort
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * use query value
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * change to inverted_sparse
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix lint
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * rename to inverted_index
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * build the compressed matrix from token(vec<doc_id, score>)
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * rm filter, return all the docs from the heap
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * to_index_vec return iter
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    ---------
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    kemingy authored Aug 2, 2024
    Copy the full SHA
    49373c3 View commit details

Commits on Aug 5, 2024

  1. chore: update rust toolchain to 2024/08/05 (#548)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 5, 2024
    1
    Copy the full SHA
    bd83031 View commit details

Commits on Aug 7, 2024

  1. feat: product quantization fast scan (#538)

    * feat: quantization fast scan
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: remove incorrect implementation of fast scan 1bit/2bit
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 7, 2024
    Copy the full SHA
    9e61230 View commit details
  2. feat: parallel k-means (#550)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 7, 2024
    Copy the full SHA
    f84272f View commit details

Commits on Aug 8, 2024

  1. feat: support rabitq for ivf (#535)

    * init the rabitq
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * init rabitq
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * prepare rabitq
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * wait for closure
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * finish the rabitq
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix the query binary transpose
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix toml lint
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix cli
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix ivf residual open
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix typo
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fmt
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * avoid div 0
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * fix binary cmp zero
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * error based reranker pop by lower bound
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * use temp array to heap in err based reranker
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * use window16 for rabitq rerank
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * add ivf projection to reuse the kmeans distance
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    * add epoch to cli query arguments
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    
    ---------
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    kemingy authored Aug 8, 2024
    Copy the full SHA
    0123019 View commit details

Commits on Aug 9, 2024

  1. fix: add spherical_centroids & residual_quantization option to ivf (#551

    )
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 9, 2024
    Copy the full SHA
    be52219 View commit details

Commits on Aug 12, 2024

  1. refactor: remove indexing on cosine similarity on backend (#555)

    * fix: remove indexing on cosine distance on backend
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * refactor: removes unused cosine code
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * add tests
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 12, 2024
    Copy the full SHA
    487ea6b View commit details

Commits on Aug 13, 2024

  1. fix: rabitq (#556)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 13, 2024
    Copy the full SHA
    8c9080d View commit details
  2. test: fix cos test by comparing shorter result list (#557)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 13, 2024
    Copy the full SHA
    286c3c9 View commit details

Commits on Aug 14, 2024

  1. chore: Refine readme (#553)

    * chore: Refine
    
    Signed-off-by: Ce Gao <cegao@tensorchord.ai>
    
    * chore: Address comments
    
    Signed-off-by: Ce Gao <cegao@tensorchord.ai>
    
    ---------
    
    Signed-off-by: Ce Gao <cegao@tensorchord.ai>
    gaocegege authored Aug 14, 2024
    Copy the full SHA
    835c4a7 View commit details
  2. fix: hnsw rebuilding (#558)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 14, 2024
    Copy the full SHA
    94e4e2f View commit details
  3. fix: add v4, v3 for vecf32 dot, sl2 (#559)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 14, 2024
    Copy the full SHA
    813c04d View commit details

Commits on Aug 15, 2024

  1. refactor: reduce cost about sort and quantization virtual function ca…

    …ll (#560)
    
    * refactor: use internal id and reduce cost on sort
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * refactor: reduce cost of quantization virtual function call
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: hnsw nan behavior
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 15, 2024
    Copy the full SHA
    20e84ca View commit details

Commits on Aug 20, 2024

  1. feat: pyo3 bindings of indexing (#565)

    * feat: pyo3 bindings of indexing
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: ci
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 20, 2024
    Copy the full SHA
    ab1edc9 View commit details

Commits on Aug 22, 2024

  1. chore: update pgrx to v0.12.1 (#567)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 22, 2024
    Copy the full SHA
    86bbed2 View commit details
  2. refactor: introduce Distance type for comparing (#568)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 22, 2024
    Copy the full SHA
    d259b24 View commit details

Commits on Aug 27, 2024

  1. fix: vectorize as much code as possible (#569)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 27, 2024
    Copy the full SHA
    165b7de View commit details
  2. feat: SIMD version of quantizing (#574)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 27, 2024
    Copy the full SHA
    b7e1a7a View commit details

Commits on Aug 30, 2024

  1. refactor: improve RaBitQ performance (#576)

    * feat: mark Distance::from_f32 and Distance::to_f32 as const
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: compute rough distances on boundary by fast scan if fast scan is used
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: visit IVF centroids in order
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * refactor: rabitq abs
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * refactor: rewrite error-based reranker
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * feat: compute all distances from vectors to centroids in IVF parallelly
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: speed computing x2 in preprocessing
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: speed gen in preprocessing
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: parallelize kmeans++
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: add prefer_multithreading to k_means
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: increase kmeans samples in IVF
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: move spherical operation after split_clusters in kmeans
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * test: strengthen AVX2/AVX512 code tests and remove flasky bvector test
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * feat: fallback version of fast scan
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: rename mul_add to mul_add_round
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 30, 2024
    Copy the full SHA
    8727ce3 View commit details
  2. chore: add enterprise release (#578)

    ---------
    
    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    kemingy authored Aug 30, 2024
    Copy the full SHA
    a71e9ef View commit details
  3. feat: disable kmeans++ in IVF (#579)

    * feat: disable kmeans++ in IVF
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * test: remove flasky test
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Aug 30, 2024
    Copy the full SHA
    f24bef2 View commit details
  4. fix build in enterprise ci (#580)

    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    kemingy authored Aug 30, 2024
    Copy the full SHA
    827c7c3 View commit details

Commits on Sep 2, 2024

  1. fix: use residual vector for encoding (#581)

    * refactor: merge IvfNaive and IvfResidual
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    * fix: use residual vector for encoding
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    
    ---------
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 2, 2024
    Copy the full SHA
    4bac484 View commit details
  2. fix: use u32 for rabitq quantized sum for DIM > 4369 (#582)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 2, 2024
    Copy the full SHA
    590a9d6 View commit details
  3. feat: do not generate slow-scan lookup table if fast-scan is enabled (#…

    …583)
    
    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 2, 2024
    Copy the full SHA
    3b7c694 View commit details
  4. feat: speed rabitq building (#584)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 2, 2024
    Copy the full SHA
    1fb14c8 View commit details
  5. fix: filter zeros in creating normalized vector (#585)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 2, 2024
    Copy the full SHA
    897b9a3 View commit details
  6. fix: detect simd in cli (#586)

    Signed-off-by: Keming <kemingyang@tensorchord.ai>
    kemingy authored Sep 2, 2024
    Copy the full SHA
    f72c5a8 View commit details

Commits on Sep 4, 2024

  1. fix: use correct intrinsics for fp16 in AVX (#589)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 4, 2024
    Copy the full SHA
    2e20358 View commit details

Commits on Sep 5, 2024

  1. fix: set correct svecf32 header while creating SVecf32Output (#590)

    Signed-off-by: usamoi <usamoi@outlook.com>
    usamoi authored Sep 5, 2024
    Copy the full SHA
    8abfd82 View commit details
Showing with 269,208 additions and 83,000 deletions.
  1. +1 −3 .cargo/audit.toml
  2. +14 −31 .github/workflows/psql.yml
  3. +12 −25 .github/workflows/release.yml
  4. +194 −0 .github/workflows/release_enterprise.yml
  5. +3 −3 .github/workflows/release_officially.yml
  6. +36 −0 .github/workflows/release_pg_slim.yml
  7. +38 −91 .github/workflows/rust.yml
  8. +42 −0 .github/workflows/trunk-install-test.yml
  9. +10 −6 .github/workflows/update_vendor.yml
  10. +2 −0 .gitignore
  11. +2 −1 .typos.toml
  12. +973 −486 Cargo.lock
  13. +23 −30 Cargo.toml
  14. +18 −20 README.md
  15. +0 −4 crates/base/Cargo.toml
  16. +7 −0 crates/base/src/aligned.rs
  17. +31 −0 crates/base/src/always_equal.rs
  18. +84 −1 crates/base/src/distance.rs
  19. +219 −143 crates/base/src/index.rs
  20. +5 −3 crates/base/src/lib.rs
  21. +0 −17 crates/base/src/operator/bvecf32_cos.rs
  22. +0 −17 crates/base/src/operator/bvecf32_dot.rs
  23. +0 −17 crates/base/src/operator/bvecf32_jaccard.rs
  24. +0 −17 crates/base/src/operator/bvecf32_l2.rs
  25. +14 −0 crates/base/src/operator/bvect_dot.rs
  26. +14 −0 crates/base/src/operator/bvect_hamming.rs
  27. +14 −0 crates/base/src/operator/bvect_jaccard.rs
  28. +18 −41 crates/base/src/operator/mod.rs
  29. +0 −17 crates/base/src/operator/svecf32_cos.rs
  30. +0 −17 crates/base/src/operator/svecf32_dot.rs
  31. +0 −17 crates/base/src/operator/svecf32_l2.rs
  32. +16 −0 crates/base/src/operator/svect_dot.rs
  33. +16 −0 crates/base/src/operator/svect_l2.rs
  34. +0 −17 crates/base/src/operator/vecf16_cos.rs
  35. +0 −17 crates/base/src/operator/vecf16_dot.rs
  36. +0 −17 crates/base/src/operator/vecf16_l2.rs
  37. +0 −17 crates/base/src/operator/vecf32_cos.rs
  38. +0 −17 crates/base/src/operator/vecf32_dot.rs
  39. +0 −17 crates/base/src/operator/vecf32_l2.rs
  40. +0 −17 crates/base/src/operator/veci8_cos.rs
  41. +0 −17 crates/base/src/operator/veci8_dot.rs
  42. +0 −17 crates/base/src/operator/veci8_l2.rs
  43. +16 −0 crates/base/src/operator/vect_dot.rs
  44. +16 −0 crates/base/src/operator/vect_l2.rs
  45. +53 −0 crates/base/src/pod.rs
  46. +20 −0 crates/base/src/rand.rs
  47. +378 −0 crates/base/src/scalar/bit.rs
  48. +144 −0 crates/base/src/scalar/emulate.rs
  49. +742 −0 crates/base/src/scalar/f16.rs
  50. +1,191 −606 crates/base/src/scalar/f32.rs
  51. +0 −673 crates/base/src/scalar/half_f16.rs
  52. +0 −80 crates/base/src/scalar/i8.rs
  53. +144 −0 crates/base/src/scalar/impossible.rs
  54. +43 −16 crates/base/src/scalar/mod.rs
  55. +35 −22 crates/base/src/search.rs
  56. +0 −537 crates/base/src/vector/bvecf32.rs
  57. +276 −0 crates/base/src/vector/bvect.rs
  58. +100 −41 crates/base/src/vector/mod.rs
  59. +0 −787 crates/base/src/vector/svecf32.rs
  60. +444 −0 crates/base/src/vector/svect.rs
  61. +0 −516 crates/base/src/vector/vecf16.rs
  62. +0 −237 crates/base/src/vector/vecf32.rs
  63. +0 −545 crates/base/src/vector/veci8.rs
  64. +215 −0 crates/base/src/vector/vect.rs
  65. +2 −10 crates/base/src/worker.rs
  66. +0 −3 crates/c/.gitignore
  67. +0 −16 crates/c/Cargo.toml
  68. +0 −10 crates/c/build.rs
  69. +0 −192 crates/c/src/f16.c
  70. +0 −16 crates/c/src/f16.h
  71. +0 −13 crates/c/src/lib.rs
  72. +20 −0 crates/cli/Cargo.toml
  73. +18 −0 crates/cli/README.md
  74. +180 −0 crates/cli/src/args.rs
  75. +162 −0 crates/cli/src/main.rs
  76. +46 −0 crates/cli/src/read.rs
  77. +3 −1 crates/common/Cargo.toml
  78. +24 −2 crates/common/src/clean.rs
  79. +22 −0 crates/common/src/dir_ops.rs
  80. +33 −0 crates/common/src/json.rs
  81. +4 −0 crates/common/src/lib.rs
  82. +12 −10 crates/common/src/mmap_array.rs
  83. +101 −0 crates/common/src/remap.rs
  84. +17 −0 crates/common/src/sample.rs
  85. +23 −0 crates/common/src/variants.rs
  86. +50 −41 crates/common/src/vec2.rs
  87. +0 −2 crates/detect/Cargo.toml
  88. +2 −5 crates/detect/src/lib.rs
  89. +6 −2 crates/detect_macros/src/lib.rs
  90. +0 −313 crates/elkan_k_means/src/lib.rs
  91. +0 −192 crates/elkan_k_means/src/operator.rs
  92. +1 −1 crates/embedding/Cargo.toml
  93. +1 −1 crates/flat/Cargo.toml
  94. +76 −109 crates/flat/src/lib.rs
  95. +3 −4 crates/{elkan_k_means → graph}/Cargo.toml
  96. +5 −0 crates/graph/src/lib.rs
  97. +62 −0 crates/graph/src/prune.rs
  98. +197 −0 crates/graph/src/search.rs
  99. +6 −6 crates/{hnsw → graph}/src/visited.rs
  100. +4 −2 crates/hnsw/Cargo.toml
  101. +570 −501 crates/hnsw/src/lib.rs
  102. +3 −11 crates/index/Cargo.toml
  103. +4 −13 crates/index/src/delete.rs
  104. +0 −84 crates/index/src/indexing.rs
  105. +201 −173 crates/index/src/lib.rs
  106. +79 −4 crates/index/src/optimizing/index_source.rs
  107. +36 −50 crates/index/src/optimizing/indexing.rs
  108. +12 −7 crates/index/src/optimizing/mod.rs
  109. +61 −59 crates/index/src/{segments → segment}/growing.rs
  110. +2 −0 crates/index/src/segment/mod.rs
  111. +53 −37 crates/index/src/{segments → segment}/sealed.rs
  112. +0 −18 crates/index/src/segments/mod.rs
  113. +2 −2 crates/index/src/utils/dir_ops.rs
  114. +19 −0 crates/indexing/Cargo.toml
  115. +32 −0 crates/indexing/src/lib.rs
  116. +234 −0 crates/indexing/src/sealed.rs
  117. +2 −2 crates/interprocess-atomic-wait/src/lib.rs
  118. +2 −3 crates/ivf/Cargo.toml
  119. +0 −295 crates/ivf/src/ivf_naive.rs
  120. +0 −577 crates/ivf/src/ivf_pq.rs
  121. +208 −61 crates/ivf/src/lib.rs
  122. +146 −0 crates/ivf/src/operator.rs
  123. +16 −0 crates/k_means/Cargo.toml
  124. +98 −0 crates/k_means/src/kmeans1d.rs
  125. +69 −0 crates/k_means/src/lib.rs
  126. +176 −0 crates/k_means/src/lloyd.rs
  127. +18 −0 crates/k_means/src/quick_centers.rs
  128. +0 −2 crates/memfd/Cargo.toml
  129. +8 −7 crates/memfd/src/lib.rs
  130. +30 −0 crates/pyvectors/Cargo.toml
  131. +10 −0 crates/pyvectors/pyproject.toml
  132. +40 −0 crates/pyvectors/src/dataset.rs
  133. +122 −0 crates/pyvectors/src/indexing.rs
  134. +117 −0 crates/pyvectors/src/lib.rs
  135. +48 −0 crates/pyvectors/src/with_labels.rs
  136. +7 −2 crates/quantization/Cargo.toml
  137. +428 −0 crates/quantization/src/fast_scan/b4.rs
  138. +1 −0 crates/quantization/src/fast_scan/mod.rs
  139. +167 −79 crates/quantization/src/lib.rs
  140. +0 −22 crates/quantization/src/operator.rs
  141. +765 −0 crates/quantization/src/product.rs
  142. +0 −159 crates/quantization/src/product/mod.rs
  143. +0 −951 crates/quantization/src/product/operator.rs
  144. +385 −0 crates/quantization/src/quantize.rs
  145. +73 −0 crates/quantization/src/quantizer.rs
  146. +724 −0 crates/quantization/src/rabitq.rs
  147. +42 −0 crates/quantization/src/reranker/error.rs
  148. +42 −0 crates/quantization/src/reranker/flat.rs
  149. +40 −0 crates/quantization/src/reranker/graph.rs
  150. +43 −0 crates/quantization/src/reranker/graph_2.rs
  151. +4 −0 crates/quantization/src/reranker/mod.rs
  152. +563 −0 crates/quantization/src/scalar.rs
  153. +0 −103 crates/quantization/src/scalar/mod.rs
  154. +0 −476 crates/quantization/src/scalar/operator.rs
  155. +114 −45 crates/quantization/src/trivial.rs
  156. +32 −0 crates/quantization/src/utils.rs
  157. +1 −1 crates/send_fd/src/lib.rs
  158. +1 −0 crates/service/Cargo.toml
  159. +100 −312 crates/service/src/instance.rs
  160. +1 −3 crates/service/src/lib.rs
  161. +1 −1 crates/service/src/version.rs
  162. +3 −9 crates/service/src/worker.rs
  163. +13 −0 crates/sparse_inverted_index/Cargo.toml
  164. +160 −0 crates/sparse_inverted_index/src/lib.rs
  165. +53 −0 crates/sparse_inverted_index/src/operator.rs
  166. +2 −2 crates/{rayon → stoppable_rayon}/Cargo.toml
  167. +24 −39 crates/{rayon → stoppable_rayon}/src/lib.rs
  168. +3 −0 crates/storage/Cargo.toml
  169. +30 −43 crates/storage/src/bvector.rs
  170. +27 −49 crates/storage/src/lib.rs
  171. +0 −75 crates/storage/src/operator.rs
  172. +46 −52 crates/storage/src/svec.rs
  173. +31 −98 crates/storage/src/vec.rs
  174. +0 −99 crates/storage/src/veci8.rs
  175. +185 −0 docker/pg-cnpg/Dockerfile
  176. +513 −0 docker/pg-cnpg/requirements.txt
  177. +80 −0 docker/pg-cnpg/trunk-install.sh
  178. +139 −0 docker/pg-slim/Dockerfile
  179. +71 −0 docker/pg-slim/docker-ensure-initdb.sh
  180. +356 −0 docker/pg-slim/docker-entrypoint.sh
  181. +1 −10 rust-toolchain.toml
  182. +2 −2 scripts/package.sh
  183. +13 −4 scripts/update_vendor.sh
  184. +233 −233 sql/install/vectors--0.3.0.sql
  185. +1,967 −0 sql/install/vectors--0.4.0.sql
  186. +1,535 −0 sql/upgrade/vectors--0.3.0--0.4.0.sql
  187. +35 −32 src/bgworker/mod.rs
  188. +0 −32 src/bgworker/normal.rs
  189. +63 −90 src/datatype/aggregate_svecf32.rs
  190. +14 −15 src/datatype/aggregate_vecf32.rs
  191. +5 −3 src/datatype/binary.rs
  192. +0 −45 src/datatype/binary_bvecf32.rs
  193. +47 −0 src/datatype/binary_bvector.rs
  194. +10 −11 src/datatype/binary_svecf32.rs
  195. +11 −9 src/datatype/binary_vecf16.rs
  196. +10 −9 src/datatype/binary_vecf32.rs
  197. +0 −55 src/datatype/binary_veci8.rs
  198. +40 −65 src/datatype/casts.rs
  199. +0 −26 src/datatype/functions_bvecf32.rs
  200. +27 −0 src/datatype/functions_bvector.rs
  201. +12 −35 src/datatype/functions_svecf32.rs
  202. +3 −3 src/datatype/functions_vecf16.rs
  203. +3 −3 src/datatype/functions_vecf32.rs
  204. +0 −46 src/datatype/functions_veci8.rs
  205. +0 −178 src/datatype/memory_bvecf32.rs
  206. +229 −0 src/datatype/memory_bvector.rs
  207. +70 −21 src/datatype/memory_svecf32.rs
  208. +71 −19 src/datatype/memory_vecf16.rs
  209. +70 −19 src/datatype/memory_vecf32.rs
  210. +0 −235 src/datatype/memory_veci8.rs
  211. +6 −12 src/datatype/mod.rs
  212. +0 −96 src/datatype/operators_bvecf32.rs
  213. +146 −0 src/datatype/operators_bvector.rs
  214. +96 −167 src/datatype/operators_svecf32.rs
  215. +89 −36 src/datatype/operators_vecf16.rs
  216. +89 −36 src/datatype/operators_vecf32.rs
  217. +0 −100 src/datatype/operators_veci8.rs
  218. +27 −59 src/datatype/{subscript_bvecf32.rs → subscript_bvector.rs}
  219. +23 −45 src/datatype/subscript_svecf32.rs
  220. +22 −27 src/datatype/subscript_vecf16.rs
  221. +22 −27 src/datatype/subscript_vecf32.rs
  222. +0 −199 src/datatype/subscript_veci8.rs
  223. +11 −10 src/datatype/{text_bvecf32.rs → text_bvector.rs}
  224. +10 −11 src/datatype/text_svecf32.rs
  225. +3 −2 src/datatype/text_vecf16.rs
  226. +3 −2 src/datatype/text_vecf32.rs
  227. +0 −53 src/datatype/text_veci8.rs
  228. +17 −10 src/datatype/typmod.rs
  229. +2 −3 src/embedding/mod.rs
  230. +14 −18 src/error.rs
  231. +16 −4 src/gucs/embedding.rs
  232. +70 −4 src/gucs/executing.rs
  233. +3 −2 src/gucs/internal.rs
  234. +4 −18 src/gucs/mod.rs
  235. +3 −2 src/gucs/planning.rs
  236. +63 −33 src/index/am.rs
  237. +160 −39 src/index/am_options.rs
  238. +86 −26 src/index/am_scan.rs
  239. +24 −27 src/index/catalog.rs
  240. +46 −28 src/index/compatibility.rs
  241. +34 −0 src/index/functions.rs
  242. +10 −7 src/index/hooks.rs
  243. +1 −61 src/index/utils.rs
  244. +2 −2 src/ipc/mod.rs
  245. +1 −1 src/ipc/transport/mmap.rs
  246. +3 −4 src/lib.rs
  247. +0 −111 src/logger/message.rs
  248. +13 −22 src/logger/mod.rs
  249. +176 −0 src/logger/postgres.rs
  250. +0 −21 src/logger/protocol.rs
  251. +5 −1 src/sql/bootstrap.sql
  252. +184 −204 src/sql/finalize.sql
  253. +54 −0 src/upgrade/symbols.rs
  254. +12 −28 src/utils/parse.rs
  255. +4 −1 tests/crash/kill.py
  256. +4 −23 tests/sqllogictest/bvector.slt
  257. +4 −4 tests/sqllogictest/compact_stmt.slt
  258. +33 −0 tests/sqllogictest/cos.slt
  259. +0 −55 tests/sqllogictest/int8.slt
  260. +1 −1 tests/sqllogictest/ivf.slt
  261. +3 −3 tests/sqllogictest/partition.slt
  262. +146 −0 tests/sqllogictest/pushdown_plan.slt
  263. +104 −0 tests/sqllogictest/pushdown_range.slt
  264. +0 −34 tests/sqllogictest/veci8_binary.slt
  265. +0 −23 tests/sqllogictest/veci8_storage.slt
  266. +0 −73 tests/sqllogictest/veci8_subscript.slt
  267. +6 −4 tools/schema.sh
  268. +2 −0 vendor/pg14_aarch64_debian/pg_config/pg_config
  269. +5 −5 vendor/{pg_config/pg14_aarch64-unknown-linux-gnu.txt → pg14_aarch64_debian/pg_config/pg_config.txt}
  270. +20,194 −11,441 ...inding/pg14_aarch64-unknown-linux-gnu.rs → pg14_aarch64_debian/pgrx_binding/pg14_raw_bindings.rs}
  271. +2 −0 vendor/pg14_x86_64_debian/pg_config/pg_config
  272. +4 −4 vendor/{pg_config/pg14_x86_64-unknown-linux-gnu.txt → pg14_x86_64_debian/pg_config/pg_config.txt}
  273. +20,121 −11,354 ..._binding/pg14_x86_64-unknown-linux-gnu.rs → pg14_x86_64_debian/pgrx_binding/pg14_raw_bindings.rs}
  274. +2 −0 vendor/pg15_aarch64_debian/pg_config/pg_config
  275. +5 −5 vendor/{pg_config/pg15_aarch64-unknown-linux-gnu.txt → pg15_aarch64_debian/pg_config/pg_config.txt}
  276. +20,485 −11,562 ...inding/pg15_aarch64-unknown-linux-gnu.rs → pg15_aarch64_debian/pgrx_binding/pg15_raw_bindings.rs}
  277. +2 −0 vendor/pg15_x86_64_debian/pg_config/pg_config
  278. +4 −4 vendor/{pg_config/pg15_x86_64-unknown-linux-gnu.txt → pg15_x86_64_debian/pg_config/pg_config.txt}
  279. +20,430 −11,493 ..._binding/pg15_x86_64-unknown-linux-gnu.rs → pg15_x86_64_debian/pgrx_binding/pg15_raw_bindings.rs}
  280. +2 −0 vendor/pg16_aarch64_debian/pg_config/pg_config
  281. +5 −5 vendor/{pg_config/pg16_aarch64-unknown-linux-gnu.txt → pg16_aarch64_debian/pg_config/pg_config.txt}
  282. +21,021 −11,758 ...inding/pg16_aarch64-unknown-linux-gnu.rs → pg16_aarch64_debian/pgrx_binding/pg16_raw_bindings.rs}
  283. +2 −0 vendor/pg16_x86_64_debian/pg_config/pg_config
  284. +4 −4 vendor/{pg_config/pg16_x86_64-unknown-linux-gnu.txt → pg16_x86_64_debian/pg_config/pg_config.txt}
  285. +20,966 −11,689 ..._binding/pg16_x86_64-unknown-linux-gnu.rs → pg16_x86_64_debian/pgrx_binding/pg16_raw_bindings.rs}
  286. +2 −0 vendor/pg17_aarch64_debian/pg_config/pg_config
  287. +23 −0 vendor/pg17_aarch64_debian/pg_config/pg_config.txt
  288. +62,609 −0 vendor/pg17_aarch64_debian/pgrx_binding/pg17_raw_bindings.rs
  289. +2 −0 vendor/pg17_x86_64_debian/pg_config/pg_config
  290. +23 −0 vendor/pg17_x86_64_debian/pg_config/pg_config.txt
  291. +62,576 −0 vendor/pg17_x86_64_debian/pgrx_binding/pg17_raw_bindings.rs
4 changes: 1 addition & 3 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[advisories]
ignore = [
"RUSTSEC-2021-0127", # serde_cbor is unmaintained / serde_cbor is not used
]
ignore = ["RUSTSEC-2021-0127", "RUSTSEC-2021-0145"]
45 changes: 14 additions & 31 deletions .github/workflows/psql.yml
Original file line number Diff line number Diff line change
@@ -42,16 +42,19 @@ env:
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
RUSTFLAGS: "-Dwarnings"
CARGO_PROFILE_OPT_BUILD_OVERRIDE_DEBUG: true

jobs:
test:
strategy:
matrix:
version: [14, 15, 16]
version: [14, 15, 16, 17]
arch: ["x86_64"]
runs-on: ubuntu-latest
env:
SEMVER: "0.0.0"
VERSION: ${{ matrix.version }}
ARCH: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -74,47 +77,27 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.version }}
- name: Set up Clang-16
- name: Build
run: |
sudo sh -c 'echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-16 main" >> /etc/apt/sources.list'
wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y clang-16
- name: Set up Pgrx
run: |
# pg_config
mkdir -p ~/.pg_config
touch ~/.pg_config/pg_config
chmod 777 ~/.pg_config/pg_config
echo "#!/usr/bin/env bash" >> ~/.pg_config/pg_config
echo "$(pwd)/tools/pg_config.sh \"\$@\" < $(pwd)/vendor/pg_config/pg${VERSION}_$(uname --machine)-unknown-linux-gnu.txt" >> ~/.pg_config/pg_config
mkdir -p ~/.pgrx && echo "configs.pg$VERSION=\"$HOME/.pg_config/pg_config\"" > ~/.pgrx/config.toml
# pgrx_binding
mkdir -p ~/.pgrx_binding
cp ./vendor/pgrx_binding/pg${VERSION}_$(uname --machine)-unknown-linux-gnu.rs ~/.pgrx_binding/pg${VERSION}_raw_bindings.rs
echo PGRX_TARGET_INFO_PATH_PG$VERSION=$HOME/.pgrx_binding >> "$GITHUB_ENV"
- name: Build Release
run: |
cargo build --lib --features "pg$VERSION" --release
./tools/schema.sh --features "pg$VERSION" --release | expand -t 4 > ./target/vectors--$SEMVER.sql
- name: Set up PostgreSQL
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg${VERSION}_${ARCH}_debian/pg_config/pg_config
export PGRX_TARGET_INFO_PATH_PG$VERSION=$(pwd)/vendor/pg${VERSION}_${ARCH}_debian/pgrx_binding
cargo build --package pgvectors --lib --features pg$VERSION --target $ARCH-unknown-linux-gnu --profile opt
./tools/schema.sh --features pg$VERSION --target $ARCH-unknown-linux-gnu --profile opt | expand -t 4 > ./target/schema.sql
- name: Install
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql-$VERSION
echo "local all all trust" | sudo tee /etc/postgresql/$VERSION/main/pg_hba.conf
echo "host all all 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/$VERSION/main/pg_hba.conf
echo "host all all ::1/128 trust" | sudo tee -a /etc/postgresql/$VERSION/main/pg_hba.conf
sudo systemctl restart postgresql
sudo -iu postgres createuser -s -r $USER
createdb
- name: Install Release
run: |
sudo cp ./target/vectors--$SEMVER.sql /usr/share/postgresql/$VERSION/extension/vectors--$SEMVER.sql
sudo cp ./target/release/libvectors.so "/usr/lib/postgresql/$VERSION/lib/vectors.so"
sudo cp ./target/schema.sql /usr/share/postgresql/$VERSION/extension/vectors--$SEMVER.sql
sudo cp ./target/$ARCH-unknown-linux-gnu/opt/libvectors.so "/usr/lib/postgresql/$VERSION/lib/vectors.so"
sed -e "s/@CARGO_VERSION@/$SEMVER/g" < ./vectors.control | sudo tee "/usr/share/postgresql/$VERSION/extension/vectors.control"
psql -c 'ALTER SYSTEM SET shared_preload_libraries = "vectors.so"'
@@ -129,7 +112,7 @@ jobs:
- name: Set up cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Set up Sqllogictest
run: cargo binstall sqllogictest-bin -y --force
run: cargo binstall sqllogictest-bin --version 0.20.6 -y --force
- name: Test
run: ./tests/tests.sh
- name: Post Set up Cache
37 changes: 12 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ jobs:
binary:
strategy:
matrix:
version: [14, 15, 16]
version: [14, 15, 16, 17]
arch: ["x86_64", "aarch64"]
runs-on: ubuntu-20.04
env:
@@ -59,7 +59,11 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential crossbuild-essential-arm64
sudo apt-get install -y qemu-user-static
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' | tee ~/.cargo/config.toml
touch ~/.cargo/config.toml
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
echo 'target.aarch64-unknown-linux-gnu.runner = ["qemu-aarch64-static", "-L", "/usr/aarch64-linux-gnu"]' >> ~/.cargo/config.toml
rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
- name: Set up Sccache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Set up Cache
@@ -71,29 +75,12 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.version }}-${{ matrix.arch }}
- name: Set up Clang-16
run: |
sudo sh -c 'echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-16 main" >> /etc/apt/sources.list'
wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y clang-16
- name: Set up Pgrx
run: |
# pg_config
mkdir -p ~/.pg_config
touch ~/.pg_config/pg_config
chmod 777 ~/.pg_config/pg_config
echo "#!/usr/bin/env bash" >> ~/.pg_config/pg_config
echo "$(pwd)/tools/pg_config.sh \"\$@\" < $(pwd)/vendor/pg_config/pg${VERSION}_${ARCH}-unknown-linux-gnu.txt" >> ~/.pg_config/pg_config
mkdir -p ~/.pgrx && echo "configs.pg$VERSION=\"$HOME/.pg_config/pg_config\"" > ~/.pgrx/config.toml
# pgrx_binding
mkdir -p ~/.pgrx_binding
cp ./vendor/pgrx_binding/pg${VERSION}_$(uname --machine)-unknown-linux-gnu.rs ~/.pgrx_binding/pg${VERSION}_raw_bindings.rs
echo PGRX_TARGET_INFO_PATH_PG$VERSION=$HOME/.pgrx_binding >> "$GITHUB_ENV"
- name: Build
run: |
cargo build --lib --features pg$VERSION --release --target $ARCH-unknown-linux-gnu
./tools/schema.sh --features pg$VERSION --release --target $ARCH-unknown-linux-gnu | expand -t 4 > ./target/vectors--$SEMVER.sql
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg${VERSION}_${ARCH}_debian/pg_config/pg_config
export PGRX_TARGET_INFO_PATH_PG$VERSION=$(pwd)/vendor/pg${VERSION}_${ARCH}_debian/pgrx_binding
cargo build --package pgvectors --lib --features pg$VERSION --target $ARCH-unknown-linux-gnu --release
./tools/schema.sh --features pg$VERSION --target $ARCH-unknown-linux-gnu --release | expand -t 4 > ./target/schema.sql
- name: Package
run: |
export PLATFORM=$(echo $ARCH | sed 's/aarch64/arm64/; s/x86_64/amd64/')
@@ -119,7 +106,7 @@ jobs:
needs: ["binary", "semver"]
strategy:
matrix:
version: [14, 15, 16]
version: [14, 15, 16, 17]
platform: ["amd64", "arm64"]
runs-on: ubuntu-latest
steps:
@@ -152,7 +139,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [14, 15, 16]
version: [14, 15, 16, 17]
rootless: [true, false]
steps:
- name: Checkout
194 changes: 194 additions & 0 deletions .github/workflows/release_enterprise.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
name: Release for Enterprise

on:
workflow_dispatch:
inputs:
version:
type: string
description: Version
required: true
tag:
type: string
description: Tag
required: true

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
RUSTFLAGS: "-Dwarnings"

permissions:
contents: write
pull-requests: read

jobs:
semver:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const r = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
if (!r.test("${{ github.event.inputs.version }}")) {
core.setFailed(`Action failed with an invalid semver.`);
}
binary:
strategy:
matrix:
version: [14, 15, 16]
arch: ["x86_64"]
schema: ["vectors", "extensions", "public"]
runs-on: ubuntu-22.04
env:
SEMVER: ${{ github.event.inputs.version }}
VERSION: ${{ matrix.version }}
ARCH: ${{ matrix.arch }}
PGVECTORS_SCHEMA: ${{ matrix.schema }}
needs: ["semver"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Environment
run: |
sudo apt-get remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
sudo apt-get purge -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
sudo apt-get update
sudo apt-get install -y build-essential crossbuild-essential-arm64
sudo apt-get install -y qemu-user-static
touch ~/.cargo/config.toml
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
echo 'target.aarch64-unknown-linux-gnu.runner = ["qemu-aarch64-static", "-L", "/usr/aarch64-linux-gnu"]' >> ~/.cargo/config.toml
rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
- name: Set up Sccache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Set up Cache
uses: actions/cache/restore@v4
id: cache
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.version }}-${{ matrix.arch }}
- name: Schema
run: |
echo -n $PGVECTORS_SCHEMA > .schema
sed -i "/schema/ c\schema = $PGVECTORS_SCHEMA" ./vectors.control
- name: Build
run: |
export PGRX_PG_CONFIG_PATH=$(pwd)/vendor/pg${VERSION}_${ARCH}_debian/pg_config/pg_config
export PGRX_TARGET_INFO_PATH_PG$VERSION=$(pwd)/vendor/pg${VERSION}_${ARCH}_debian/pgrx_binding
cargo build --package pgvectors --lib --features pg$VERSION --target $ARCH-unknown-linux-gnu --release
./tools/schema.sh --features pg$VERSION --target $ARCH-unknown-linux-gnu --release | expand -t 4 > ./target/schema.sql
- name: Package
run: |
export PLATFORM=$(echo $ARCH | sed 's/aarch64/arm64/; s/x86_64/amd64/')
./scripts/package.sh
- name: Upload
env:
GH_TOKEN: ${{ github.token }}
run: |
export TAG=${{ github.event.inputs.tag }}
export PLATFORM=$(echo $ARCH | sed 's/aarch64/arm64/; s/x86_64/amd64/')
export FILE_NAME=vectors-pg${VERSION}_${SEMVER}_${PLATFORM}.deb
export FINAL_NAME=vectors-pg${VERSION}_${SEMVER}_${PLATFORM}_${PGVECTORS_SCHEMA}.deb
mv ./build/${FILE_NAME} ./build/${FINAL_NAME}
gh release upload --clobber $TAG ./build/${FINAL_NAME}
- name: Post Set up Cache
uses: actions/cache/save@v4
if: ${{ !steps.cache.outputs.cache-hit }}
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.job }}-${{ hashFiles('./Cargo.lock') }}-${{ matrix.version }}-${{ matrix.arch }}
docker_binary_release:
needs: ["binary", "semver"]
strategy:
matrix:
version: [14, 15, 16]
platform: ["amd64"]
schema: ["vectors", "extensions", "public"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download ${{ github.event.inputs.tag }} --pattern "vectors-pg${{ matrix.version }}_${{ github.event.inputs.version }}_${{ matrix.platform }}_${{ matrix.schema }}.deb" --output pgvecto-rs-binary-release.deb
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERIO_MODELZ_USERNAME }}
password: ${{ secrets.DOCKERIO_MODELZ_TOKEN }}
- name: Push binary release to Docker Registry
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: "linux/${{ matrix.platform }}"
file: ./docker/binary_release.Dockerfile
tags: modelzai/pgvecto-rs-binary:pg${{ matrix.version }}-v${{ github.event.inputs.version }}-${{ matrix.platform }}-${{ matrix.schema }}
docker_release:
needs: ["docker_binary_release", "semver"]
runs-on: ubuntu-latest
strategy:
matrix:
version: [14, 15, 16] # https://github.com/tembo-io/trunk/issues/797, 17 not support yet
schema: ["vectors", "extensions", "public"]
platform: ["amd64"] # Only support x86-64 architecture, aarch64 not support yet
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Variables
id: variables
uses: actions/github-script@v7
with:
script: |
core.setOutput('tags', "modelzai/pgvecto-rs:${{ matrix.version }}-v${{ github.event.inputs.version }}-${{ matrix.schema }}-exts");
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERIO_MODELZ_USERNAME }}
password: ${{ secrets.DOCKERIO_MODELZ_TOKEN }}
- name: Set Lib Dir
run: |
if [ "${{ matrix.platform }}" == "amd64" ]; then
echo "LIB_DIR=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
elif [ "${{ matrix.platform }}" == "arm64" ]; then
echo "LIB_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
else
echo "LIB_DIR=/usr/lib/unknown" >> $GITHUB_ENV
fi
- name: Push postgres with pgvecto.rs enterprise to Docker Registry
uses: docker/build-push-action@v4
with:
context: ./docker/pg-cnpg
push: true
platforms: "linux/${{ matrix.platform }}"
file: ./docker/pg-cnpg/Dockerfile
build-args: |
PG_MAJOR=${{ matrix.version }}
FROM_TAG=pg${{ matrix.version }}-v${{ github.event.inputs.version }}
SCHEMA=${{ matrix.schema }}
TARGETARCH=${{ matrix.platform }}
LIB_DIR=${{ env.LIB_DIR }}
tags: ${{ steps.variables.outputs.tags }}
6 changes: 3 additions & 3 deletions .github/workflows/release_officially.yml
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@ on:
- created
- edited

permissions:
actions: write

jobs:
trigger:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Checkout
uses: actions/checkout@v4
Loading