From 1eb068184392e7ffb635013b9a92ac83642003c6 Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Sat, 27 Jan 2024 10:32:19 -0500 Subject: [PATCH] refactor: move inventory-grpc-probe to akash-api repo Signed-off-by: Artur Troian --- .github/workflows/integration-tests.yaml | 9 +-- script/inventory-grpc-probe.sh | 95 ------------------------ 2 files changed, 3 insertions(+), 101 deletions(-) delete mode 100755 script/inventory-grpc-probe.sh diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 43294a0d..62e644f0 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -60,13 +60,10 @@ jobs: cd ${{ env.GOPATH }}/src/github.com/akash-network/akash-api cat "$GITHUB_ENV" > "$GITHUB_WORKSPACE/env.backup" direnv export gha >> "$GITHUB_ENV" - - name: Add akash-api to go.work + - name: Run modvendor on akash-api working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/akash-api run: | make modvendor - printf "use (\n\t.\n)\n" > ../provider/go.work - printf "\ngo ${{ env.GOVERSION }}\n" >> ../provider/go.work - printf "\nreplace (\n\tgithub.com/akash-network/akash-api => ../akash-api\n)\n" >> ../provider/go.work cat "$GITHUB_WORKSPACE/env.backup" > "$GITHUB_ENV" - name: Setup direnv for provider run: direnv export gha >> "$GITHUB_ENV" @@ -121,8 +118,8 @@ jobs: __pod=$(kubectl -n akash-services get pods -l app.kubernetes.io/part-of=provider -l app.kubernetes.io/component=operator -l app.kubernetes.io/instance=inventory-node --no-headers -o custom-columns=":metadata.name") kubectl -n akash-services port-forward --address 0.0.0.0 pod/$__pod 8444:grpc & kubectl -n akash-services port-forward --address 0.0.0.0 service/operator-inventory 8445:grpc & - ./script/inventory-grpc-probe.sh --host=localhost:8444 --mode=plaintext akash.inventory.v1.NodeRPC/QueryNode - ./script/inventory-grpc-probe.sh --host=localhost:8445 --mode=plaintext akash.inventory.v1.ClusterRPC/QueryCluster + ${{ env.GOPATH }}/src/github.com/akash-network/akash-api/script/grpc-probe.sh --host=localhost:8444 --mode=plaintext akash.inventory.v1.NodeRPC/QueryNode + ${{ env.GOPATH }}/src/github.com/akash-network/akash-api/script/grpc-probe.sh --host=localhost:8445 --mode=plaintext akash.inventory.v1.ClusterRPC/QueryCluster kubectl -n akash-services logs service/operator-inventory - name: Run E2E Tests working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider diff --git a/script/inventory-grpc-probe.sh b/script/inventory-grpc-probe.sh deleted file mode 100755 index 6b207335..00000000 --- a/script/inventory-grpc-probe.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env bash - -akash_api=$(go list -mod=readonly -m -f '{{ .Dir }}' github.com/akash-network/akash-api) - -if [ ! -d "${akash_api}/vendor" ]; then - echo "for script to work akash-api must be checkout locally and replace in go.work" - exit 1 -fi - -short_opts=h -long_opts=help/host:/mode: # those who take an arg END with : - -host=localhost:8081 -mode= - -while getopts ":$short_opts-:" o; do - case $o in - :) - echo >&2 "option -$OPTARG needs an argument" - continue - ;; - '?') - echo >&2 "bad option -$OPTARG" - continue - ;; - -) - o=${OPTARG%%=*} - OPTARG=${OPTARG#"$o"} - lo=/$long_opts/ - case $lo in - *"/$o"[!/:]*"/$o"[!/:]*) - echo >&2 "ambiguous option --$o" - continue - ;; - *"/$o"[:/]*) - ;; - *) - o=$o${lo#*"/$o"}; - o=${o%%[/:]*} - ;; - esac - - case $lo in - *"/$o/"*) - OPTARG= - ;; - *"/$o:/"*) - case $OPTARG in - '='*) - OPTARG=${OPTARG#=} - ;; - *) - eval "OPTARG=\$$OPTIND" - if [ "$OPTIND" -le "$#" ] && [ "$OPTARG" != -- ]; then - OPTIND=$((OPTIND + 1)) - else - echo >&2 "option --$o needs an argument" - continue - fi - ;; - esac - ;; - *) echo >&2 "unknown option --$o"; continue;; - esac - esac - case "$o" in - host) - host=$OPTARG - ;; - mode) - case "$OPTARG" in - plaintext|insecure) - ;; - *) - echo >&2 "option --$o can be plaintext|insecure" - ;; - esac - - mode=-$OPTARG - ;; - esac -done -shift "$((OPTIND - 1))" - -grpcurl \ - "$mode" \ - -use-reflection \ - -proto="${akash_api}/proto/provider/akash/inventory/v1/service.proto" \ - -proto="${akash_api}/proto/provider/akash/provider/v1/service.proto" \ - -import-path="${akash_api}/proto/provider" \ - -import-path="${akash_api}/proto/node" \ - -import-path="${akash_api}/vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ - -import-path="${akash_api}/vendor" \ - "$host" \ - "$@"