0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/.devcontainer/.env

29 lines
650 B
Bash
Raw Normal View History

Reimplement codespaces support (#7234) * dev(codespaces): add "lean in" docker configuration for codespaces This changes creates a dedicated `docker-compose.yml` and `Dockerfile` for codespaces and doesn't attempt to have compatability with the existing docker config files. This is intentional and is designed to be a close to what codespaces would consider the ideal, so as to understand what great would look like. At the moment it doesn't do, but could: 1. install python and node packages in the image 2. push this image up to dockerhub 3. specify this image to be used for caching. There is a "cacheFrom" option in the [.devcontainer reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) although I haven't checked how this works with using `docker-compose.yml`. Perhaps we just need to add the `image:` property to the `app` service :fingerscrossed: 4. specify default extensions and settings to be used. * Use python 3.9, not the latest python 3 codespaces supports * Add some basic python default settings and extensions * add github codespaces image build workflow * chore: update docker-compose cache from :cache tag * chore: use docker cache-to inline * add codespaces platform comment * temp run on branch * chore: fix flatforms format * chore: update qemu comment * chore: codespaces build use master image * chore: target x86_64 * chore: just use image for codespaces, don't try to build * add in python, node requirements * install node * install node * uncomment node deps install * use app network stack for all services * move .env to .dev.env and us in docker-compose * set WORKDIR to workspace * pin apt packages * pin versions, remove apt-key * add yarn cache clean * Fix hadolint warnings * make codespace build on master, or a PR with codespaces-build label * add missing && * dont bother with clickhouse install, its huge * dont be cute with the networks, just expose explicitly * fix network * create container zsh * correct .env path * point app to the clickhouse container * Also install saml deps * ignore .env again * libxml already installed * correct conditional workflow comment
2021-11-23 09:34:51 +01:00
# Default to running in django DEBUG mode. For tests this should be set to 0
DEBUG=1
# Make psql default to local settings
PGHOST=localhost
Reimplement codespaces support (#7234) * dev(codespaces): add "lean in" docker configuration for codespaces This changes creates a dedicated `docker-compose.yml` and `Dockerfile` for codespaces and doesn't attempt to have compatability with the existing docker config files. This is intentional and is designed to be a close to what codespaces would consider the ideal, so as to understand what great would look like. At the moment it doesn't do, but could: 1. install python and node packages in the image 2. push this image up to dockerhub 3. specify this image to be used for caching. There is a "cacheFrom" option in the [.devcontainer reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) although I haven't checked how this works with using `docker-compose.yml`. Perhaps we just need to add the `image:` property to the `app` service :fingerscrossed: 4. specify default extensions and settings to be used. * Use python 3.9, not the latest python 3 codespaces supports * Add some basic python default settings and extensions * add github codespaces image build workflow * chore: update docker-compose cache from :cache tag * chore: use docker cache-to inline * add codespaces platform comment * temp run on branch * chore: fix flatforms format * chore: update qemu comment * chore: codespaces build use master image * chore: target x86_64 * chore: just use image for codespaces, don't try to build * add in python, node requirements * install node * install node * uncomment node deps install * use app network stack for all services * move .env to .dev.env and us in docker-compose * set WORKDIR to workspace * pin apt packages * pin versions, remove apt-key * add yarn cache clean * Fix hadolint warnings * make codespace build on master, or a PR with codespaces-build label * add missing && * dont bother with clickhouse install, its huge * dont be cute with the networks, just expose explicitly * fix network * create container zsh * correct .env path * point app to the clickhouse container * Also install saml deps * ignore .env again * libxml already installed * correct conditional workflow comment
2021-11-23 09:34:51 +01:00
PGUSER=posthog
PGPASSWORD=posthog
PGPORT=5432
PGDATABASE=posthog
# Django settings
## Update to postgres to use postgres for all event queries
PRIMARY_DB=clickhouse
DATABASE_URL=postgres://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}
# Kafka settings
Reimplement codespaces support (#7234) * dev(codespaces): add "lean in" docker configuration for codespaces This changes creates a dedicated `docker-compose.yml` and `Dockerfile` for codespaces and doesn't attempt to have compatability with the existing docker config files. This is intentional and is designed to be a close to what codespaces would consider the ideal, so as to understand what great would look like. At the moment it doesn't do, but could: 1. install python and node packages in the image 2. push this image up to dockerhub 3. specify this image to be used for caching. There is a "cacheFrom" option in the [.devcontainer reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) although I haven't checked how this works with using `docker-compose.yml`. Perhaps we just need to add the `image:` property to the `app` service :fingerscrossed: 4. specify default extensions and settings to be used. * Use python 3.9, not the latest python 3 codespaces supports * Add some basic python default settings and extensions * add github codespaces image build workflow * chore: update docker-compose cache from :cache tag * chore: use docker cache-to inline * add codespaces platform comment * temp run on branch * chore: fix flatforms format * chore: update qemu comment * chore: codespaces build use master image * chore: target x86_64 * chore: just use image for codespaces, don't try to build * add in python, node requirements * install node * install node * uncomment node deps install * use app network stack for all services * move .env to .dev.env and us in docker-compose * set WORKDIR to workspace * pin apt packages * pin versions, remove apt-key * add yarn cache clean * Fix hadolint warnings * make codespace build on master, or a PR with codespaces-build label * add missing && * dont bother with clickhouse install, its huge * dont be cute with the networks, just expose explicitly * fix network * create container zsh * correct .env path * point app to the clickhouse container * Also install saml deps * ignore .env again * libxml already installed * correct conditional workflow comment
2021-11-23 09:34:51 +01:00
KAFKA_ENABLED=true
KAFKA_HOSTS=localhost:9092
KAFKA_URL=kafka://localhost:9092
Reimplement codespaces support (#7234) * dev(codespaces): add "lean in" docker configuration for codespaces This changes creates a dedicated `docker-compose.yml` and `Dockerfile` for codespaces and doesn't attempt to have compatability with the existing docker config files. This is intentional and is designed to be a close to what codespaces would consider the ideal, so as to understand what great would look like. At the moment it doesn't do, but could: 1. install python and node packages in the image 2. push this image up to dockerhub 3. specify this image to be used for caching. There is a "cacheFrom" option in the [.devcontainer reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) although I haven't checked how this works with using `docker-compose.yml`. Perhaps we just need to add the `image:` property to the `app` service :fingerscrossed: 4. specify default extensions and settings to be used. * Use python 3.9, not the latest python 3 codespaces supports * Add some basic python default settings and extensions * add github codespaces image build workflow * chore: update docker-compose cache from :cache tag * chore: use docker cache-to inline * add codespaces platform comment * temp run on branch * chore: fix flatforms format * chore: update qemu comment * chore: codespaces build use master image * chore: target x86_64 * chore: just use image for codespaces, don't try to build * add in python, node requirements * install node * install node * uncomment node deps install * use app network stack for all services * move .env to .dev.env and us in docker-compose * set WORKDIR to workspace * pin apt packages * pin versions, remove apt-key * add yarn cache clean * Fix hadolint warnings * make codespace build on master, or a PR with codespaces-build label * add missing && * dont bother with clickhouse install, its huge * dont be cute with the networks, just expose explicitly * fix network * create container zsh * correct .env path * point app to the clickhouse container * Also install saml deps * ignore .env again * libxml already installed * correct conditional workflow comment
2021-11-23 09:34:51 +01:00
# Clickhouse settings
CLICKHOUSE_HOST=localhost
Reimplement codespaces support (#7234) * dev(codespaces): add "lean in" docker configuration for codespaces This changes creates a dedicated `docker-compose.yml` and `Dockerfile` for codespaces and doesn't attempt to have compatability with the existing docker config files. This is intentional and is designed to be a close to what codespaces would consider the ideal, so as to understand what great would look like. At the moment it doesn't do, but could: 1. install python and node packages in the image 2. push this image up to dockerhub 3. specify this image to be used for caching. There is a "cacheFrom" option in the [.devcontainer reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) although I haven't checked how this works with using `docker-compose.yml`. Perhaps we just need to add the `image:` property to the `app` service :fingerscrossed: 4. specify default extensions and settings to be used. * Use python 3.9, not the latest python 3 codespaces supports * Add some basic python default settings and extensions * add github codespaces image build workflow * chore: update docker-compose cache from :cache tag * chore: use docker cache-to inline * add codespaces platform comment * temp run on branch * chore: fix flatforms format * chore: update qemu comment * chore: codespaces build use master image * chore: target x86_64 * chore: just use image for codespaces, don't try to build * add in python, node requirements * install node * install node * uncomment node deps install * use app network stack for all services * move .env to .dev.env and us in docker-compose * set WORKDIR to workspace * pin apt packages * pin versions, remove apt-key * add yarn cache clean * Fix hadolint warnings * make codespace build on master, or a PR with codespaces-build label * add missing && * dont bother with clickhouse install, its huge * dont be cute with the networks, just expose explicitly * fix network * create container zsh * correct .env path * point app to the clickhouse container * Also install saml deps * ignore .env again * libxml already installed * correct conditional workflow comment
2021-11-23 09:34:51 +01:00
CLICKHOUSE_DATABASE=posthog_test
CLICKHOUSE_VERIFY=False
feat(trends): add moving average `smoothing_intervals` param (#6435) * feat(trends): add moving average `smoothing_intervals` param This will average over the preceding `smoothing_intervals` intervals. The driver for this is to remove either weekly or monthly trends. Limitations at the moment are that it only works for total volume queries, as it relies on the results from clickhouse being from a single timeline series. * WIP UI for selecting smoothing * WIP: Fix typing and appearce logic * Made smoothing extensible beyond day * Test now considers a non-trivial case * chore(smoothing): use url params for state storage of smoothing value This should allow for url navigation to work, although I haven't quite figured out how we then use this to make the insights/trends POST request * Added further tests for smoothing intervals * fix test_to_dict * fix trend tests * Added test to validate preceeding limit * Fixed test for 2 interval * clear django redis cache before each test * add explicit ordering to dashboard items in refresh test Otherwise the test is not deterministic. * Revert "clear django redis cache before each test" This is a good thing to do, but I don't want to open up a discussion on this PR. It was not fix for the immediate intermittent test_refresh_cache test This reverts commit aa52f332f35c97076dcd1ec5e608e1450e83832d. * format * clickhouse trends: SET allow_experimental_window_functions = 1 * fix setting of allow_experimental_window_functions * add cache clears for requests * Delete SmoothingFilterLogic.ts Removed smoothing filter logic file * Use `SMOOTHING_INTERVALS` instead of string literal This should ensure that if we update the url param key somewhere, we don't have to remember to change it here as well. Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> * move test_trends to ee * actually delete test_trends.py * Transitioned smoothing logic to use Logic * WIP: Moving away from url based logic * WIP: Refactored logic on listeners * fix storybook * refactor * set redis url * remove keastory * Move interval filter to setFilters insight logic * update trend snapshots * run prettier * Add stickiness test deps that were in test_trends * Fix storybook * fix stickiness tests * update snapshot * fix cohort test * only display smoothing on linear * fix tests * Add some tests * added box to make dropdown consistent * Floor * fix tests * fix tests * fix test * Add feature flag Co-authored-by: Marcus Hyett <marcus@posthog.com> Co-authored-by: Marcus Hyett (PostHog) <85295485+marcushyett-ph@users.noreply.github.com> Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> Co-authored-by: Tim Glaser <tim@glsr.nl>
2022-03-23 16:54:38 +01:00
# Setup redis config
REDIS_URL=redis://localhost:6379/