diff --git a/build-scripts/monitoring/open_ports.sh b/build-scripts/monitoring/open_ports.sh deleted file mode 100755 index 47241c88d7c..00000000000 --- a/build-scripts/monitoring/open_ports.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - - -set -u - -# options -PORT_RANGES=${PORT_RANGES:-"8000:8100 9000:9100 20000:20100 6865:6866"} -SHOULD_FAIL_BUILD=${SHOULD_FAIL_BUILD:-true} -SHOULD_KILL_PROCESSES=${SHOULD_KILL_PROCESSES:-false} - -# internal global variables -PROCESS_DETECTED=false - -function scan_ports() -{ - local port_range=$1 - local start_port=${port_range%%:*} - local end_port=${port_range##*:} - local sleep_before_reporting_process=10 - - echo -e "\nStarting scanning port range $start_port:$end_port ... \n" - - for port in $(seq $start_port $end_port); do - pid=$(lsof -stcp:LISTEN -t -i :$port) - if [[ $? -eq 0 ]]; then - echo "process $pid detected on port $port, waiting for $sleep_before_reporting_process seconds ... " - sleep $sleep_before_reporting_process - pid=$(lsof -stcp:LISTEN -t -i :$port) - if [[ $? -eq 0 ]]; then - echo "process $pid still running and will be reported ..." - PROCESS_DETECTED=true - ps -wwfp $pid - if [[ $SHOULD_KILL_PROCESSES == true ]]; then - echo -e "\nKilling process $pid\n" - kill -9 $pid - pid=$(lsof -stcp:LISTEN -t -i :$port) - if [[ $? -eq 0 ]]; then - echo -e "\nCouldnt kill the process $pid with kill -9 \n" - else - echo -e "\n Able to force kill process $pid with kill -9 \n" - PROCESS_DETECTED=false - fi - fi - fi - fi - done -} - -### MAIN - -echo " -Checking for open ports (tcp:LISTENING) - -This is useful to invoke as a diagnostic tool before running -processes expecting fixed ports to be available. - -Using the following options: - -- PORT_RANGES=${PORT_RANGES} -- SHOULD_FAIL_BUILD=${SHOULD_FAIL_BUILD} -- SHOULD_KILL_PROCESSES=${SHOULD_KILL_PROCESSES} - -You can override the values by using environment variables. - -You can specify multiple port ranges, separated by space ' ' -e.g. PORT_RANGES=\"8000:8100 8200:8300\" -" - -for port_range in $PORT_RANGES; do - scan_ports $port_range -done - -if [[ $PROCESS_DETECTED == true ]]; then - if [[ $SHOULD_FAIL_BUILD == true ]]; then - echo -e "\n\nWill fail build as hanging processes have been detected" - exit 1 - fi -else - echo -e "\n\nNo processes have been detected on $PORT_RANGES port range" -fi - -exit 0 diff --git a/dev-env/bin/dade-collect-garbage b/dev-env/bin/dade-collect-garbage index ec03e62b8e7..30c37dabf61 100755 --- a/dev-env/bin/dade-collect-garbage +++ b/dev-env/bin/dade-collect-garbage @@ -1,5 +1,4 @@ #!/usr/bin/env bash DADE_CURRENT_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "$DADE_CURRENT_SCRIPT_DIR/../lib/dade-common" -buildTool lsof out 0 nix-store --gc diff --git a/dev-env/bin/jq b/dev-env/bin/jq index 943ba2d88c9..bd1b1819b20 120000 --- a/dev-env/bin/jq +++ b/dev-env/bin/jq @@ -1 +1 @@ -../lib/dade-exec-nix-tool \ No newline at end of file +../lib/dade-exec-nix-bin-tool \ No newline at end of file diff --git a/dev-env/bin/nix-prefetch-git-hydra b/dev-env/bin/nix-prefetch-git-hydra deleted file mode 100755 index 78b8fd03034..00000000000 --- a/dev-env/bin/nix-prefetch-git-hydra +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -# Perform git checkout like hydra does -export NIX_PREFETCH_GIT_CHECKOUT_HOOK="find \"\$dir\" -type f -name .gitignore -exec rm {} \;" -nix-prefetch-git "$@" diff --git a/ledger/scripts/test/sandbox-startup.sh b/ledger/scripts/test/sandbox-startup.sh deleted file mode 100755 index 0a55758862a..00000000000 --- a/ledger/scripts/test/sandbox-startup.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -euxo pipefail - -#Run this from the ledger dir - -PATH="${PATH}:/usr/sbin" #lsof is not on the PATH by default - -WORKING_DIR=$(pwd) -PORT=6865 - -function get_pid_listening_on_port () { - echo $(lsof -i:${PORT} -t) -} - -function cleanup() { - PID=$(get_pid_listening_on_port) || "" #Handling error from lsof if there is no such process - if [ -z ${PID} ] - then - exit 0 - else - kill ${PID} - fi -} -trap cleanup EXIT - -function wait_for_unbind () { - while nc -z 127.0.0.1 $1; do - sleep 0.1 - done -} - -function wait_for_bind () { - while ! nc -z 127.0.0.1 $1; do - sleep 0.1 - done -} - -function getTime () { - TIME_NANOS=$(date +%s%N | sed -E "s/^([0-9]+)N$/\1000000000/g") - echo $((${TIME_NANOS}/1000000)) -} - -function run_startup_benchmark () { - JAR_FILE=$1 - PORT=$2 - START=$(getTime) - java -jar ${JAR_FILE} -p ${PORT} --dalf bond-trading.dalf > "sandbox_output.txt" & - PID=$! - wait_for_bind ${PORT} - END=$(getTime) - kill ${PID} - wait_for_unbind ${PORT} - let "DIFF = ${END} - ${START}" - echo ${DIFF} -} - -#Run this from the ledger dir -find sandbox -name "sandbox*.tgz" -exec tar -zxf {} +; -TAR_DIR=$(find . -type d -name "sandbox-*-*") -DAMLI_JAR_FILE=$(find ${TAR_DIR} -name "damli-*-*.jar" -maxdepth 2) -java -jar ${DAMLI_JAR_FILE} export-lf-v1 "../reference-apps/bond-trading/daml/LibraryModules.daml" -o "${TAR_DIR}/bond-trading.dalf" -pushd ${TAR_DIR} -JAR_FILE=$(find . -name "sandbox-*-*.jar" -maxdepth 1) -RESULT_FILE_NAME="StartupBenchmark.xml" -RESULT_FILE="${WORKING_DIR}/${RESULT_FILE_NAME}" -echo "" > ${RESULT_FILE} -echo "" >> ${RESULT_FILE} -for i in {1..5} -do - RESULT_MS=$(run_startup_benchmark "${JAR_FILE}" "${PORT}") - TIME_MS=$(getTime) - echo "" >> ${RESULT_FILE} -done -popd -echo "" >> ${RESULT_FILE} -rm -rf ${TAR_DIR} -TARGET_DIR="sandbox-perf/target/benchmarks/jmeter" -mkdir -p ${TARGET_DIR} -mv ${RESULT_FILE} ${TARGET_DIR} -cat "${TARGET_DIR}/${RESULT_FILE_NAME}" - diff --git a/navigator/integration-test/test-local-navigator.sh b/navigator/integration-test/test-local-navigator.sh deleted file mode 100755 index 7a0788f6a76..00000000000 --- a/navigator/integration-test/test-local-navigator.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -u - -exp_num_of_params=2 -if [ "$#" -ne $exp_num_of_params ]; then - echo "[ERROR] Illegal number of arguments. (Expected $exp_num_of_params, got $#)" - echo "[HELP] $0 browserstack_user browserstack_password" - exit 1 -fi - -# browserstack user -readonly BROWSERSTACK_CREDENTIALS_USR=$1 - -# browserstack password -readonly BROWSERSTACK_CREDENTIALS_PSW=$2 - -lsof -n -i :4000 | grep LISTEN | awk '{print $2}' | xargs kill -9 -lsof -n -i :7500 | grep LISTEN | awk '{print $2}' | xargs kill -9 -lsof -n -i :8081 | grep LISTEN | awk '{print $2}' | xargs kill -9 - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -pushd $DIR - - -BSUSER="--browserstack-user ${BROWSERSTACK_CREDENTIALS_USR}" -BSKEY="--browserstack-key ${BROWSERSTACK_CREDENTIALS_PSW}" - -DAML_PATH="--daml-path $DIR/src/main/resources/Main.daml" -NAV_CONF_PATH="--nav-conf-path $DIR/src/main/resources/ui-backend.conf" -PARENTDIR="$(dirname "$DIR")" -NAVIGATOR_DIR="--navigator-dir $PARENTDIR" - - -PARAMS="$DAML_PATH $NAV_CONF_PATH $NAVIGATOR_DIR $BSUSER $BSKEY" - - -TEST_COMMAND='sbt "run '${PARAMS}'"' - -echo ${TEST_COMMAND} - -echo "Running the integration tests" -eval "${TEST_COMMAND}" -SUCCESS=$(echo $?) -echo "Test run finished" -echo "Cleaning up the applications" - -lsof -n -i :4000 | grep LISTEN | awk '{print $2}' | xargs kill -9 -lsof -n -i :7500 | grep LISTEN | awk '{print $2}' | xargs kill -9 -lsof -n -i :8081 | grep LISTEN | awk '{print $2}' | xargs kill -9 - -echo "Cleanup done" -popd - -exit ${SUCCESS} diff --git a/nix/packages.nix b/nix/packages.nix index f2144e0da9d..e1c9638eee5 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -254,8 +254,6 @@ in rec { undmg = pkgs.undmg; jfrog = pkgs.callPackage ./tools/jfrog-cli {}; - nix-prefetch-git = pkgs.nix-prefetch-git; - # Cloud tools gcloud = pkgs.google-cloud-sdk; bq = gcloud;