Skip to content

Commit 6597d52

Browse files
committed
Document transitional deploy env handling
1 parent 2d937db commit 6597d52

3 files changed

Lines changed: 46 additions & 3 deletions

File tree

.env.example

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# For local development only, uncomment this if you need to point ADC at a
2-
# specific credential file. The deployed App Engine service uses its attached
3-
# service account instead.
1+
# Left commented on purpose so `make setup-env` does not poison ADC with a fake
2+
# path in CI, Docker builds, or local shells. Uncomment only if your local
3+
# machine needs to point ADC at a real credential file. The deployed App Engine
4+
# service uses its attached service account instead.
45
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/policyengine_gcp_credentials.json
56

67
# Password for connecting to the PolicyEngine database

.github/workflows/push.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ jobs:
156156
- name: Validate App Engine deployment configuration
157157
run: bash .github/scripts/validate_app_engine_deploy_env.sh
158158
env:
159+
# Transitional: these values are still passed into the deploy bundle
160+
# by gcp/export.py. Long-term target is a generic image plus runtime
161+
# config / Secret Manager lookups instead of image bake-in.
159162
SIMULATION_API_URL: ${{ secrets.SIMULATION_API_URL }}
160163
GATEWAY_AUTH_ISSUER: ${{ secrets.GATEWAY_AUTH_ISSUER }}
161164
GATEWAY_AUTH_AUDIENCE: ${{ secrets.GATEWAY_AUTH_AUDIENCE }}
@@ -164,6 +167,9 @@ jobs:
164167
- name: Build staging deploy image
165168
run: bash .github/scripts/build_app_engine_image.sh
166169
env:
170+
# Transitional: these values are still rendered into the App Engine
171+
# image today. Long-term target is to stop passing them into the
172+
# image build and supply them as runtime config / Secret Manager data.
167173
APP_ENGINE_IMAGE_TAG: policyengine-api:staging-${{ steps.version.outputs.version }}
168174
POLICYENGINE_DB_PASSWORD: ${{ secrets.POLICYENGINE_DB_PASSWORD }}
169175
POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN }}
@@ -178,6 +184,9 @@ jobs:
178184
- name: Deploy staging version
179185
run: bash .github/scripts/deploy_app_engine_version.sh
180186
env:
187+
# Transitional: deploy_app_engine_version.sh still prepares a bundle
188+
# from these values before App Engine deploy. Long-term target is one
189+
# generic image plus runtime config / Secret Manager.
181190
APP_ENGINE_VERSION: ${{ steps.version.outputs.version }}
182191
APP_ENGINE_PROMOTE: "0"
183192
POLICYENGINE_DB_PASSWORD: ${{ secrets.POLICYENGINE_DB_PASSWORD }}
@@ -280,6 +289,9 @@ jobs:
280289
- name: Validate App Engine deployment configuration
281290
run: bash .github/scripts/validate_app_engine_deploy_env.sh
282291
env:
292+
# Transitional: these values are still passed into the deploy bundle
293+
# by gcp/export.py. Long-term target is a generic image plus runtime
294+
# config / Secret Manager lookups instead of image bake-in.
283295
SIMULATION_API_URL: ${{ secrets.SIMULATION_API_URL }}
284296
GATEWAY_AUTH_ISSUER: ${{ secrets.GATEWAY_AUTH_ISSUER }}
285297
GATEWAY_AUTH_AUDIENCE: ${{ secrets.GATEWAY_AUTH_AUDIENCE }}
@@ -288,6 +300,9 @@ jobs:
288300
- name: Deploy production version
289301
run: bash .github/scripts/deploy_app_engine_version.sh
290302
env:
303+
# Transitional: deploy_app_engine_version.sh still prepares a bundle
304+
# from these values before App Engine deploy. Long-term target is one
305+
# generic image plus runtime config / Secret Manager.
291306
APP_ENGINE_VERSION: ${{ steps.version.outputs.version }}
292307
APP_ENGINE_PROMOTE: "0"
293308
POLICYENGINE_DB_PASSWORD: ${{ secrets.POLICYENGINE_DB_PASSWORD }}

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,33 @@ make install
3535
make setup-env
3636
```
3737

38+
### 3a. Configure environment variables
39+
40+
`make setup-env` creates a local `.env` from `.env.example`. At minimum, local development expects values for:
41+
42+
- `POLICYENGINE_DB_PASSWORD`
43+
- `POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN`
44+
- `ANTHROPIC_API_KEY`
45+
- `OPENAI_API_KEY`
46+
- `HUGGING_FACE_TOKEN`
47+
48+
If you need a local Google credential file for ADC, uncomment and set:
49+
50+
- `GOOGLE_APPLICATION_CREDENTIALS`
51+
52+
Keep that commented unless you are pointing at a real local credential file. The deployed App Engine service uses its attached service account instead.
53+
54+
If you are running against an auth-protected simulation gateway outside the managed deploy path, you may also need:
55+
56+
- `SIMULATION_API_URL`
57+
- `GATEWAY_AUTH_REQUIRED`
58+
- `GATEWAY_AUTH_ISSUER`
59+
- `GATEWAY_AUTH_AUDIENCE`
60+
- `GATEWAY_AUTH_CLIENT_ID`
61+
- one of `GATEWAY_AUTH_CLIENT_SECRET` or `GATEWAY_AUTH_CLIENT_SECRET_RESOURCE`
62+
63+
Managed App Engine deploys currently still render some runtime config into the image bundle. Long-term, we intend to stop doing that and supply environment-specific config at runtime instead.
64+
3865
### 4. Start a server on localhost to see your changes
3966

4067
Run:

0 commit comments

Comments
 (0)