Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .github/workflows/build-&-publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
jobs:
blobber:
timeout-minutes: 30
runs-on: [blobber-runner]
runs-on: [hetzner-build]
steps:
- name: Cleanup before restarting conductor tests.
run: |
Expand Down Expand Up @@ -52,9 +52,6 @@ jobs:
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# - name: Login to Docker Hub
# uses: docker/login-action@v1
# with:
Expand Down Expand Up @@ -95,19 +92,19 @@ jobs:
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
export DOCKER_IMAGE_BASE="$BLOBBER_BUILD_BASE_REGISTRY:$TAG"
export DOCKER_IMAGE_SWAGGER="${BLOBBER_REGISTRY}:swagger_test"
# export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
export DOCKER_BUILD="build --push"
export DOCKER_BUILD="buildx build --load"
export DOCKER_IMAGE_BLOBBER="-t ${BLOBBER_REGISTRY}:${TAG}"
export CONTEXT_NAME="$RUNNER_NAME" && (docker context inspect "$CONTEXT_NAME" >/dev/null 2>&1 || docker context create "$CONTEXT_NAME")
docker buildx inspect "blobber-$RUNNER_NAME" || docker buildx create --name "blobber-$RUNNER_NAME" --driver-opt network=host --buildkitd-flags '--allow-insecure-entitlement security.insecure' "$CONTEXT_NAME"
docker buildx use "blobber-$RUNNER_NAME"
./docker.local/bin/build.blobber.sh
docker tag ${BLOBBER_REGISTRY}:${TAG} ${BLOBBER_REGISTRY}:${TAG}-${SHORT_SHA}
docker push ${BLOBBER_REGISTRY}:${TAG}
docker push ${BLOBBER_REGISTRY}:${TAG}-${SHORT_SHA}
validator:
timeout-minutes: 30
runs-on: [blobber-runner]
runs-on: [hetzner-build]
steps:
- name: Cleanup before restarting conductor tests.
run: |
Expand Down Expand Up @@ -143,8 +140,6 @@ jobs:
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# - name: Get changed files using defaults
# id: changed-files
Expand Down Expand Up @@ -181,20 +176,20 @@ jobs:
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
export DOCKER_IMAGE_BASE="$BLOBBER_BUILD_BASE_REGISTRY:$TAG"
# export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
export DOCKER_BUILD="build --push"
export DOCKER_BUILD="buildx build --load"
export DOCKER_IMAGE_VALIDATOR="-t ${VALIDATOR_REGISTRY}:${TAG}"
export CONTEXT_NAME="$RUNNER_NAME" && (docker context inspect "$CONTEXT_NAME" >/dev/null 2>&1 || docker context create "$CONTEXT_NAME")
docker buildx inspect "validator-$RUNNER_NAME" || docker buildx create --name "validator-$RUNNER_NAME" --driver-opt network=host --buildkitd-flags '--allow-insecure-entitlement security.insecure' "$CONTEXT_NAME"
docker buildx use "validator-$RUNNER_NAME"
./docker.local/bin/build.validator.sh
docker tag ${VALIDATOR_REGISTRY}:${TAG} ${VALIDATOR_REGISTRY}:${TAG}-${SHORT_SHA}
docker push ${VALIDATOR_REGISTRY}:${TAG}
docker push ${VALIDATOR_REGISTRY}:${TAG}-${SHORT_SHA}
system-tests:
if: github.event_name != 'workflow_dispatch'
needs: [blobber, validator]
runs-on: [ tests-suite ]
runs-on: [ hetzner-testsuite ]
steps:
- name: "Get current PR"
uses: jwalton/gh-find-current-pr@v1
Expand Down
30 changes: 5 additions & 25 deletions .github/workflows/build-for-conductor-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ env:

jobs:
build_blobber_for_conductor_testing:
runs-on: [self-hosted, arc-runner]
runs-on: [hetzner-build]
steps:
- name: Cleanup before restarting conductor tests.
run: |
echo 'y' | docker system prune -a
rm -rf *
cd /tmp
rm -rf ./*

- name: Set docker image tag
run: |
if [[ "${{github.ref}}" == refs/pull/* ]]; then
Expand All @@ -39,26 +40,9 @@ jobs:
echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ^1.21 # The Go version to download (if necessary) and use.

- name: Clone blobber
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Set up Docker Buildx
run: |
sudo apt-get update -y
sudo apt-get install wget
sudo apt-get install ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
export DOCKER_CLI_EXPERIMENTAL=enabled
docker run --privileged --rm tonistiigi/binfmt --install all
docker context create blobber_buildx
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
Expand All @@ -68,9 +52,5 @@ jobs:
- name: Testing blobber & validator builds for conductor testing
run: |
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
# export DOCKER_IMAGE_BASE="${BLOBBER_REGISTRY}:base"
# export DOCKER_IMAGE_SWAGGER="${BLOBBER_REGISTRY}:swagger_test"
# export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
# export DOCKER_IMAGE_BLOBBER="-t ${BLOBBER_REGISTRY}:${TAG} -t ${BLOBBER_REGISTRY}:${TAG}-${SHORT_SHA}"
docker buildx create --driver-opt network=host --use --buildkitd-flags '--allow-insecure-entitlement security.insecure' --use blobber_buildx
./docker.local/bin/build.base.sh && ./docker.local/bin/build.blobber-integration-tests.sh
docker buildx create --name blobber_buildx --driver-opt network=host --buildkitd-flags '--allow-insecure-entitlement security.insecure' --use || docker buildx use blobber_buildx
./docker.local/bin/build.base.sh && ./docker.local/bin/build.blobber-integration-tests.sh
38 changes: 19 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ on:
jobs:
linter:
name: Lints
runs-on: [self-hosted,blobber-runner]
runs-on: [hetzner-build]
env:
HOME: /root
GOCACHE: /root/.cache/go-build
GOPATH: /root/go
steps:
# - name: Setup go
# uses: actions/setup-go@v3
# with:
# go-version: ^1.22 # The Go version to download (if necessary) and use.

- name: Clone blobber
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Packages
run: |
sudo apt-get update
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
sudo apt-get install wget
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev wget

- name: Buf-lint
if: success()
Expand All @@ -35,7 +33,6 @@ jobs:
- name: Build Base
run: |
./docker.local/bin/build.base.sh
golangci-lint cache clean

- name: Golangci-lint
uses: golangci/golangci-lint-action@v3
Expand All @@ -46,20 +43,23 @@ jobs:
skip-pkg-cache: true
skip-build-cache: true


unit-tests:
name: Unit Tests
runs-on: [self-hosted,arc-runner]
runs-on: [hetzner-testsuite]
env:
HOME: /root
GOCACHE: /root/.cache/go-build
GOPATH: /root/go
steps:
- name: Clone blobber
uses: actions/checkout@v3

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ^1.22 # The Go version to download (if necessary) and use.

- name: Clone blobber
uses: actions/checkout@v2
go-version: ^1.22

- name: Install Make Command
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev wget
Expand All @@ -68,10 +68,10 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/code/go/0chain.net/
CGO_ENABLED=1 go test -tags bn256 -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
# fail_ci_if_error: true
files: ./code/go/0chain.net/coverage.txt
flags: Unit-Tests
verbose: true
verbose: true
1 change: 1 addition & 0 deletions code/go/0chain.net/blobber/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func readKeysFromAws() error {
return nil
}

//nolint:unused
func readKeysFromString(keyFileRaw *string) error {
publicKey, privateKey, _, _ = encryption.ReadKeys(
bytes.NewBufferString(*keyFileRaw))
Expand Down
5 changes: 4 additions & 1 deletion code/go/0chain.net/blobber/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ import (
"context"
"encoding/json"
"errors"
"github.com/0chain/gosdk/core/transaction"
"strconv"
"time"

"github.com/0chain/gosdk/core/transaction"

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
)

// nolint:unused
type storageScCB struct {
done chan struct{}
cct int64
mfs int64
err error
}

// nolint:unused
func (ssc *storageScCB) OnInfoAvailable(op int, status int, info string, errStr string) {
defer func() {
ssc.done <- struct{}{}
Expand Down
Loading
Loading