Skip to content

Commit

Permalink
Fix annoying pipeline 7 (#160)
Browse files Browse the repository at this point in the history
* Take 7 on attempting lib deploys

* Structuring readme and returning types deploy
  • Loading branch information
deven96 authored Dec 2, 2024
1 parent 2c1a416 commit 0e2e7c6
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust_tag_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Deploy using tag
working-directory: ./ahnlich
run: |
# cargo publish -p ahnlich_types --token '${{secrets.CARGO_TOKEN}}'
cargo publish -p ahnlich_types --token '${{secrets.CARGO_TOKEN}}'
# Removing dev dependencies as those use * and are only locally available
sed -i '/^\[dev-dependencies\]/,/^\[/{//!d; /^\[dev-dependencies\]/s/.*/ /}' client/Cargo.toml
cargo publish --allow-dirty -p ahnlich_client_rs --token '${{secrets.CARGO_TOKEN}}'
57 changes: 0 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,60 +61,3 @@ The DB can be used without the AI proxy for more fine grained control of the gen
### Contributing

View [contribution guide](CONTRIBUTING.md)

### Version Format

`<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.




29 changes: 29 additions & 0 deletions ahnlich/types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Ahnlich Types

Types used by the ahnlich rust client


[![Crates.io](https://img.shields.io/crates/v/ahnlich_types.svg)](https://crates.io/crates/ahnlich_types)
[![Documentation](https://docs.rs/ahnlich_types/badge.svg)](https://docs.rs/ahnlich_types/)
[![Ahnlich TestSuite](https://github.com/deven96/ahnlich/actions/workflows/test.yml/badge.svg)](https://github.com/deven96/ahnlich/actions/workflows/test.yml)
[![Ahnlich Types Tag and Deploy](https://github.com/deven96/ahnlich/actions/workflows/rust_tag_and_deploy.yml/badge.svg)](https://github.com/deven96/ahnlich/actions/workflows/rust_tag_and_deploy.yml)

## Usage Overview

The following topics are covered:
* [Installation](#installation)
* [Change Log](#change-log)

## Installation

```bash
cargo add ahnlich_types
```

## Change Log

| Version| Description |
| -------|:-------------:|
| 0.0.0 | Adding types for version 0.0.0 |


53 changes: 53 additions & 0 deletions docs/libgen.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,56 @@ Available languages are:
In order to communicate effectively with the ahnlich db, you would have to extend the bincode serialization protocol automatically provided by `serde_generate`.
Your message(in bytes) should be serialized and deserialized in the following format => `AHNLICH_HEADERS` + `VERSION` + `QUERY/SERVER_RESPONSE`. Bytes are `Little Endian`.

### Version Format

`<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.

0 comments on commit 0e2e7c6

Please sign in to comment.