-
Pull the sidecar image (adjust for your architecture if necessary):
# Default (pulls the appropriate image for your platform if available) docker pull gremlin/failure-flags-sidecar:latest # Alternatively, specify architecture: docker pull --platform=linux/amd64 gremlin/failure-flags-sidecar:latest docker pull --platform=linux/arm64 gremlin/failure-flags-sidecar:latest
-
Create a temporary container:
docker create --name failure-flags-extract gremlin/failure-flags-sidecar:latest
-
Copy the sidecar binary from the container:
docker cp failure-flags-extract:/failure-flags-sidecar failure-flags-sidecar
-
Remove the container and make the binary executable:
docker rm failure-flags-extract chmod +x failure-flags-sidecar
The manifest.yml
uses (( placeholder ))
syntax to inject secrets, you need to create a vars.yml
file locally. This file should not be committed to source control, as it contains sensitive information.
Below is an example of what vars.yml
could look like:
aws_access_key_id: "YOUR_ACCESS_KEY_ID"
aws_secret_access_key: "YOUR_SECRET_ACCESS_KEY"
gremlin_team_id: "YOUR_GREMLIN_TEAM_ID"
gremlin_team_certificate: |-
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
gremlin_team_private_key: |-
-----BEGIN EC PRIVATE KEY-----
...
-----END EC PRIVATE KEY-----
- Create a file named
vars.yml
in the same directory as yourmanifest.yml
. - Replace the placeholder values (
YOUR_ACCESS_KEY_ID
,YOUR_SECRET_ACCESS_KEY
, etc.) with your real credentials. - Do not commit
vars.yml
to your git repository. It’s recommended to addvars.yml
to.gitignore
.
Below is an example manifest.yml
for deploying your Flask app with the Python buildpack, plus the Gremlin sidecar. Adjust memory, paths, and environment variables as needed:
---
applications:
- name: s3-failure-flags-app # App name in CF
memory: 512M # Memory for the container
disk_quota: 1G # Disk space for the container
instances: 1 # Number of instances
buildpacks:
- python_buildpack # Use Python buildpack for Flask
path: . # Push contents of current directory
command: null # Let the buildpack detect and use your Procfile
env:
S3_BUCKET: "commoncrawl" # Custom environment variables
DEBUG_MODE: "false"
CLOUD: "pcf"
AWS_ACCESS_KEY_ID: ((aws_access_key_id))
AWS_SECRET_ACCESS_KEY: ((aws_secret_access_key))
FAILURE_FLAGS_ENABLED: "true"
GREMLIN_SIDECAR_ENABLED: "true"
GREMLIN_TEAM_ID: ((gremlin_team_id))
GREMLIN_TEAM_CERTIFICATE: ((gremlin_team_certificate))
GREMLIN_TEAM_PRIVATE_KEY: ((gremlin_team_private_key))
GREMLIN_DEBUG: "true"
SERVICE_NAME: "s3-failure-flags-app"
sidecars:
- name: gremlin-sidecar
process_types: ["web"] # Attach sidecar to 'web' process
memory: 256M
disk_quota: 256M
command: "./failure-flags-sidecar" # Run Gremlin sidecar
From your project directory:
cf push --vars-file vars.yml
- The Python buildpack installs dependencies (from
requirements.txt
:flask
,boto3
,requests
,failureflags
). - Both the Flask app and the Gremlin sidecar run in the same container, allowing local communication (
localhost:5032
).