-
-
Couldn't load subscription status.
- Fork 399
fix: improve deployment to be more platform agnostic #1506
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
currently we have fly and aws very hardcoded so we need to reduce that by changing the way we setup realtime to be less locked to this ecosystems the first we are focusing on read replicas which is very hard coded to our infrastructure.
fc11195 to
9231dd8
Compare
| connect_partition_slots = Env.get_integer("CONNECT_PARTITION_SLOTS", System.schedulers_online() * 2) | ||
| metrics_cleaner_schedule_timer_in_ms = Env.get_integer("METRICS_CLEANER_SCHEDULE_TIMER_IN_MS", :timer.minutes(30)) | ||
| metrics_rpc_timeout_in_ms = Env.get_integer("METRICS_RPC_TIMEOUT_IN_MS", :timer.seconds(15)) | ||
| rebalance_check_interval_in_ms = Env.get_integer("REBALANCE_CHECK_INTERVAL_IN_MS", :timer.seconds(10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one should be :timer.minutes(10)
| connect_partition_slots = Env.get_integer("CONNECT_PARTITION_SLOTS", System.schedulers_online() * 2) | ||
| metrics_cleaner_schedule_timer_in_ms = Env.get_integer("METRICS_CLEANER_SCHEDULE_TIMER_IN_MS", :timer.minutes(30)) | ||
| metrics_rpc_timeout_in_ms = Env.get_integer("METRICS_RPC_TIMEOUT_IN_MS", :timer.seconds(15)) | ||
| rebalance_check_interval_in_ms = Env.get_integer("REBALANCE_CHECK_INTERVAL_IN_MS", :timer.seconds(10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rebalance_check_interval_in_ms = Env.get_integer("REBALANCE_CHECK_INTERVAL_IN_MS", :timer.seconds(10)) | |
| rebalance_check_interval_in_ms = Env.get_integer("REBALANCE_CHECK_INTERVAL_IN_MS", :timer.minutes(10)) |
| # 4 hours by default | ||
| janitor_schedule_timer = System.get_env("JANITOR_SCHEDULE_TIMER_IN_MS", "14400000") |> String.to_integer() | ||
| # defaults to 10 minutes | ||
| Env.get_integer("DISCONNECT_SOCKET_ON_NO_CHANNELS_INTERVAL_IN_MS", :timer.seconds(30)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this disconnect_socket_on_no_channels_interval_in_ms is being used at all. Should we just remove it?
| config :realtime, run_janitor: false | ||
| else | ||
| if config_env() != :test && run_janitor? do | ||
| config :realtime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where we are setting run_janitor: false when run_janitor? is false?
| url: [host: "#{app_name}.supabase.co", port: 443], | ||
| http: [ | ||
| compress: true, | ||
| port: Env.get_integer("PORT", 443), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port was 4000 before here
|
|
||
| config :realtime, RealtimeWeb.Endpoint, | ||
| server: true, | ||
| url: [host: "#{app_name}.supabase.co", port: 443], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was 80 here
| export DB_HOST_REPLICA_TARGET_REGIONS_us-east-1='us-east-1,us-east-2,us-east-3' | ||
| ``` | ||
|
|
||
| This will inform realtime that nodes connected to the `us-east-1` region will be able to connect to the replica database for the `us-east-1` region. If the region is not specified, the we will set the main repository as the default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how us-east-1 and us-east-2 etc are used in this example
If the region is not specified, the we will set the main repository as the default.
*then ?
| region_mapping(platform, tenant_region) | ||
| end | ||
|
|
||
| defp region_mapping(:aws, tenant_region) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be configured through the ENV vars as well? (Not in this PR but in the future?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it will be just wanted to make it in a different PR but it will be similar to the existing one 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments but other than that LGTM. Nice one making this more generic!
What kind of change does this PR introduce?
currently we have fly and aws very hardcoded so we need to reduce that by changing the way we setup realtime to be less locked to this ecosystems
the first we are focusing on read replicas which is very hard coded to our infrastructure.
for read replicas you can set:
which will setup the
us-east-1read replica and inform realtime that the regionsus-east-1,us-east-2,us-east-3should use this read replica. if not, they will use the default repo.