Repository navigation
feat(docker): run experimentation infra in docker compose #8752
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
73dca9d
feat(docker): add optional experimentation profile to docker compose
gagantrivedi d8ca5d5
feat(docker): run experimentation services by default
gagantrivedi 0d72a32
feat(docker): run flags only by naming services, add make targets
gagantrivedi 325371c
fix(docker): stop clickhouse-init when the schema download fails
gagantrivedi fdfb275
Merge remote-tracking branch 'origin/main' into feat/docker-compose-e…
gagantrivedi 89887d5
docs(experimentation): render the ClickHouse schema from events.sql
gagantrivedi 7124ae9
feat(docker): deliver experimentation events through warehouse-delivery
gagantrivedi 711cded
Merge main into feat/docker-compose-experimentation
gagantrivedi 1a17d54
feat(docker): add flags-only compose file and document experimentatio…
gagantrivedi 2c2ab9d
chore: drop docker make targets
gagantrivedi 2acc9f6
chore: add docker-up and docker-down make targets
gagantrivedi b72fa67
Merge remote-tracking branch 'origin/main' into feat/docker-compose-e…
gagantrivedi 56d3954
feat(docker): share WAREHOUSE_CREDENTIALS_SECRET between the API and …
gagantrivedi feb24ff
docs: drop WAREHOUSE_CREDENTIALS_SECRET default
gagantrivedi 81efa88
test(frontend): drop ClickHouse docs copy test
gagantrivedi 99f8be1
Merge remote-tracking branch 'origin/main' into feat/docker-compose-e…
gagantrivedi 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
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,90 @@ | ||
| # See https://docs.flagsmith.com/deployment/docker for more information on running Flagsmith in Docker | ||
| # This Docker Compose file will run the Flagsmith Platform without experimentation | ||
|
|
||
| x-flagsmith-env: &flagsmith-env | ||
| # All environments variables are available here: | ||
| # API: https://docs.flagsmith.com/deployment/locally-api#environment-variables | ||
| # UI: https://docs.flagsmith.com/deployment/locally-frontend#environment-variables | ||
|
|
||
| DATABASE_URL: postgresql://postgres:password@postgres:5432/flagsmith | ||
| USE_POSTGRES_FOR_ANALYTICS: 'true' # Store API and Flag Analytics data in Postgres | ||
| ENVIRONMENT: production # set to 'production' in production. | ||
| DJANGO_ALLOWED_HOSTS: '*' # Change this in production | ||
| FLAGSMITH_DOMAIN: localhost:8000 # Change this in production | ||
| DJANGO_SECRET_KEY: secret # Change this in production | ||
| # PREVENT_SIGNUP: 'true' # Uncomment to prevent any additional signups | ||
| # ALLOW_REGISTRATION_WITHOUT_INVITE: 'true' # Uncomment and set to false to only allow signups via invitations | ||
|
|
||
| # Enable Task Processor | ||
| TASK_RUN_METHOD: TASK_PROCESSOR # other options are: SYNCHRONOUSLY, SEPARATE_THREAD (default) | ||
| PROMETHEUS_ENABLED: 'true' | ||
|
|
||
| # Uncomment if you want to enable Google OAuth. Note this does not turn Google OAuth on. You still need to use | ||
| # Flagsmith on Flagsmith to enable it - https://docs.flagsmith.com/deployment/#oauth_google | ||
| # DJANGO_SECURE_CROSS_ORIGIN_OPENER_POLICY: 'same-origin-allow-popups' | ||
|
|
||
| # For more info on configuring E-Mails - https://docs.flagsmith.com/deployment/locally-api#environment-variables | ||
| # Example SMTP: | ||
| # EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend | ||
| # EMAIL_HOST: mail.example.com | ||
| # SENDER_EMAIL: flagsmith@example.com | ||
| # EMAIL_HOST_USER: flagsmith@example.com | ||
| # EMAIL_HOST_PASSWORD: smtp_account_password | ||
| # EMAIL_PORT: 587 # optional | ||
| # EMAIL_USE_TLS: 'true' # optional | ||
|
|
||
| volumes: | ||
| pgdata: | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:15.5-alpine | ||
| environment: | ||
| POSTGRES_PASSWORD: password | ||
| POSTGRES_DB: flagsmith | ||
| container_name: flagsmith_postgres | ||
| volumes: | ||
| - pgdata:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: ['CMD-SHELL', 'pg_isready -d flagsmith -U postgres'] | ||
| interval: 2s | ||
| timeout: 2s | ||
| retries: 20 | ||
| start_period: 20s | ||
|
|
||
| migrate-db: | ||
| image: docker.flagsmith.com/flagsmith/flagsmith:latest | ||
| command: | ||
| - migrate | ||
| environment: | ||
| <<: *flagsmith-env | ||
| healthcheck: | ||
| disable: true | ||
| depends_on: | ||
| postgres: | ||
| condition: service_healthy | ||
|
|
||
| flagsmith: | ||
| image: docker.flagsmith.com/flagsmith/flagsmith:latest | ||
| command: | ||
| - serve | ||
| environment: | ||
| <<: *flagsmith-env | ||
| ports: | ||
| - 8000:8000 | ||
| depends_on: | ||
| migrate-db: | ||
| condition: service_completed_successfully | ||
|
|
||
| # The flagsmith_processor service is only needed if TASK_RUN_METHOD set to TASK_PROCESSOR | ||
| # in the application environment | ||
| flagsmith-task-processor: | ||
| image: docker.flagsmith.com/flagsmith/flagsmith:latest | ||
| environment: | ||
| <<: *flagsmith-env | ||
| ports: | ||
| - 8001:8000 | ||
| depends_on: | ||
| migrate-db: | ||
| condition: service_completed_successfully | ||
| command: run-task-processor | ||
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
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,26 @@ | ||
| -- ClickHouse schema for experimentation events. | ||
| CREATE DATABASE IF NOT EXISTS flagsmith_exp; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS flagsmith_exp.events | ||
| ( | ||
| environment_key LowCardinality(String), | ||
| event LowCardinality(String), | ||
| feature_name LowCardinality(String), | ||
| timestamp DateTime64(3), | ||
| collected_at DateTime64(3), | ||
| identifier String, | ||
| value String CODEC(ZSTD(3)), | ||
| traits String CODEC(ZSTD(3)), | ||
| metadata String CODEC(ZSTD(3)), | ||
| sdk_language LowCardinality(String), | ||
| sdk_version LowCardinality(String), | ||
|
|
||
| INDEX idx_identity identifier TYPE bloom_filter GRANULARITY 4, | ||
|
|
||
| CONSTRAINT environment_key_not_empty CHECK environment_key != '', | ||
| CONSTRAINT event_not_empty CHECK event != '', | ||
| CONSTRAINT timestamp_sane CHECK timestamp > toDateTime64('2020-01-01 00:00:00', 3) | ||
| ) | ||
| ENGINE = MergeTree | ||
| PARTITION BY toYYYYMMDD(timestamp) | ||
| ORDER BY (environment_key, event, feature_name, timestamp, identifier); |
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
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.
Uh oh!
There was an error while loading. Please reload this page.