Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
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
39 changes: 0 additions & 39 deletions .github/workflows/auto-bump-llamacpp.yml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches:
- main
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
paths:
[
".github/scripts/**",
".github/workflows/build.yml",
".github/workflows/codeql-analysis.yml",
"**/CMakeLists.txt",
"**/Makefile",
"**/*.h",
"**/*.hpp",
"**/*.c",
"**/*.cpp",
"**/*.cu",
"**/*.cc",
"**/*.cxx",
"llama.cpp",
"!docs/**",
"!.gitignore",
"!README.md",
]
pull_request:
types: [opened, synchronize, reopened]
paths:
[
".github/scripts/**",
".github/workflows/build.yml",
".github/workflows/codeql-analysis.yml",
"**/CMakeLists.txt",
"**/Makefile",
"**/*.h",
"**/*.hpp",
"**/*.c",
"**/*.cpp",
"**/*.cu",
"**/*.cc",
"**/*.cxx",
"llama.cpp",
"!docs/**",
"!.gitignore",
"!README.md",
]

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["c-cpp"]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
run: |
./install_deps.sh
mkdir build && cd build
cmake ..
CC=gcc-8 make -j $(sysctl -n hw.ncp)
ls -la

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
15 changes: 8 additions & 7 deletions controllers/health.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

using namespace drogon;

class health : public drogon::HttpSimpleController<health>
{
public:
void asyncHandleHttpRequest(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback) override;
PATH_LIST_BEGIN
PATH_ADD("/healthz", Get);
PATH_LIST_END
class health : public drogon::HttpSimpleController<health> {
public:
void asyncHandleHttpRequest(
const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback) override;
PATH_LIST_BEGIN
PATH_ADD("/healthz", Get);
PATH_LIST_END
};
1 change: 0 additions & 1 deletion controllers/llamaCPP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using namespace inferences;
using json = nlohmann::json;

// To store state of each inference request
struct State {
bool isStopped = false;
int task_id;
Expand Down
6 changes: 3 additions & 3 deletions controllers/processManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#include <cstdlib>
#include <trantor/utils/Logger.h>

void processManager::destroy(const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback) {
void processManager::destroy(
const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback) {
LOG_INFO << "Program is exitting, goodbye!";
exit(0);
return;
};
// Add definition of your processing function here
8 changes: 2 additions & 6 deletions controllers/processManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ using namespace drogon;
class processManager : public drogon::HttpController<processManager> {
public:
METHOD_LIST_BEGIN
// use METHOD_ADD to add your custom processing function here;
// METHOD_ADD(processManager::get, "/{2}/{1}", Get); // path is
// /processManager/{arg2}/{arg1}

METHOD_ADD(processManager::destroy, "/destroy",
Delete); // path is /processManager/{arg1}/{arg2}/list

METHOD_LIST_END
// your declaration of processing function maybe like this:

void destroy(const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback);
// void your_method_name(const HttpRequestPtr& req, std::function<void (const
// HttpResponsePtr &)> &&callback, double p1, int p2) const;
};