Skip to content

Commit

Permalink
fix: ci github ratelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
hientominh committed Nov 7, 2024
1 parent bc9544a commit 9023410
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/cortex-cpp-quality-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,30 @@ jobs:
cd engine
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
- name: Run unit tests
- name: Run setup config
run: |
rm ~/.cortexrc
cd engine
make run-unit-tests
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
echo "apiServerPort: 3928" >> ~/.cortexrc
./build/cortex
cat ~/.cortexrc
- name: Run setup config for macos
if: runner.os == 'macOS'
- name: Run unit tests
run: |
cd engine
./build/cortex --version
sed -i '' 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc
make run-unit-tests
- name: Run setup config for linux
if: runner.os != 'macOS'
shell: bash
- name: Run setup config
run: |
rm ~/.cortexrc
cd engine
./build/cortex --version
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
echo "apiServerPort: 3928" >> ~/.cortexrc
./build/cortex
cat ~/.cortexrc
- name: Run e2e tests
if: runner.os != 'Windows' && github.event.pull_request.draft == false
Expand All @@ -129,7 +134,7 @@ jobs:
rm build/cortex-nightly
rm build/cortex-beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}

- name: Run e2e tests
if: runner.os == 'Windows' && github.event.pull_request.draft == false
Expand All @@ -143,7 +148,7 @@ jobs:
rm build/cortex-nightly.exe
rm build/cortex-beta.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}

- name: Pre-package
run: |
Expand Down
5 changes: 3 additions & 2 deletions engine/e2e-test/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
executable_unix_path = "build/cortex"

# Timeout
timeout = 5 # secs
timeout = 10 # secs
start_server_success_message = "Server started"


Expand Down Expand Up @@ -74,7 +74,7 @@ def start_server() -> bool:
def start_server_nix() -> bool:
executable = getExecutablePath()
process = subprocess.Popen(
[executable] + ["start", "-p", "3928"],
[executable] + ["--verbose", "start", "-p", "3928"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
Expand All @@ -88,6 +88,7 @@ def start_server_nix() -> bool:
for stream in readable:
line = stream.readline()
if line:
print(f"{'STDOUT' if stream == process.stdout else 'STDERR'}: {line.strip()}")
if start_server_success_message in line:
# have to wait a bit for server to really up and accept connection
print("Server started found, wait 0.3 sec..")
Expand Down

0 comments on commit 9023410

Please sign in to comment.