From 7505584cf8272480af7c9524a7cb1ca62eda43ce Mon Sep 17 00:00:00 2001 From: Ru Date: Thu, 28 Apr 2022 00:22:12 +0530 Subject: [PATCH] ARM64 dev support (#1863) * chore(docker): improve repeat contributions workflow * This change adds two new commands to gracefully stop and remove the Postgres and Clickhouse docker containers. To do so, it also gives them a recognizable name. * Additionally, the Postgres container is updated to use a named volume for its data. This lower friction for repeat contributions where one would otherwise sign up and activate their accounts again and again each time. * Apple M1 compatibility for local development * Patch upgrade for Python to a version that is built without errors * Use a new community image for clickhouse that's ARM64 compatible * Update contribution docs --- .tool-versions | 2 +- CONTRIBUTING.md | 1 + Makefile | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.tool-versions b/.tool-versions index 717852f3e..9984197c7 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ elixir 1.12.2-otp-24 erlang 24.0.3 nodejs 16.3.0 -python 3.9.4 +python 3.9.12 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a91c457e..5b8ab2f6a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,7 @@ Make sure Docker, Elixir, Erlang and Node.js are all installed on your developme ### Start the environment: 1. Run both `make postgres` and `make clickhouse`. + 1. If you are using Apple Silicon (any of the M1 or similar SoC variants), `make clickhouse-arm` offers a development-only substitute that will work on your local machine. Not intended for production. 2. You can set up everything with `make install`, alternatively run each command separately: 1. Run `mix deps.get`. This will download the required Elixir dependencies. 2. Run `mix ecto.create`. This will create the required databases in both Postgres and Clickhouse. diff --git a/Makefile b/Makefile index a8c9810a5..0c8d61e01 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ server: clickhouse: docker run --detach -p 8123:8123 --ulimit nofile=262144:262144 --volume=$$PWD/.clickhouse_db_vol:/var/lib/clickhouse --name plausible_clickhouse yandex/clickhouse-server:21.3.2.5 +clickhouse-arm: + docker run --detach -p 8123:8123 --ulimit nofile=262144:262144 --volume=$$PWD/.clickhouse_db_vol:/var/lib/clickhouse --name plausible_clickhouse altinity/clickhouse-server:21.12.3.32.altinitydev.arm + clickhouse-stop: docker stop plausible_clickhouse && docker rm plausible_clickhouse