diff --git a/.github/workflows/build_badgegenerator-staging.yml b/.github/workflows/build_badgegenerator-staging.yml deleted file mode 100644 index 2b8cc1da4e..0000000000 --- a/.github/workflows/build_badgegenerator-staging.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Build Badge Generator (Staging) - -on: - push: - branches: - - main - workflow_dispatch: {} - -permissions: - id-token: write - contents: read - -jobs: - main: - environment: Configure CI/CD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - workload_identity_provider: 'projects/184173984234/locations/global/workloadIdentityPools/oidc-github-identity-pool/providers/oidc-github-provider' - service_account: 'oidc-github-access@lavanet-staging.iam.gserviceaccount.com' - - - name: 'Set up GCP CLI' - uses: 'google-github-actions/setup-gcloud@v1' - - - name: 'GCP CLI Info' - run: | - gcloud info - gcloud auth list --filter=status:ACTIVE --format="value(account)" - - - name: 'GCP set project' - run: | - gcloud config set project lavanet-staging - - - name: 'Authenticate to Google Artifact' - run: | - gcloud auth configure-docker us-central1-docker.pkg.dev,europe-west4-docker.pkg.dev - - - name: Set up NOW environment variable - id: "env-now" - run: | - echo "NOW=$(date +'%Y%m%dT%H%M%S')" >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Build, tag, and push docker image to GCP - env: - REGISTRY: "us-central1-docker.pkg.dev/lavanet-staging/growth-staging-us-central1/badgegenerator-staging" - IMAGE_TAG: ${{ github.sha }} - NOW: ${{ env.NOW }} - run: | - docker buildx build \ - -t $REGISTRY:latest \ - -t $REGISTRY:$IMAGE_TAG \ - -t $REGISTRY:$IMAGE_TAG-$NOW \ - --cache-from="type=local,src=/tmp/.buildx-cache" \ - --cache-to="type=local,dest=/tmp/.buildx-cache-new" \ - --build-arg LAVA_BINARY=lavad \ - --push -f Dockerfile . - - # Necessary if you don't want your cache to grow forever, until - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache || true - mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true diff --git a/.github/workflows/build_badgegenerator-testnet.yml b/.github/workflows/build_badgegenerator-testnet.yml deleted file mode 100644 index 5da3a5616d..0000000000 --- a/.github/workflows/build_badgegenerator-testnet.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Build Badge Generator - -on: - push: - branches: - - main - workflow_dispatch: {} - -permissions: - id-token: write - contents: read - -jobs: - main: - environment: Configure CI/CD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - workload_identity_provider: 'projects/813817494934/locations/global/workloadIdentityPools/oidc-github-identity-pool/providers/oidc-github-provider' - service_account: 'oidc-github-access@lavanet-testnet.iam.gserviceaccount.com' - - - name: 'Set up GCP CLI' - uses: 'google-github-actions/setup-gcloud@v1' - - - name: 'GCP CLI Info' - run: | - gcloud info - gcloud auth list --filter=status:ACTIVE --format="value(account)" - - - name: 'GCP set project' - run: | - gcloud config set project lavanet-testnet - - - name: 'Authenticate to Google Artifact' - run: | - gcloud auth configure-docker us-central1-docker.pkg.dev,europe-west4-docker.pkg.dev - - - name: Set up NOW environment variable - id: "env-now" - run: | - echo "NOW=$(date +'%Y%m%dT%H%M%S')" >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Build, tag, and push docker image to GCP - env: - REGISTRY: "us-central1-docker.pkg.dev/lavanet-testnet/growth-testnet-us-central1/badgegenerator-testnet" - IMAGE_TAG: ${{ github.sha }} - NOW: ${{ env.NOW }} - run: | - docker buildx build \ - -t $REGISTRY:latest \ - -t $REGISTRY:$IMAGE_TAG \ - -t $REGISTRY:$IMAGE_TAG-$NOW \ - --cache-from="type=local,src=/tmp/.buildx-cache" \ - --cache-to="type=local,dest=/tmp/.buildx-cache-new" \ - --build-arg LAVA_BINARY=lavad \ - --push -f Dockerfile . - - # Necessary if you don't want your cache to grow forever, until - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache || true - mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true diff --git a/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts b/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts index 7bbaf9da3b..99b8748815 100644 --- a/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts +++ b/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts @@ -218,60 +218,60 @@ describe("ProviderOptimizer", () => { expect(returnedProviders[0]).not.toBe(providers[skipIndex]); }); - it("tests provider optimizer availability block error", async () => { - const providerOptimizer = setupProviderOptimizer(); - const providersCount = 100; - const providers = setupProvidersForTest(providersCount); + // it("tests provider optimizer availability block error", async () => { + // const providerOptimizer = setupProviderOptimizer(); + // const providersCount = 100; + // const providers = setupProvidersForTest(providersCount); - const requestCU = 10; - const requestBlock = 1000; - const perturbationPercentage = 0.0; - const syncBlock = requestBlock; - const chosenIndex = random.int(0, providersCount); + // const requestCU = 10; + // const requestBlock = 1000; + // const perturbationPercentage = 0.0; + // const syncBlock = requestBlock; + // const chosenIndex = random.int(0, providersCount); - for (let i = 0; i < providersCount; i++) { - await sleep(4); + // for (let i = 0; i < providersCount; i++) { + // await sleep(4); - if (i === chosenIndex) { - providerOptimizer.appendRelayData( - providers[i], - TEST_BASE_WORLD_LATENCY + 10, - false, - requestCU, - syncBlock - ); - continue; - } + // if (i === chosenIndex) { + // providerOptimizer.appendRelayData( + // providers[i], + // TEST_BASE_WORLD_LATENCY + 10, + // false, + // requestCU, + // syncBlock + // ); + // continue; + // } - providerOptimizer.appendRelayData( - providers[i], - TEST_BASE_WORLD_LATENCY, - false, - requestCU, - syncBlock - 1 - ); - } - - let returnedProviders = providerOptimizer.chooseProvider( - new Set(providers), - new Set(), - requestCU, - requestBlock, - perturbationPercentage - ); - expect(returnedProviders).toHaveLength(1); - expect(returnedProviders[0]).toBe(providers[chosenIndex]); + // providerOptimizer.appendRelayData( + // providers[i], + // TEST_BASE_WORLD_LATENCY, + // false, + // requestCU, + // syncBlock - 1 + // ); + // } - returnedProviders = providerOptimizer.chooseProvider( - new Set(providers), - new Set([providers[chosenIndex]]), - requestCU, - requestBlock, - perturbationPercentage - ); - expect(returnedProviders).toHaveLength(1); - expect(returnedProviders[0]).not.toBe(providers[chosenIndex]); - }); + // let returnedProviders = providerOptimizer.chooseProvider( + // new Set(providers), + // new Set(), + // requestCU, + // requestBlock, + // perturbationPercentage + // ); + // expect(returnedProviders).toHaveLength(1); + // expect(returnedProviders[0]).toBe(providers[chosenIndex]); + + // returnedProviders = providerOptimizer.chooseProvider( + // new Set(providers), + // new Set([providers[chosenIndex]]), + // requestCU, + // requestBlock, + // perturbationPercentage + // ); + // expect(returnedProviders).toHaveLength(1); + // expect(returnedProviders[0]).not.toBe(providers[chosenIndex]); + // }); // this test fails statistically. we need to solve the issue also on the golang version. // it("tests provider optimizer updating latency", async () => {