-
Notifications
You must be signed in to change notification settings - Fork 0
[DRAFT] Implement constructive-sdk into function, fixes, and cleanup #8
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
Open
Jovonni
wants to merge
37
commits into
main
Choose a base branch
from
dev/functions-integrate-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
eb5a904
functions testing harness with simple-bash. hello-world, and runtime-…
Jovonni ce3bce3
various function prototypes, working on common function contract
Jovonni 6559bdf
added cicd
Jovonni 0ad374c
updated various functions, with global runner
Jovonni 7177a64
twilio, and using new envvars
Jovonni 23d8ae0
added new env vars to the test-runner.ts, can pass all (for now, TODO)
Jovonni ba1f218
dotenv dep for .env
Jovonni c07e4ef
updated several functions
Jovonni f6a363f
makefile changes and scripts and lock
Jovonni 874a38e
chore: ignore opencode binary artifact
Jovonni 4c136e4
Merge pull request #4 from constructive-io/d/function-testing-foundation
Jovonni 531d0a2
warn on gql fallback
Jovonni c8bca84
added matrix
Jovonni 219dc23
calvin api a envvar
Jovonni d4163e9
Merge pull request #6 from constructive-io/dev/testing-strategy
Jovonni 0a6b034
feat: add pgpm-dump function and standardize k8s test runner to v4
Jovonni dfce124
fix(ci): make kind binary path resolution dynamic in Makefile
Jovonni ecd7c5d
fix(ci): parameterize KIND_CLUSTER_NAME to support CI 'local' cluster
Jovonni c34dc03
fix(ci): remove unconfigured submodule _calvincode_build from git index
Jovonni 22aa874
Merge pull request #5 from constructive-io/dev/various-functions-2
Jovonni 9584893
add node runtime and runner logic
Jovonni a14959b
setup build scripts and root configuration
Jovonni 19fe2bc
add hello world function infrastructure
Jovonni e40a358
add simple bash function infrastructure
Jovonni ef49f51
add db management functions infrastructure
Jovonni 56693ed
scaffold llm functions infrastructure
Jovonni 4ac8697
add integration functions infrastructure
Jovonni e19e8ae
add auth and github utilities infrastructure
Jovonni a64bddd
add general utility functions infrastructure
Jovonni 490395e
add experimental language runners infrastructure
Jovonni aee097f
implement core logic for all functions using sdk
Jovonni c6ea1f4
fix test runner rbac permissions
Jovonni 6c4b8f9
update kubernetes manifests for deployment
Jovonni e2817fa
fix all cloud functions tests and update verification
Jovonni d68f38c
last fix for pytorch gpu and rust hello world funcs
Jovonni d883c73
cleanup repo artifacts and track vendored sdk
Jovonni e714a8a
refactor: use single source sdk.tgz, robust makefile, and fixed tests
Jovonni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| trigger: always_on | ||
| --- | ||
|
|
||
| NOTE: ALL INDEX.TS MUST HAVE A TYPED GRAPHQL QUERY, PERIOD, DONT EVER USE STRING BASED GQL QUERY.. EEVR... | ||
|
|
||
| okay so how do we know everything belowis impemented and tested then? THEN ANALYSE ALL OF THE GIT STATUS AND GIT DIFFS TO EDUCATE ME ON WHAT WAS CHANGED AND HOW IT ALIGNS TO WHAT WAS ASKED OF ME BELOW: | ||
|
|
||
| systematically, we need to know | ||
|
|
||
| TRIPLE CHECK THE BOTTOM requirements to see if we have addressed it all lollllll | ||
|
|
||
| IDK YOU SHOULD PROB GO STUDY THE CONSTUCTIVE-DB REPO AND SEARCH FOR THE SERVICES PACKAGE TO SEE WHAT WE CAN USE THERE OR SOEMTHING... CUZ YOU SHOULDNT BE MAKING SQL FILES.... | ||
|
|
||
| I SEE YOU MADE SCHEMAS, BUT ANY SCHEMA SHOULD BE A PGPM MODULE INSIDE OF CONSTRUCTIVE-DB REPO.... SO IM NOT SURE WHY YOU EVEN DID THAT, DO WE NEED THE SCHEMAS? WERE WE ASKED TO DO THAT FROM OUR ORIGINAL ASKS HERE? HELP ME UNDERSTAND WHY YOU DID THIS.. | ||
|
|
||
| OLD PROMPTS: | ||
|
|
||
| ONLY TOUCH CONSTRUCTIVE-FUNCTIONS...CONTINUE: | ||
|
|
||
| WE ARE WORKING IN CONSTRUCTIVE-FUNCTIONS REPO: | ||
|
|
||
| GO MAKE SURE YOU IMPLEMENT THIS, COME UP WITH A DETAILED VERBOSE PLAN TO DO THIS | ||
|
|
||
| okay now come up with a strategy to achieve the following criteria. Break these down into a checklist of criteria: | ||
|
|
||
| ACTUAL TASKS: | ||
|
|
||
| ``` | ||
| For the functions: i think we want a couple of features: | ||
| Functions should be importable and publish functions. | ||
| That way then running them locally in a combined server of sorts, we should be able to import them into the server and be able to run them | ||
| Each function should be configureable with env vars, or configs: | ||
| one config file should be able to provide overrides for each of the components, so could be loaded up from individual config files, or a combined one | ||
| Each function should have its own docker image: | ||
| currently we have one large docker image with everything, and running functions from there | ||
| Each function should be runable locally: | ||
| function does not need to know anything about knative, so should be able to run as a local server in docker-compose or with pnpm directly as well | ||
| cnc cli should be able to invoke functions. similar to cnc jobs up commands | ||
| cc: @Zhi Zhen (note that we would eventually not use subdir constructive/functions but the other repo: constructive-functions). | ||
| ``` | ||
|
|
||
|
|
||
| also we need: | ||
|
|
||
|
|
||
| 1) creating a database in function | ||
| 2:59 | ||
| 2) being able to run function as user | ||
| 3:00 | ||
| We made issues earlier but basically our ingress was blocking long requests so we want to start tracking flow now | ||
| 3:00 | ||
|
|
||
|
|
||
| AND | ||
|
|
||
| also — we should discuss another | ||
| 6:18 | ||
| 3) keeping a service db in sync with child databases | ||
| 6:18 | ||
| like a router database for when we get into sharding | ||
| 6:18 | ||
| this would be key for scale | ||
| 6:19 | ||
| services_public would exist on all the databases | ||
| 6:19 | ||
| but the children dbs would push the router | ||
| 6:19 | ||
| then we can have multiple graphile nodejs processes that look one ONE services_public on the router/services db to figure out which databases to connect to | ||
| 6:20 | ||
| gives us a some type of API sharding that way | ||
| 6:20 | ||
| I think that, combined with moving data between databases, and we're gonna be in decent shape | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| **/node_modules | ||
| packages | ||
| dist | ||
| .git | ||
| .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Python runtime for LLM API inference (OpenAI & Claude) | ||
| # This module makes API calls to OpenAI and Anthropic for LLM inference | ||
| # For the full fat container with Ollama & local models, see Dockerfile.ollama | ||
| # Based on: /Users/0xj0/Documents/projects/LQL/CONSTRUCTIVE/agentic-foundation | ||
|
|
||
| ##################### heres what is had inside of (/Users/0xj0/Documents/projects/LQL/CONSTRUCTIVE/agentic-foundation) -- GO VERIFY YOURSELF | ||
|
|
||
| # Builder Stage | ||
| FROM rust:latest as builder | ||
| WORKDIR /app | ||
| COPY . . | ||
| # Build agent_core | ||
| RUN cargo build --release --bin agent_core | ||
|
|
||
| # Runtime Stage - "Fat Container" | ||
| FROM ubuntu:22.04 | ||
| WORKDIR /app | ||
|
|
||
| # Set non-interactive install | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # 1. Install Basic Tools & Runtimes (Python, Node, System Utils) | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl wget git build-essential \ | ||
| python3 python3-pip python3-venv \ | ||
| nodejs npm \ | ||
| postgresql-14 postgresql-client-14 \ | ||
| sudo \ | ||
| libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 \ | ||
| libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 \ | ||
| chromium-browser \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # 2. Install Rust in Runtime (for the agent to use `cargo`) | ||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
| ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
|
||
| # 3. Install PostGraphile | ||
| # 3. Install PostGraphile | ||
| RUN npm install -g pnpm && pnpm add -g postgraphile @graphile-contrib/pg-simplify-inflector | ||
|
|
||
| # 4. Install Ollama & Bake Models | ||
| # We install Ollama, then start it in the background to pull models into the image layers. | ||
| RUN curl -fsSL https://ollama.com/install.sh | sh | ||
|
|
||
| # Pre-pull Models (Using available equivalents for the '2025' spec models) | ||
| # GPT-OSS -> llama3.2 (Small, open, robust) | ||
| # Qwen3-VL -> llava (Vision model standard in Ollama) | ||
| # Devstral -> qwen2.5-coder (Excellent coding model) | ||
| # Nemotron -> mistral (Strong reasoning) | ||
| RUN nohup bash -c "ollama serve" & \ | ||
| sleep 10 && \ | ||
| ollama pull llama3.2 && \ | ||
| ollama pull llava && \ | ||
| ollama pull qwen2.5-coder && \ | ||
| ollama pull mistral && \ | ||
| pkill ollama | ||
|
|
||
| # 5. Setup Data & Permissions | ||
| RUN mkdir -p /var/lib/postgresql/data && chown -R postgres:postgres /var/lib/postgresql/data | ||
|
|
||
| # 6. Copy Binaries & Scripts | ||
| COPY --from=builder /app/target/release/agent_core /app/agent_core | ||
| COPY scripts/entrypoint.sh /app/entrypoint.sh | ||
| RUN chmod +x /app/entrypoint.sh | ||
|
|
||
| # 7. Config | ||
| ENV DATABASE_URL=postgres://agent:agent@localhost:5432/agentic | ||
| ENV OLLAMA_HOST=0.0.0.0:11434 | ||
|
|
||
| EXPOSE 3000 5432 11434 5000 | ||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] | ||
| CMD ["./agent_core"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM node:22-alpine | ||
|
|
||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY package.json ./ | ||
|
|
||
| RUN npm install -g pnpm@10.12.2 && pnpm install --prod | ||
|
|
||
| COPY dist ./dist | ||
| COPY runner.js ./runner.js | ||
|
|
||
| ENV NODE_ENV=production | ||
| ENV PORT=8080 | ||
|
|
||
| USER node | ||
|
|
||
| CMD ["node", "runner.js", "dist/index.js"] | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's clean up some english, looks fun maybe that helps llm lol — I'd just have an agent pass over to clean up grammer/spelling