Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Release RC
name: Create RC Release PR

on:
workflow_dispatch:
Expand Down Expand Up @@ -32,12 +32,6 @@ jobs:
git config --global user.name "wren-ai[bot]"
git config --global user.email "dev@cannerdata.com"

- name: Create branch
run: |
BRANCH_NAME="release/${{ github.event.inputs.release_version }}"
git checkout -b $BRANCH_NAME
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV

- name: Update docker.go
run: |
FILE_PATH="wren-launcher/utils/docker.go"
Expand Down Expand Up @@ -70,51 +64,12 @@ jobs:
echo "===== Git diff for changed files ====="
git diff

- name: Commit changes
run: |
git add wren-launcher/utils/docker.go docker/.env.example
git commit -m "release ${{ github.event.inputs.release_version }}" || echo "No changes to commit"
git status

- name: Push branch
run: |
git push --set-upstream origin ${{ env.BRANCH_NAME }}
echo "Branch pushed to origin/${{ env.BRANCH_NAME }}"

- name: Install GitHub CLI
run: |
type -p curl >/dev/null || (apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y

- name: Create Pull Request with GitHub CLI
run: |
# Check if branch has changes compared to main
if git diff --quiet origin/main origin/${{ env.BRANCH_NAME }}; then
echo "No changes detected between main and ${{ env.BRANCH_NAME }}. Cannot create PR."
exit 1
fi

# Create PR using gh cli
gh pr create \
--title "Release ${{ github.event.inputs.release_version }}" \
--body "Release ${{ github.event.inputs.release_version }}" \
--base main \
--head ${{ env.BRANCH_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fallback PR creation
if: failure()
uses: peter-evans/create-pull-request@v5
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "release ${{ github.event.inputs.release_version }}"
branch: ${{ env.BRANCH_NAME }}
base: main
branch: "release/${{ github.event.inputs.release_version }}"
commit-message: "release ${{ github.event.inputs.release_version }}"
title: "Release ${{ github.event.inputs.release_version }}"
body: "Release ${{ github.event.inputs.release_version }}"
draft: false
81 changes: 81 additions & 0 deletions .github/workflows/create-rc-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Create RC Release

on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
required: true
issue_comment:
types: [created]

jobs:
release:
runs-on: macos-latest
if: ${{ github.event_name == 'issue_comment' && contains(github.event.comment.body, '/release-rc') && startsWith(github.event.issue.title, 'Release') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23.0"

- name: Add rocket emoji to comment
run: |
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"body": "🚀 Starting the release process!"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments"

- name: Parse release version from PR title
id: parse_release_version
env:
GITHUB_ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
release_version=$(echo "$GITHUB_ISSUE_TITLE" | sed 's/ /\n/g' | tail -n 1)
echo "Release version: $release_version"
echo "release_version=$release_version" >> $GITHUB_OUTPUT

- name: Build for macOS
working-directory: ./wren-launcher
run: |
mkdir -p dist
env GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 go build -o dist/wren-launcher-darwin main.go
cd dist && chmod +x wren-launcher-darwin && tar zcvf wren-launcher-darwin.tar.gz wren-launcher-darwin

- name: Build for Linux
working-directory: ./wren-launcher
run: |
mkdir -p dist
env GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o dist/wren-launcher-linux main.go
cd dist && chmod +x wren-launcher-linux && tar zcvf wren-launcher-linux.tar.gz wren-launcher-linux

- name: Build for Windows
working-directory: ./wren-launcher
run: |
mkdir -p dist
env GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o dist/wren-launcher-windows.exe main.go
cd dist && zip wren-launcher-windows.zip wren-launcher-windows.exe

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
./wren-launcher/dist/wren-launcher-darwin.tar.gz
./wren-launcher/dist/wren-launcher-linux.tar.gz
./wren-launcher/dist/wren-launcher-windows.zip
tag_name: ${{ steps.parse_release_version.outputs.release_version }}
prerelease: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment with release link
run: |
release_url="https://github.com/${{ github.repository }}/releases/tag/${{ steps.parse_release_version.outputs.release_version }}"
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d "{\"body\": \"🚀 A new release has been created! [View Release](${release_url})\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments"
3 changes: 2 additions & 1 deletion .github/workflows/ui-release-image-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
# tag with input version and latest
run: |
TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}')
TAGS=$(echo "${{ steps.meta.outputs.tags }} --tag latest" | awk '{printf "--tag %s ", $0}')
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.WREN_UI_IMAGE }}@sha256:%s ' *) \
$TAGS
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ wren-ai-service/tools/dev/etc/**
.deepeval-cache.json
.deepeval_telemtry.txt
docker/config.yaml
docker/docker-compose-local.yaml

# python
.python-version
Expand Down
6 changes: 3 additions & 3 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ OPENAI_API_KEY=

# version
# CHANGE THIS TO THE LATEST VERSION
WREN_PRODUCT_VERSION=0.18.0-rc.1
WREN_PRODUCT_VERSION=0.18.0
WREN_ENGINE_VERSION=0.14.8
WREN_AI_SERVICE_VERSION=0.18.0
WREN_AI_SERVICE_VERSION=0.18.2
IBIS_SERVER_VERSION=0.14.8
WREN_UI_VERSION=0.23.2
WREN_UI_VERSION=0.23.4
WREN_BOOTSTRAP_VERSION=0.1.5

# user id (uuid v4)
Expand Down
2 changes: 1 addition & 1 deletion wren-ai-service/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wren-ai-service"
version = "0.18.0"
version = "0.18.2"
description = ""
authors = ["dev@getwren.ai"]
license = "AGPL-3.0"
Expand Down
8 changes: 5 additions & 3 deletions wren-ai-service/src/pipelines/indexing/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def run(self, instructions: list[Instruction], project_id: Optional[str] = ""):
"is_default": instruction.is_default,
**addition,
},
content=instruction.question,
content="this is a global instruction, so no question is provided"
if instruction.is_default
else instruction.question,
)
for instruction in instructions
]
Expand Down Expand Up @@ -164,12 +166,12 @@ async def run(
@observe(name="Clean Documents for Instructions")
async def clean(
self,
instructions: List[Instruction],
instructions: Optional[List[Instruction]] = None,
project_id: Optional[str] = None,
delete_all: bool = False,
) -> None:
await clean(
instructions=instructions,
instructions=instructions or [],
cleaner=self._components["cleaner"],
project_id=project_id,
delete_all=delete_all,
Expand Down
31 changes: 21 additions & 10 deletions wren-ai-service/src/web/v1/services/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,27 @@ async def index(
trace_id = kwargs.get("trace_id")

try:
instructions = [
Instruction(
id=instruction.id,
instruction=instruction.instruction,
question=question,
is_default=instruction.is_default,
)
for instruction in request.instructions
for question in instruction.questions
]
instructions = []
for instruction in request.instructions:
if instruction.is_default:
instructions.append(
Instruction(
id=instruction.id,
instruction=instruction.instruction,
question="",
is_default=True,
)
)
else:
for question in instruction.questions:
instructions.append(
Instruction(
id=instruction.id,
instruction=instruction.instruction,
question=question,
is_default=False,
)
)

await self._pipelines["instructions_indexing"].run(
project_id=request.project_id,
Expand Down
4 changes: 2 additions & 2 deletions wren-launcher/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ BINARY_NAME=wren-launcher

build:
env GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 go build -o dist/${BINARY_NAME}-darwin main.go
env GOARCH=amd64 GOOS=linux go build -o dist/${BINARY_NAME}-linux main.go
env GOARCH=amd64 GOOS=windows go build -o dist/${BINARY_NAME}-windows.exe main.go
env GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o dist/${BINARY_NAME}-linux main.go
env GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o dist/${BINARY_NAME}-windows.exe main.go
cd ./dist; chmod +x ${BINARY_NAME}-darwin && chmod +x ${BINARY_NAME}-linux \
&& tar zcvf ${BINARY_NAME}-darwin.tar.gz ${BINARY_NAME}-darwin \
&& tar zcvf ${BINARY_NAME}-linux.tar.gz ${BINARY_NAME}-linux \
Expand Down
2 changes: 1 addition & 1 deletion wren-launcher/utils/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const (
// please change the version when the version is updated
WREN_PRODUCT_VERSION string = "0.18.0-rc.1"
WREN_PRODUCT_VERSION string = "0.18.0"
DOCKER_COMPOSE_YAML_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/docker-compose.yaml"
DOCKER_COMPOSE_ENV_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/.env.example"
AI_SERVICE_CONFIG_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/config.example.yaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.alterTable('thread_response', (table) => {
table
.jsonb('adjustment')
.nullable()
.comment(
'Adjustment data for thread response, including type and payload',
);
});
};

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.alterTable('thread_response', (table) => {
table.dropColumn('adjustment');
});
};
2 changes: 1 addition & 1 deletion wren-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wren-ui",
"version": "0.23.2",
"version": "0.23.3",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
Loading