Skip to content

Commit 487413e

Browse files
authored
Set Versions and Update Readme (#142)
* preparing version files for ahnlich launch * rust and python clients now deploy to crates.io and pypi * change rust toolchain in workflow * final preparations for launch
1 parent e844425 commit 487413e

File tree

14 files changed

+76
-24
lines changed

14 files changed

+76
-24
lines changed

.github/workflows/python_tag_and_deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ jobs:
8181
working-directory: ./sdk/ahnlich-client-py
8282
run: |
8383
echo "Deploying tag ${{needs.check_version_changes_and_tag.outputs.client_version}}"
84-
poetry config repositories.test-pypi https://test.pypi.org/legacy/
8584
poetry run change_poetry_version
86-
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }}
87-
poetry build && poetry publish -r test-pypi
85+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
86+
poetry publish --build
8887
8988

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Get Cargo toolchain
3434
uses: actions-rs/toolchain@v1
3535
with:
36-
toolchain: 1.78.0
36+
toolchain: 1.81.0
3737

3838
- name: Setup Zig
3939
uses: mlugg/setup-zig@v1

.github/workflows/rust_tag_and_deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ jobs:
6666
- name: Get Cargo toolchain
6767
uses: actions-rs/toolchain@v1
6868
with:
69-
toolchain: 1.78.0
69+
toolchain: 1.81.0
7070

7171
- name: Deploy using tag
7272
working-directory: ./ahnlich
7373
run: |
74-
cargo publish -p ahnlich_types --dry-run --token '${{secrets.CARGO_TOKEN}}'
75-
cargo publish -p ahnlich_client_rs --dry-run --token '${{secrets.CARGO_TOKEN}}'
74+
cargo publish -p ahnlich_types --token '${{secrets.CARGO_TOKEN}}'
75+
cargo publish -p ahnlich_client_rs --token '${{secrets.CARGO_TOKEN}}'

README.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,58 @@ The DB can be used without the AI proxy for more fine grained control of the gen
6262

6363
View [contribution guide](CONTRIBUTING.md)
6464

65-
### How Client Releases Work
65+
### Version Format
6666

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

69+
Where:
70+
- TYPE: Bin, Client,
71+
- NAME: AI, DB, PY, RS
72+
- VERSION_NUMBER: Semver
73+
74+
75+
### How Deployments and Releases Work
76+
77+
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.
78+
79+
#### Protocol and Client Versioning
80+
- 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.
81+
- The **Client Version** tracks updates to the client libraries. These are versioned separately but are often synchronized with protocol updates to ensure compatibility.
82+
83+
##### Bumping Protocol Versions
84+
- To bump both the Protocol and Client versions simultaneously, use the following command:
85+
```bash
86+
make bump-protocol-version BUMP_RULE=[major, minor, patch]
87+
```
88+
This will trigger deployments for all relevant binaries (like AI, CLI, and DB) as well as client libraries.
89+
- 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.
90+
91+
##### Bumping Individual Package/Crate Versions
92+
- The Makefile contains additional commands for selectively bumping versions of crate or lib within the workspace.
93+
94+
#### Releasing New Binaries (AI, CLI, DB), Images and Client Libs
95+
When deploying new binaries, the updated versions are pushed to their respective Artifactory repositories. The workflow is as follows:
96+
97+
##### Binaries and Docker Images
98+
1. **Bump the Protocol Version**: Use the appropriate Makefile commands to bump versions for AI, CLI, or DB binaries or client Libs.
99+
100+
2. Submit a PR to main
101+
3. Once merged, Create a tag using the the ahnlich tag format
102+
4. Create a Release from tag which triggers building of binaries and docker images
103+
104+
##### Client Libraries (Example Python)
105+
106+
- Update the `MSG_TAG` file with a new tag message.
107+
- From a feature branch, bump the version using:
108+
```bash
109+
make bump-py-client BUMP_RULE=[major, minor, patch]
110+
```
111+
or
112+
```bash
113+
poetry run bumpversion [major, minor, patch]
114+
```
115+
- Open a PR to Main
116+
- Once merged, this automatically creates a tags if a change to the version file is detected and deploys the lib to it's artifactory.
70117

71118

72119

ahnlich/Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ahnlich/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ bump-protocol-version: ## Bump project versions. Rules for bumpversion: patch, m
6767
@cd $(RUST_PROJECT_DIR) && cargo set-version --bump $(BUMP_RULE) --package $(AHNLICH_AI_NAME)
6868
@echo "Ahnlich AI version bumped to $(BUMP_RULE)"
6969

70+
@echo "Bumping Rust client version with rule $(BUMP_RULE)"
71+
@cd $(RUST_PROJECT_DIR) && cargo set-version --bump $(BUMP_RULE) --package $(RUST_CLIENT_NAME)
72+
@echo "Rust client version bumped to $(BUMP_RULE)"
73+
7074
@echo "Bumping Python project version with rule $(BUMP_RULE)"
7175
@cd $(PYTHON_PROJECT_DIR) && poetry run bumpversion --component Protocol --bump-type $(BUMP_RULE)
7276
@echo "Python project version bumped using rule $(BUMP_RULE)"

ahnlich/ai/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ai"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
# only used for rust client test and not to be released

ahnlich/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cli"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
[[bin]]

ahnlich/client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ahnlich_client_rs"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
authors = ["Diretnan Domnan <[email protected]>"]
55
categories = ["database-implementations", "database", "web-programming"]
66
keywords = ["ahnlich", "in-memory", "artificial-intelligence", "ai"]

ahnlich/client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ cargo add ahnlich_client_rs
2424

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

2929

0 commit comments

Comments
 (0)