-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1352 from input-output-hk/feat/web-socket-network…
…-info-provider LW-10739 Add web socket based network info provider
- Loading branch information
Showing
35 changed files
with
1,522 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,54 @@ name: K6 WebSocket server load tests | |
|
||
on: | ||
workflow_dispatch: | ||
branches: ['master', 'feat/web-socket-network-info-provider'] | ||
inputs: | ||
environment: | ||
description: 'Target environment' | ||
type: choice | ||
required: true | ||
options: | ||
- 'dev' | ||
- 'ops' | ||
- 'staging' | ||
- 'prod' | ||
network: | ||
description: 'Target network' | ||
type: choice | ||
required: true | ||
options: | ||
- 'preview' | ||
- 'preprod' | ||
- 'sanchonet' | ||
- 'mainnet' | ||
wallets: | ||
description: 'Number of wallets to simulate' | ||
type: number | ||
required: true | ||
default: 1000 | ||
|
||
jobs: | ||
web-socket: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Run k6 cloud test | ||
uses: grafana/[email protected] | ||
env: | ||
K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }} | ||
with: | ||
filename: ./packages/e2e/test/k6/scenarios/web-socket.test.js | ||
cloud: false | ||
token: ${{ secrets.K6_CLOUD_API_TOKEN }} | ||
flags: > | ||
-e TARGET_ENV=${{ inputs.environment }} | ||
-e TARGET_NET=${{ inputs.network }} | ||
-e WALLETS=${{ inputs.wallets }} | ||
--out json=web-socket-results.json | ||
--quiet | ||
- name: Upload performance test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: k6-report | ||
path: web-socket-results.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
nix/cardano-services/deployments/ws-server.deployment.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
lib, | ||
utils, | ||
values, | ||
chart, | ||
config, | ||
... | ||
}: { | ||
templates.ws-server-service = lib.mkIf values.ws-server.enabled { | ||
apiVersion = "v1"; | ||
kind = "Service"; | ||
metadata = { | ||
name = "${chart.name}-ws-server"; | ||
labels = utils.appLabels "ws-server"; | ||
}; | ||
spec = { | ||
ports = [ | ||
{ | ||
name = "http"; | ||
protocol = "TCP"; | ||
port = 3000; | ||
targetPort = 3000; | ||
} | ||
]; | ||
selector = utils.appLabels "ws-server"; | ||
}; | ||
}; | ||
|
||
templates.ws-server-deployment = lib.mkIf values.ws-server.enabled { | ||
apiVersion = "apps/v1"; | ||
kind = "Deployment"; | ||
metadata = { | ||
name = "${chart.name}-ws-server"; | ||
labels = utils.appLabels "ws-server"; | ||
}; | ||
spec = { | ||
selector.matchLabels = utils.appLabels "ws-server"; | ||
template = { | ||
metadata.labels = utils.appLabels "ws-server"; | ||
spec = { | ||
imagePullSecrets = [ | ||
{ | ||
name = "dockerconfigjson"; | ||
} | ||
]; | ||
containers = [ | ||
{ | ||
inherit (values.cardano-services) image; | ||
inherit (values.ws-server) resources; | ||
name = "ws-server"; | ||
ports = [ | ||
{ | ||
containerPort = 3000; | ||
name = "http"; | ||
} | ||
]; | ||
livenessProbe = { | ||
httpGet = { | ||
path = "/health"; | ||
port = 3000; | ||
}; | ||
}; | ||
securityContext = { | ||
runAsUser = 0; | ||
runAsGroup = 0; | ||
}; | ||
args = ["start-ws-server"]; | ||
env = utils.mkPodEnv ({ | ||
NETWORK = config.network; | ||
DB_CACHE_TTL = "7200"; | ||
OGMIOS_URL = "ws://${config.namespace}-cardano-core.${config.namespace}.svc.cluster.local:1337"; | ||
|
||
POSTGRES_POOL_MAX_DB_SYNC = "2"; | ||
POSTGRES_HOST_DB_SYNC = values.postgresName; | ||
POSTGRES_PORT_DB_SYNC = "5432"; | ||
POSTGRES_DB_DB_SYNC = "cardano"; | ||
POSTGRES_PASSWORD_DB_SYNC = { | ||
valueFrom.secretKeyRef = { | ||
name = "cardano-owner-user.${values.postgresName}.credentials.postgresql.acid.zalan.do"; | ||
key = "password"; | ||
}; | ||
}; | ||
POSTGRES_USER_DB_SYNC = { | ||
valueFrom.secretKeyRef = { | ||
name = "cardano-owner-user.${values.postgresName}.credentials.postgresql.acid.zalan.do"; | ||
key = "username"; | ||
}; | ||
}; | ||
POSTGRES_SSL_DB_SYNC = "true"; | ||
POSTGRES_SSL_CA_FILE_DB_SYNC = "/tls/ca.crt"; | ||
}); | ||
volumeMounts = [ | ||
{ | ||
mountPath = "/tls"; | ||
name = "tls"; | ||
} | ||
]; | ||
} | ||
]; | ||
volumes = [ | ||
{ | ||
name = "tls"; | ||
secret.secretName = "postgresql-server-cert"; | ||
} | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.