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

Merge changes for v0.2 release #15

Merged
merged 6 commits into from
Jul 23, 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
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ DOCIO_URL=http://docio:6979/api/docio
UNSTRUCTUREDIO_URL=http://unstructuredio:6989

# Configuration
SERVICE_KEY=
OWL_PORT=6969
OWL_WORKERS=1
OWL_DB_DIR=db
Expand Down
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ extend-exclude =
build/,
configs/,
dependencies/,
venv/
venv/,
**/dist
**/build
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# https://git-scm.com/docs/gitattributes#Documentation/gitattributes.txt-Settostringvalueauto
* text=auto eol=lf

# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf

# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf


# These files are text and should be normalized (Convert crlf => lf)
# Setting the `text` attribute on a path enables end-of-line normalization and marks the path as a text file.
# End-of-line conversion takes place without guessing the content type.
Expand Down
177 changes: 177 additions & 0 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: CI-Win

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*"

jobs:
pyinstaller_api:
name: PyInstaller API Service Compilation
runs-on: windows-11-desktop
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Inspect Python version
run: python --version

- name: Install Git
run: |
$installer_url = "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe"
Invoke-WebRequest -Uri $installer_url -OutFile "GitInstaller.exe"
Start-Process -FilePath "GitInstaller.exe" -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait
Remove-Item "GitInstaller.exe"

# Add Git to PATH
$gitPath = "C:\Program Files\Git\cmd"
$env:PATH = "$gitPath;$env:PATH"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Machine)

# Output the new PATH to a step output
echo "PATH=$env:PATH" >> $env:GITHUB_ENV

# Verify Git installation
git --version
shell: powershell

- name: Verify Git in PATH
run: |
Write-Host "Current PATH: $env:PATH"
$gitPath = (Get-Command git -ErrorAction SilentlyContinue).Path
if ($gitPath) {
Write-Host "Git found at: $gitPath"
} else {
Write-Host "Git not found in PATH"
exit 1
}
shell: powershell

- name: Inspect git version
run: |
git --version

- name: Remove cloud-only modules and start compiling API service
run: |
$ErrorActionPreference = "Stop"
.\scripts\compile_api_exe.ps1
shell: powershell

- name: Validate api.exe is healthy
run: |
$env:OWL_WORKERS=1
$process = Start-Process -NoNewWindow -FilePath ".\services\api\dist\api\api.exe" -PassThru
Start-Sleep -Seconds 10
Write-Output "API process ID: $($process.Id)"
Get-Process
Test-NetConnection -ComputerName localhost -Port 6969
$response = Invoke-WebRequest -Uri http://localhost:6969/api/health -UseBasicParsing
if ($response.StatusCode -eq 200) {
Write-Output "API is healthy"
} else {
throw "API is not healthy"
}
$processId = (Get-Process -Name api -ErrorAction SilentlyContinue).Id
if ($null -ne $processId) {
Stop-Process -Id $processId -Force
} else {
Write-Output "API process not found."
}
shell: powershell

pyinstaller_docio:
name: PyInstaller DocIO Service Compilation
runs-on: windows-11-desktop
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python --version

- name: Install Microsoft Visual C++ Redistributable
run: |
Invoke-WebRequest -Uri "https://aka.ms/vs/16/release/vc_redist.x64.exe" -OutFile "vc_redist.x64.exe"
Start-Process -FilePath "./vc_redist.x64.exe" -ArgumentList "/quiet", "/install" -NoNewWindow -Wait

- name: Install Git
run: |
$installer_url = "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe"
Invoke-WebRequest -Uri $installer_url -OutFile "GitInstaller.exe"
Start-Process -FilePath "GitInstaller.exe" -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait
Remove-Item "GitInstaller.exe"

# Add Git to PATH
$gitPath = "C:\Program Files\Git\cmd"
$env:PATH = "$gitPath;$env:PATH"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::Machine)

# Output the new PATH to a step output
echo "PATH=$env:PATH" >> $env:GITHUB_ENV

# Verify Git installation
git --version
shell: powershell

- name: Verify Git in PATH
run: |
Write-Host "Current PATH: $env:PATH"
$gitPath = (Get-Command git -ErrorAction SilentlyContinue).Path
if ($gitPath) {
Write-Host "Git found at: $gitPath"
} else {
Write-Host "Git not found in PATH"
exit 1
}
shell: powershell

- name: Remove cloud-only modules and start compiling DocIO service
run: |
$ErrorActionPreference = "Stop"
.\scripts\compile_docio_exe.ps1
shell: powershell

- name: Validate docio.exe is healthy
run: |
$env:DOCIO_WORKERS=1
$process = Start-Process -NoNewWindow -FilePath ".\services\docio\dist\docio\docio.exe" -PassThru
Start-Sleep -Seconds 10
Write-Output "DocIO process ID: $($process.Id)"
Get-Process
Test-NetConnection -ComputerName localhost -Port 6979
$response = Invoke-WebRequest -Uri http://localhost:6979/health -UseBasicParsing
if ($response.StatusCode -eq 200) {
Write-Output "DocIO is healthy"
} else {
throw "DocIO is not healthy"
}
$processId = (Get-Process -Name docio -ErrorAction SilentlyContinue).Id
if ($null -ne $processId) {
Stop-Process -Id $processId -Force
} else {
Write-Output "DocIO process not found."
}
shell: powershell
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Inspect git version
run: |
git --version

- name: Remove cloud-only modules and install Python client
run: |
set -e
Expand Down Expand Up @@ -89,11 +93,18 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
# JAMAI_API_KEY: ${{ secrets.JAMAI_API_KEY }}
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1

- name: Pytest
- name: Inspect owl environment
run: docker exec jamai_owl pip list

# - name: Pytest (owl)
# run: |
# set -e
# python -m pytest -vv --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov-report=xml services/api/tests

- name: Pytest (Python client)
run: |
set -e
export JAMAI_API_BASE=http://localhost:6969/api
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ jobs:

- name: Check files using Prettier
run: |
npm install -g prettier@3.1
npm install -g prettier@3.3.2
prettier --check .
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ clients/typescript/**/*.d.ts

**/node_modules/
**/docs-autogen/
**/docs-autogen-ts/
**/docs-autogen-ts/
**/dist
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples/github-bot"]
path = examples/github-bot
url = https://github.com/EmbeddedLLM/github-bot
Loading
Loading