-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ol-facets/PR1-feed-new-tables
- Loading branch information
Showing
27 changed files
with
528 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2018-2023 contributors to the Marquez project | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# A script used in CI to load test HTTP API server by: | ||
# (1) Starting HTTP API server | ||
# (2) Generating random dataset, job, and run metadata | ||
# (3) Running load test using k6 | ||
# (4) Writing load test results to 'k6/results' for analysis | ||
# | ||
# Usage: $ ./api-load-test.sh | ||
|
||
set -e | ||
|
||
# Build version of Marquez | ||
readonly MARQUEZ_VERSION="0.30.0-SNAPSHOT" | ||
# Fully qualified path to marquez.jar | ||
readonly MARQUEZ_JAR="api/build/libs/marquez-api-${MARQUEZ_VERSION}.jar" | ||
|
||
readonly MARQUEZ_HOST="localhost" | ||
readonly MARQUEZ_ADMIN_PORT=5001 # Use default 'dev' admin port | ||
readonly MARQUEZ_URL="http://${MARQUEZ_HOST}:${MARQUEZ_ADMIN_PORT}" | ||
readonly MARQUEZ_DB="marquez-db" | ||
|
||
readonly METADATA_FILE="api/load-testing/metadata.json" | ||
readonly METADATA_STATS_QUERY=$(cat <<-END | ||
SELECT run_uuid,COUNT(*) | ||
FROM lineage_events | ||
GROUP BY run_uuid; | ||
END | ||
) | ||
|
||
log() { | ||
echo -e "\033[1m>>\033[0m ${1}" | ||
} | ||
|
||
cpu_and_mem_info() { | ||
log "CPU info:" | ||
cat /proc/cpuinfo | ||
log "MEM info:" | ||
cat /proc/meminfo | ||
} | ||
|
||
ol_events_stats() { | ||
# Query db for OL events stats | ||
log "load test metadata stats:" | ||
docker exec "${MARQUEZ_DB}" \ | ||
psql -U marquez -c "${METADATA_STATS_QUERY}" | ||
} | ||
|
||
# Change working directory to project root | ||
project_root=$(git rev-parse --show-toplevel) | ||
cd "${project_root}" | ||
|
||
# (1) Start db | ||
log "start db:" | ||
docker-compose -f docker-compose.db.yml up --detach | ||
|
||
# (2) Build HTTP API server | ||
log "build http API server..." | ||
./gradlew --no-daemon :api:build -x test > /dev/null 2>&1 | ||
|
||
# (3) Start HTTP API server | ||
log "start http API server..." | ||
mkdir marquez && \ | ||
java -jar "${MARQUEZ_JAR}" server marquez.dev.yml > marquez/http.log 2>&1 & | ||
|
||
# (4) Wait for HTTP API server | ||
log "waiting for http API server (${MARQUEZ_URL})..." | ||
until curl --output /dev/null --silent --head --fail "${MARQUEZ_URL}/ping"; do | ||
sleep 5 | ||
done | ||
# When available, print status | ||
log "http API server is ready!" | ||
|
||
# (5) Use metadata command to generate random dataset, job, and run metadata | ||
log "generate load test metadata (${METADATA_FILE}):" | ||
java -jar "${MARQUEZ_JAR}" metadata --runs 10 --bytes-per-event 16384 --output "${METADATA_FILE}" | ||
|
||
# Display CPU/MEM | ||
cpu_and_mem_info | ||
|
||
# (6) Run load test | ||
log "start load test:" | ||
mkdir -p k6/results && \ | ||
k6 run --vus 25 --duration 30s api/load-testing/http.js \ | ||
--out json=k6/results/full.json --summary-export=k6/results/summary.json | ||
|
||
# Display OL event stats | ||
ol_events_stats | ||
|
||
echo "DONE!" |
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ only-on-release: &only-on-release | |
ignore: /.*/ | ||
|
||
orbs: | ||
# https://circleci.com/orbs/registry/orb/codecov/codecov | ||
codecov: codecov/[email protected] | ||
|
||
jobs: | ||
|
@@ -148,6 +147,21 @@ jobs: | |
- run: npm install --prefix=${HOME}/.local --global redoc-cli | ||
- run: redoc-cli bundle spec/openapi.yml | ||
|
||
load-test-api: | ||
working_directory: ~/marquez | ||
machine: | ||
image: ubuntu-2004:current | ||
steps: | ||
- checkout | ||
- run: ./.circleci/get-docker-compose.sh | ||
- run: ./.circleci/get-jdk17.sh | ||
- run: ./.circleci/get-k6.sh | ||
- run: ./.circleci/api-load-test.sh | ||
- store_artifacts: | ||
path: marquez | ||
- store_artifacts: | ||
path: k6 | ||
|
||
migrate-db: | ||
working_directory: ~/marquez | ||
machine: | ||
|
@@ -204,6 +218,9 @@ workflows: | |
- unit-test-web | ||
- unit-test-client-python | ||
- lint-spec-api | ||
- load-test-api: | ||
requires: | ||
- build-api | ||
- migrate-db: | ||
requires: | ||
- build-api | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2018-2023 contributors to the Marquez project | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Usage: $ ./get-k6.sh | ||
|
||
set -e | ||
|
||
# Delete existing key (if present) | ||
sudo apt-key del k6 | ||
|
||
# Add k6 key and update the repository | ||
sudo gpg -k && \ | ||
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 | ||
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list | ||
|
||
# Install k6, then verify | ||
sudo snap install k6 && k6 version | ||
|
||
echo "DONE!" |
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,27 @@ | ||
import { SharedArray } from 'k6/data'; | ||
import http from 'k6/http'; | ||
import { check, sleep } from 'k6'; | ||
import { Rate } from 'k6/metrics'; | ||
|
||
export const errorRate = new Rate('errors'); | ||
|
||
const metadata = new SharedArray('metadata', function () { | ||
return JSON.parse(open('./metadata.json')); | ||
}); | ||
|
||
export default function () { | ||
const url = 'http://localhost:5000/api/v1/lineage'; | ||
const params = { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}; | ||
|
||
var ol_event = metadata[__VU-1] | ||
|
||
check(http.post(url, JSON.stringify(ol_event), params), { | ||
'status is 201': (r) => r.status == 201, | ||
}) || errorRate.add(1); | ||
|
||
sleep(1); | ||
} |
File renamed without changes
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
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
62 changes: 37 additions & 25 deletions
62
web/src/__tests__/components/__snapshots__/Dialog.test.tsx.snap
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 |
---|---|---|
@@ -1,29 +1,41 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Dialog Component renders a snapshot that matches previous 1`] = ` | ||
<div> | ||
<WithStyles(ForwardRef(Dialog)) | ||
open={true} | ||
> | ||
<WithStyles(ForwardRef(DialogTitle)) /> | ||
<WithStyles(ForwardRef(DialogContent))> | ||
<WithStyles(ForwardRef(DialogContentText)) /> | ||
</WithStyles(ForwardRef(DialogContent))> | ||
<WithStyles(ForwardRef(DialogActions))> | ||
<WithStyles(ForwardRef(Button)) | ||
className="dialogButton" | ||
color="secondary" | ||
> | ||
Continue | ||
</WithStyles(ForwardRef(Button))> | ||
<WithStyles(ForwardRef(Button)) | ||
className="dialogButton" | ||
color="primary" | ||
onClick={[Function]} | ||
> | ||
Cancel | ||
</WithStyles(ForwardRef(Button))> | ||
</WithStyles(ForwardRef(DialogActions))> | ||
</WithStyles(ForwardRef(Dialog))> | ||
</div> | ||
<WithStyles(ForwardRef(Dialog)) | ||
open={true} | ||
> | ||
<WithStyles(ForwardRef(DialogTitle)) /> | ||
<WithStyles(ForwardRef(DialogContent))> | ||
<WithStyles(ForwardRef(DialogContentText))> | ||
Description of dialog... | ||
</WithStyles(ForwardRef(DialogContentText))> | ||
</WithStyles(ForwardRef(DialogContent))> | ||
<WithStyles(ForwardRef(DialogContent))> | ||
<WithStyles(ForwardRef(DialogContentText))> | ||
Description of dialog... | ||
</WithStyles(ForwardRef(DialogContentText))> | ||
</WithStyles(ForwardRef(DialogContent))> | ||
<WithStyles(ForwardRef(DialogActions))> | ||
<WithStyles(ForwardRef(Button)) | ||
className="dialogButton" | ||
color="primary" | ||
onClick={[Function]} | ||
style={ | ||
Object { | ||
"backgroundColor": "#ee7b7b", | ||
"color": "#fff", | ||
} | ||
} | ||
> | ||
Cancel | ||
</WithStyles(ForwardRef(Button))> | ||
<WithStyles(ForwardRef(Button)) | ||
className="dialogButton" | ||
color="primary" | ||
variant="outlined" | ||
> | ||
Continue | ||
</WithStyles(ForwardRef(Button))> | ||
</WithStyles(ForwardRef(DialogActions))> | ||
</WithStyles(ForwardRef(Dialog))> | ||
`; |
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
Oops, something went wrong.