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

Set Versions and Update Readme #142

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/python_tag_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ jobs:
working-directory: ./sdk/ahnlich-client-py
run: |
echo "Deploying tag ${{needs.check_version_changes_and_tag.outputs.client_version}}"
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry run change_poetry_version
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }}
poetry build && poetry publish -r test-pypi
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build


2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Get Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.78.0
toolchain: 1.81.0

- name: Setup Zig
uses: mlugg/setup-zig@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust_tag_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
- name: Get Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.78.0
toolchain: 1.81.0

- name: Deploy using tag
working-directory: ./ahnlich
run: |
cargo publish -p ahnlich_types --dry-run --token '${{secrets.CARGO_TOKEN}}'
cargo publish -p ahnlich_client_rs --dry-run --token '${{secrets.CARGO_TOKEN}}'
cargo publish -p ahnlich_types --token '${{secrets.CARGO_TOKEN}}'
cargo publish -p ahnlich_client_rs --token '${{secrets.CARGO_TOKEN}}'
53 changes: 50 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,58 @@ The DB can be used without the AI proxy for more fine grained control of the gen

View [contribution guide](CONTRIBUTING.md)

### How Client Releases Work
### Version Format

The clients follow a similar process when deploying new releases.
[Example with python client](https://github.com/deven96/ahnlich/blob/main/sdk/ahnlich-client-py/README.md#deploy-to-artifactory).
`<TYPE>/<NAME>/<VERSION_NUMBER>`

Where:
- TYPE: Bin, Client,
- NAME: AI, DB, PY, RS
- VERSION_NUMBER: Semver


### How Deployments and Releases Work

Ahnlich maintains two separate versioning systems: **Protocol Versions** and **Client Versions**. Understanding how these interact is key to managing releases across binaries, libraries, and Docker images.

#### Protocol and Client Versioning
- The **Protocol Version** represents changes to the underlying communication standard between different Ahnlich components. Major bump to this version can introduce breaking changes, meaning requests made by outdated clients will be rejected.
- The **Client Version** tracks updates to the client libraries. These are versioned separately but are often synchronized with protocol updates to ensure compatibility.

##### Bumping Protocol Versions
- To bump both the Protocol and Client versions simultaneously, use the following command:
```bash
make bump-protocol-version BUMP_RULE=[major, minor, patch]
```
This will trigger deployments for all relevant binaries (like AI, CLI, and DB) as well as client libraries.
- Major changes to the Protocol Version may involve breaking changes, so ahnlich AI or DB rejects a connection when the major version don't match.

##### Bumping Individual Package/Crate Versions
- The Makefile contains additional commands for selectively bumping versions of crate or lib within the workspace.

#### Releasing New Binaries (AI, CLI, DB), Images and Client Libs
When deploying new binaries, the updated versions are pushed to their respective Artifactory repositories. The workflow is as follows:

##### Binaries and Docker Images
1. **Bump the Protocol Version**: Use the appropriate Makefile commands to bump versions for AI, CLI, or DB binaries or client Libs.

2. Submit a PR to main
3. Once merged, Create a tag using the the ahnlich tag format
4. Create a Release from tag which triggers building of binaries and docker images

##### Client Libraries (Example Python)

- Update the `MSG_TAG` file with a new tag message.
- From a feature branch, bump the version using:
```bash
make bump-py-client BUMP_RULE=[major, minor, patch]
```
or
```bash
poetry run bumpversion [major, minor, patch]
```
- Open a PR to Main
- Once merged, this automatically creates a tags if a change to the version file is detected and deploys the lib to it's artifactory.



Expand Down
10 changes: 5 additions & 5 deletions ahnlich/Cargo.lock

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

4 changes: 4 additions & 0 deletions ahnlich/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ bump-protocol-version: ## Bump project versions. Rules for bumpversion: patch, m
@cd $(RUST_PROJECT_DIR) && cargo set-version --bump $(BUMP_RULE) --package $(AHNLICH_AI_NAME)
@echo "Ahnlich AI version bumped to $(BUMP_RULE)"

@echo "Bumping Rust client version with rule $(BUMP_RULE)"
@cd $(RUST_PROJECT_DIR) && cargo set-version --bump $(BUMP_RULE) --package $(RUST_CLIENT_NAME)
@echo "Rust client version bumped to $(BUMP_RULE)"

@echo "Bumping Python project version with rule $(BUMP_RULE)"
@cd $(PYTHON_PROJECT_DIR) && poetry run bumpversion --component Protocol --bump-type $(BUMP_RULE)
@echo "Python project version bumped using rule $(BUMP_RULE)"
Expand Down
2 changes: 1 addition & 1 deletion ahnlich/ai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ai"
version = "0.1.0"
version = "0.0.0"
edition = "2021"

# only used for rust client test and not to be released
Expand Down
2 changes: 1 addition & 1 deletion ahnlich/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cli"
version = "0.1.0"
version = "0.0.0"
edition = "2021"

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion ahnlich/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ahnlich_client_rs"
version = "0.1.0"
version = "0.0.0"
authors = ["Diretnan Domnan <[email protected]>"]
categories = ["database-implementations", "database", "web-programming"]
keywords = ["ahnlich", "in-memory", "artificial-intelligence", "ai"]
Expand Down
2 changes: 1 addition & 1 deletion ahnlich/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ cargo add ahnlich_client_rs

| Version| Description |
| -------|:-------------:|
| 0.1.0 | Base Rust client to connect to ahnlich db. Bincode serialization and deserialization implemented |
| 0.0.0 | Base Rust client to connect to ahnlich db. Bincode serialization and deserialization implemented |


2 changes: 1 addition & 1 deletion ahnlich/db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "db"
version = "0.1.0"
version = "0.0.0"
edition = "2021"

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion ahnlich/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ahnlich_types"
version = "0.1.0"
version = "0.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 3 additions & 1 deletion sdk/ahnlich-client-py/MSG_TAG
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Add AI Client for AI Proxy
Heimdall, open the bifrost.
A Python client that interacts with both ahnlich DB and AI. Bincode serialization and deserialization implemented

4 changes: 2 additions & 2 deletions sdk/ahnlich-client-py/VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CLIENT="0.3.0"
PROTOCOL="0.1.0"
CLIENT="0.0.0"
PROTOCOL="0.0.0"
Loading