Skip to content

Commit

Permalink
Update README (#38)
Browse files Browse the repository at this point in the history
## Problem

Lacking detail in README and did not have a CONTRIBUTING file

## Solution

This PR updates the README and adds a CONTRIBUTING file. Also updates
some metadata in Cargo.toml

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Infrastructure change (CI configs, etc)
- [x] Non-code change (docs, etc)
- [ ] None of the above: (explain here)

## Test Plan

Does not change functional code, all existing test cases pass.

---------

Co-authored-by: Erica Wang <erica.py.wang@gmail.com>
  • Loading branch information
emily-emily and ericapywang authored Aug 1, 2024
1 parent e511603 commit 7169a9f
Show file tree
Hide file tree
Showing 8 changed files with 593 additions and 103 deletions.
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing guide

## Local development

### Prerequisites

- Install [homebrew](https://brew.sh/) if you haven't already
- Install `brew install just`. just is a command line tool used to run commands defined inside the project `justfile`. You run commands by passing the command name, for example `just build-openapi`.

### Clone the repository

This repository relies on a git submodule to get access to our openapi spec. To clone the repository, use the command:

```
git clone --recurse-submodules git@github.com:pinecone-io/pinecone-rust-client.git
```

Or, if you have already cloned the repository, you can update the submodules with

```
git submodule update --init --recursive
```

### Generating code from OpenAPI and Proto specs

The generated code is already checked into the repository and normally should not need to be modified.

To regenerate OpenAPI or Protobuf code, you will require access to the private `apis` repository.
- Follow setup instructions for the `apis` repository: [apis setup](https://github.com/pinecone-io/apis)

OpenAPI

- You need [Docker Desktop](https://www.docker.com/products/docker-desktop/) in order to generate code using openapi. Look at `codegen/build-oas.sh` to see how this is used.
- Make sure Docker is running.
- `just build-openapi`
- References the spec files from the `codegen/apis` submodule
- Outputs the generated code to `src/openapi`

Protobuf
- `brew install protobuf`
- `cargo install protobuf-codegen` and add it to path: `PATH="$HOME/.cargo/bin:$PATH"`
- `just build-proto`
- References the spec files from the `codegen/apis` submodule
- Outputs the generated code to `src/protos`

Alternatively, you can run `just build-client` to regenerate both OpenAPI and Protobuf code.

What the build process looks like in all cases:
- Build the `apis` submodule to produce consolidated .yaml files in `codegen/apis/_build`
- Create a `version.rs` file containing API version info based on the defined value in the justfile
- Run build scripts for OpenAPI and/or Protobuf, propagating the API version

### Build and run

Build and run the project:
- `cargo build` builds the project
- `cargo test` builds the project and runs tests
72 changes: 72 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 16 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
name = "pinecone-sdk"
version = "0.1.0"
edition = "2021"
description = "Pinecone Rust SDK"
repository = "https://github.com/pinecone-io/pinecone-rust-client"
rust-version = "1.78.0"
readme = "./README.md"
license = "Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "1", features = ["full"] }
regex = "1.10.4"
serde_json = "1.0.117"
snafu = "0.8.3"
rand = "0.8.5"
tonic = { version = "0.11.0", features = ["tls", "transport", "tls-roots"] }
prost = "0.12.6"
prost-types = "0.12.6"
# reqwest = "0.12.5"
once_cell = "1.19.0"
regex = "1.10"
serde_json = "1.0"
snafu = "0.8"
rand = "0.8"
tonic = { version = "0.11", features = ["tls", "transport", "tls-roots"] }
prost = "0.12"
prost-types = "0.12"
# reqwest = "0.12"
once_cell = "1.19"

# openapi
serde = { version = "^1.0", features = ["derive"] }
Expand All @@ -26,8 +30,9 @@ uuid = { version = "^1.8", features = ["serde", "v4"] }
reqwest = { version = "^0.12", features = ["json", "multipart"] }

[dev-dependencies]
temp-env = "0.3.6"
temp-env = "0.3"
httpmock = "0.7.0-rc.1"
serial_test = "3.1"

[build-dependencies]
tonic-build = "0.11.0"
tonic-build = "0.11"
Loading

0 comments on commit 7169a9f

Please sign in to comment.