Skip to content

Commit 86cf80b

Browse files
committed
Updates
1 parent 7901748 commit 86cf80b

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

firebase.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
"runtimeConfig": ".runtimeconfig.json"
1414
},
1515
{
16-
"predeploy": [". llm/venv/bin/activate && python3.10 -m pip install -r llm/requirements.txt"],
16+
"predeploy": [". llm/venv/bin/activate && python3 -m pip install -r llm/requirements.txt"],
1717
"source": "llm",
1818
"codebase": "maple-llm",
19-
"runtime": "python310"
19+
"runtime": "python311"
2020
}
2121
],
2222
"firestore": {

infra/Dockerfile.firebase

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM andreysenov/firebase-tools:latest-node-18
22

33
USER root
4-
RUN apt update && apt install -y curl
4+
RUN apt update && apt install -y curl python3 python3-pip python3-venv
55

66
WORKDIR /app
77
RUN chown -R node:node .

infra/firebase.compose.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"runtime": "nodejs18"
1313
},
1414
{
15-
"predeploy": [". llm/venv/bin/activate && python3.10 -m pip install -r llm/requirements.txt"],
15+
"predeploy": [". llm/venv/bin/activate && python3 -m pip install -r llm/requirements.txt"],
1616
"source": "llm",
1717
"codebase": "maple-llm",
18-
"runtime": "python310"
18+
"runtime": "python311"
1919
}
2020
],
2121
"firestore": {

llm/readme.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,39 @@ pip3 install -r requirements.txt
134134
python3 -m flask --app main run
135135
```
136136
137-
TODO:
138-
139-
- [x] Get an OpenAPI key `firebase functions:secrets:access OPENAI_DEV`
140-
- [ ] Need to get docker running locally `yarn compose up --build`
141-
- [x] Try to deploy the function `firebase deploy --only functions:maple-llm`
142-
- [x] Alphabetize the requirements.txt file
143-
- [ ] Add some deploying/testing from the command line notes
144-
```bash
137+
## Infrastructure notes
138+
139+
As of 2025-06-17, the version of `python3` inside the
140+
`infra/Dockerfile.firebase` is 3.11. Therefore, the `firebase.json` files use
141+
the `python311` runtime.
142+
143+
## Deploying locally
144+
145+
This is quite tricky due to how we overlay our current source directory to
146+
`/app` inside the container. You'll need to create and install dependencies from
147+
**inside** the container. If you are just working on python related code that
148+
doesn't need to be in Firebase, you **won't** be able to use this environment.
149+
150+
```shell
151+
# Build the maple-firebase container
152+
yarn dev:update
153+
# Start up bash within the maple-firebase container
154+
docker run -v .:/app -it maple-firebase /bin/bash
155+
# Build the virtual env and install the dependencies matching the container
156+
python3 -m venv llm/venv
157+
source llm/venv/bin/activate
158+
pip3 install -r llm/requirements.txt
159+
```
160+
161+
## Deploying to Firebase
162+
163+
```shell
145164
# not sure if the GOOGLE_APPLICATION_CREDENTIALS is strictly necessary, but I
146165
# had a number of problems with authorization
147166
GOOGLE_APPLICATION_CREDENTIALS=/path/to/application_default_credentials.json \
148167
firebase deploy --only functions:maple-llm --debug
149168

150-
# This is an example curl command for hitting the production function
169+
# Hit the function in production
151170
curl \
152171
-X POST \
153172
-H "Content-Type: application/json" \

0 commit comments

Comments
 (0)