timgremore commited on
Commit
350733c
1 Parent(s): c77c303

chore: Move to Supabase and update toml

Browse files
Files changed (3) hide show
  1. config/runtime.exs +3 -11
  2. fly.toml +21 -24
  3. rel/env.sh.eex +1 -1
config/runtime.exs CHANGED
@@ -28,22 +28,14 @@ if config_env() == :prod do
28
  For example: ecto://USER:PASS@HOST/DATABASE
29
  """
30
 
31
- # maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
32
 
33
  # Previously, this has `socket_options: maybe_ipv6`, but removing that appeared to help connect to the DB.
34
  config :medicode, Medicode.Repo,
35
- ssl: true,
36
  url: database_url,
37
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
38
- socket_options: [],
39
- ssl_opts: [
40
- cacertfile: "/etc/ssl/certs/ca-certificates.crt",
41
- verify: :verify_peer,
42
- server_name_indication: to_charlist(System.get_env("DATABASE_HOST")),
43
- customize_hostname_check: [
44
- match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
45
- ]
46
- ]
47
 
48
  # The secret key base is used to sign/encrypt cookies and other secrets.
49
  # A default value is used in config/dev.exs and config/test.exs but you
 
28
  For example: ecto://USER:PASS@HOST/DATABASE
29
  """
30
 
31
+ maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
32
 
33
  # Previously, this has `socket_options: maybe_ipv6`, but removing that appeared to help connect to the DB.
34
  config :medicode, Medicode.Repo,
35
+ # ssl: false,
36
  url: database_url,
37
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
38
+ socket_options: maybe_ipv6
 
 
 
 
 
 
 
 
39
 
40
  # The secret key base is used to sign/encrypt cookies and other secrets.
41
  # A default value is used in config/dev.exs and config/test.exs but you
fly.toml CHANGED
@@ -16,39 +16,36 @@ kill_signal = "SIGTERM"
16
  [build]
17
 
18
  [deploy]
19
- release_command = "/app/bin/migrate"
20
-
21
- [[mounts]]
22
- source = "data"
23
- destination = "/data"
24
- initial_size = "40gb"
25
 
26
  [env]
27
- ELIXIR_ERL_OPTIONS = "-proto_dist inet6_tcp +sssdio 128"
28
- AUDIO_TAGGER_CACHE_DIR="/data/cache/audio_tagger"
29
- BUMBLEBEE_CACHE_DIR="/data/cache/bumblebee"
30
- XLA_CACHE_DIR="/data/cache/xla"
31
- # XLA_TARGET="cuda120"
32
- PHX_HOST = "medical-transcription-cpu.fly.dev"
33
- PORT = "8080"
34
- RELEASE_COOKIE = "0gfxcPtwryKxI2O1N0eFAg9p4MJGC-oUGShgj_wgvNEGiba5EDEJFA=="
 
 
 
 
35
 
36
  [http_service]
37
  internal_port = 8080
38
  force_https = true
39
- auto_stop_machines = false
40
- auto_start_machines = false
41
  min_machines_running = 0
42
- processes = ["app"]
 
43
  [http_service.concurrency]
44
- type = "connections"
45
  hard_limit = 1000
46
  soft_limit = 1000
47
 
48
  [[vm]]
49
- cpu_kind = "shared"
50
- cpus = 1
51
- memory_mb = 2048
52
-
53
- # To generate the vector embeddings for the ICD-9 codelist, we need more RAM available.
54
- # fly scale vm shared-cpu-8x --memory 16384
 
16
  [build]
17
 
18
  [deploy]
19
+ release_command = '/app/bin/migrate'
 
 
 
 
 
20
 
21
  [env]
22
+ AUDIO_TAGGER_CACHE_DIR = '/data/cache/audio_tagger'
23
+ BUMBLEBEE_CACHE_DIR = '/data/cache/bumblebee'
24
+ # ELIXIR_ERL_OPTIONS = '-proto_dist inet6_tcp'
25
+ PHX_HOST = 'medical-transcription-cpu.fly.dev'
26
+ PORT = '8080'
27
+ RELEASE_COOKIE = '0gfxcPtwryKxI2O1N0eFAg9p4MJGC-oUGShgj_wgvNEGiba5EDEJFA=='
28
+ XLA_CACHE_DIR = '/data/cache/xla'
29
+
30
+ [[mounts]]
31
+ source = 'data'
32
+ destination = '/data'
33
+ initial_size = '40gb'
34
 
35
  [http_service]
36
  internal_port = 8080
37
  force_https = true
38
+ auto_stop_machines = true
39
+ auto_start_machines = true
40
  min_machines_running = 0
41
+ processes = ['app']
42
+
43
  [http_service.concurrency]
44
+ type = 'connections'
45
  hard_limit = 1000
46
  soft_limit = 1000
47
 
48
  [[vm]]
49
+ memory = '4gb'
50
+ cpu_kind = 'shared'
51
+ cpus = 2
 
 
 
rel/env.sh.eex CHANGED
@@ -6,7 +6,7 @@
6
  # Livebook. See this forum post: https://community.fly.io/t/cant-connect-to-node/17800
7
  # export ERL_AFLAGS="-proto_dist inet6_tcp"
8
  export ELIXIR_ERL_OPTIONS="-proto_dist inet6_tcp"
9
- export ECTO_IPV6="true"
10
  export DNS_CLUSTER_QUERY="${FLY_APP_NAME}.internal"
11
  export RELEASE_DISTRIBUTION="name"
12
 
 
6
  # Livebook. See this forum post: https://community.fly.io/t/cant-connect-to-node/17800
7
  # export ERL_AFLAGS="-proto_dist inet6_tcp"
8
  export ELIXIR_ERL_OPTIONS="-proto_dist inet6_tcp"
9
+ # export ECTO_IPV6="false"
10
  export DNS_CLUSTER_QUERY="${FLY_APP_NAME}.internal"
11
  export RELEASE_DISTRIBUTION="name"
12