Skip to content
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

Splitting fly into fly.toml for staging and fly.prod.toml #242

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backend-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cd web-portal/backend && flyctl deploy -c fly.staging.toml --remote-only
- run: cd web-portal/backend && flyctl deploy -c fly.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/frontend-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cd web-portal/frontend && flyctl deploy -c fly.staging.toml --remote-only
- run: cd web-portal/frontend && flyctl deploy -c fly.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/proxy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cd gateway && flyctl deploy --remote-only
- run: cd gateway && flyctl deploy -c fly.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
9 changes: 4 additions & 5 deletions web-portal/backend/fly.staging.toml → docs/fly.prod.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# fly.toml app configuration file generated for porters-backend-staging on 2024-04-02T17:39:45-05:00
# fly.toml app configuration file generated for porters-docs-staging on 2024-04-04T19:24:52-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-backend-staging'
app = 'porters-docs'
primary_region = 'sea'

[build]
dockerfile = 'Dockerfile.fly'
build-target = 'production'

[http_service]
internal_port = 4000
force_https = true
internal_port = 3005
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
Expand Down
2 changes: 1 addition & 1 deletion docs/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-docs'
app = 'porters-docs-staging'
primary_region = 'sea'

[build]
Expand Down
36 changes: 36 additions & 0 deletions gateway/fly.prod.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# fly.toml app configuration file generated for porters-proxy-staging on 2024-04-03T20:23:41-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-proxy'
primary_region = 'sea'

[build]

[deploy]
strategy = 'canary'

[env]
HOST = 'rpc.porters.xyz'
### SECRETS ###
# DATABASE_URL = ...
# PROXY_TO = ...
# REDIS_URL = ...

[http_service]
internal_port = 9000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[[metrics]]
port = 9000
path = "/metrics"
4 changes: 4 additions & 0 deletions gateway/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ primary_region = 'sea'

[env]
HOST = 'g.staging.porters.xyz'
### SECRETS ###
# DATABASE_URL = ...
# PROXY_TO = ...
# REDIS_URL = ...

[http_service]
internal_port = 9000
Expand Down
7 changes: 7 additions & 0 deletions services/gatewaykit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ Find source code [here](https://github.com/pokt-network/gateway-server).

Run `fly postgres attach` to get environment variable to set as
`DB_CONNECTION_URL`

Secrets required to run this application:

`API_KEY`
`DB_CONNECTION_URL`
`POKT_APPLICATIONS_ENCRYPTION_KEY`
`POKT_RPC_FULL_HOST`
36 changes: 36 additions & 0 deletions services/gatewaykit/fly.prod.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# fly.toml app configuration file generated for porters-gatewaykit-staging on 2024-04-03T13:55:40-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-gatewaykit'
primary_region = 'sea'

[build]
image = 'ghcr.io/pokt-network/pocket-gateway-server:0.3.0-BETA'

[env]
ALTRUIST_REQUEST_TIMEOUT = '10s'
ENVIRONMENT_STAGE = 'production'
HTTP_SERVER_PORT = '8080'
POKT_RPC_TIMEOUT = '5s'
SESSION_CACHE_TTL = '75m'

[[services]]
internal_port = 8080
protocol = 'tcp'
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
[[services.ports]]
handlers = ["http"]
port = 8080
force_https = false
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[[metrics]]
port = 8080
path = "/metrics"
20 changes: 20 additions & 0 deletions services/redis/fly.prod.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
app = 'porters-redis'

[mounts]
destination = "/data"
source = "redis_data"

[metrics]
port = 9091
path = "/metrics"

# Use the Docker image instead of building from source

[[services]]
internal_port = 6379
protocol = "tcp"
[[services.ports]]
port = 6379
[[services.tcp_checks]]
interval = 10000
timeout = 2000
25 changes: 25 additions & 0 deletions web-portal/backend/fly.prod.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
app = 'porters-backend'
primary_region = 'sea'

[build]
dockerfile = 'Dockerfile.fly'

[env]
### SECRETS ###
# DATABASE_URL = ...
# ONEINCH_API_KEY = ...
# OX_API_KEY = ...
# RPC_KEY = ...

[http_service]
internal_port = 4000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
17 changes: 16 additions & 1 deletion web-portal/backend/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,27 @@
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-backend'
app = 'porters-backend-staging'
primary_region = 'sea'

[build]
dockerfile = 'Dockerfile.fly'

[env]
### SECRETS ###
# DATABASE_URL = ...
# ONEINCH_API_KEY = ...
# OX_API_KEY = ...
# RPC_KEY = ...

[http_service]
internal_port = 4000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-frontend-staging'
app = 'porters-frontend'
primary_region = 'sea'

[build]

[build.args]
API_ENDPOINT = 'https://porters-backend-staging.fly.dev/'
API_ENDPOINT = 'https://porters-backend.fly.dev'

[http_service]
internal_port = 3000
Expand All @@ -18,9 +20,10 @@ min_machines_running = 0
processes = ['app']

[env]
# NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID = 'wallet-connect-project-id'
# NEXT_PUBLIC_RPC_ENDPOINT = 'rpc-endpoint'
# NEXT_PUBLIC_APP_URL = 'https://staging.porters.xyz'
NEXT_PUBLIC_APP_URL = 'https://porters.xyz'
### SECRETS ###
# NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID = 'wallet-connect-project-id'
# NEXT_PUBLIC_RPC_ENDPOINT = 'rpc-endpoint'

[[vm]]
memory = '1gb'
Expand Down
13 changes: 6 additions & 7 deletions web-portal/frontend/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'porters-frontend'
app = 'porters-frontend-staging'
primary_region = 'sea'

[build]

[build.args]
NEXT_PUBLIC_API_ENDPOINT = 'https://porters-backend.fly.dev'
API_ENDPOINT = 'https://porters-backend-staging.fly.dev/'

[http_service]
internal_port = 3000
Expand All @@ -20,9 +18,10 @@ min_machines_running = 0
processes = ['app']

[env]
# NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID = 'wallet-connect-project-id'
# NEXT_PUBLIC_RPC_ENDPOINT = 'rpc-endpoint'
# NEXT_PUBLIC_APP_URL = 'https://porters.xyz'
NEXT_PUBLIC_APP_URL = 'https://staging.porters.xyz'
### SECRETS ###
# NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID = 'wallet-connect-project-id'
# NEXT_PUBLIC_RPC_ENDPOINT = 'rpc-endpoint'

[[vm]]
memory = '1gb'
Expand Down
Loading