Skip to content

Commit b6b9bce

Browse files
service-0chainSriepcnlangzigeaxkushthedude
authored
updating code to qa branch from staging in order to achieve stabilisation in network (#658)
* :bug: Refresh allocation on change in owner (#342) * object_operation_handler unit test (#335) * ChunkedUpload feature (#344) * feat(upload):refactor code for file upload/update/delete, and add resume upload support * fix(gomod):removed go mod replace * fix(merkle): renamed StreamingMerklHasher with StreamMerklHasher * fix(upload): updated fields on ResumeFileChange * fix(devserver):#145 added devserver feature on blobber and validtor; added scripts and docker-compose.yml for dev * fix(devserver):wrapped transaction.MakeSCRestAPICall with middleware * fix(upload): fixed reload state of allocationChange from db * fix(upload):added to improve build performance;enabled FullSaveAssociations on connectionObj.Save;updated uploadFormData; * fix(devserver):#145 added ./dev.local/cli.sh to run blobber & validator instead of docker * fix(devserver):#145 fixed typo * fix(devserver):#145 added guideline link on README.md * fix(devserver):#145 added build tags was missing * fix(devserver):#145 fixed bug on log_dir, files_dir and db_dir * fix(devserver):#145 added install debuggers * fix(devserver):#145 fixed typo * fix(devserver):#145 fixed bugs on validator * fix(upload):0chain/blobber#111 disable go replace for gosdk * fix(upload):#111 drop devserver part * fix(upload):#111 drop devserver on cli.sh * fix(upload): removed debugging code * fix(devops):0chain/gosdk#107 added github actions for CI/CD * fix(devops):0chain/gosdk#107 fixed build.validator.sh and gosdk repo url * fix(devops):0chain/gosdk#107 fixed gosdk path and disable ci jobs on dayi/* branches * fix(go):removed fmt in debugging * fix(devops):0chain/gosdk#107 remove gosdk before git clone * fix(devops):0chain/gosdk#107 debug git clone issue * fix(devops):0chain/gosdk#107 fixed git clone with branch bug * fix(devops):0chain/gosdk#107 used short GITHUB_SHA instead of latest on docker registry * fix(devops):0chain/gosdk#107 use - instead of latest on docker registry * fix(upload): 0chain/zboxcli#36 update connection size bugs when a chunk is uploaded more than once * fix(git):fixed build scripts about syntax error * fix(dev): added network issue fix script for MacOS * fix(dev): update ip detection * fix(upload&download): 0chain/zboxcli:#37 added chunksize parameter on upload * fix(upload&download): 0chain/zboxcli#36 removed transaction on migrate sql script * fix(liveupload):0chain/zboxcli#54 removed code for debugging * fix(devops):fixed package bug on dockerfile * fix(devops):fixed package bug on dockerfile * fix(devops):fixed package bug on dockerfile * fix(cli):added se-hostname * fix(cli):added change_zcn * fix(cli):skip change zcn if it is blank * feat(cli):fixed validator config * fix(cli):updated logs for cli * fix(challeng):rename ValidationTickets stuff * fix(challenge):remove unsed comment * fix(test):fixed unit test * fix(docs): added comment * fix(core): rename merkletree * fix(upload): normalized names * fix(upload): added ChunkHash in FormData * fix(download): removed ChunkSize from GetFileBlock * fix(upload): Added chunk_size in GetFileBlockForChallenge * fix(challenge):moved syncChallenge to a new worker * fix(challenge):got challenge worked with custom chunk_size and <1M file * fix(challenge):fixed typo * fix(tests):fixed unit tests for CalculateHash with ChunkSize * fix(tests):enabled ci.yml for dayi/* * fix(tests):git clone gosdk instead of gomod * fix(tests):fixed golangci-lint issue * fix(tests):fixed integration-tests * fix(tests):fixed integration-tests for ChunkSize * fix(tests):fixed integration-tests for ChunkSize * fix(upload): refactored AddFileChange * fix(upload): moved context key from blobber/core/contants to gosdk/contants * fix(update): refactored Update with ChunkedUpload * fix(challenge): added recover in challenge worker * fix(tests): fixed unit tests * fix(worker): added recover in workers * fix(worker): added recover in LoadValidationTickets * fix(update): refactored Update with ChunkedUpload * fix(upload): fixed typo issue * fix(git):tidy gomod * fix(datastore): added sqlmock and mocket for Store * fix(datastore): fixed golangci-lint issues * fix(datastore): fixed integration_tests * fix(datastore): fixed integration_tests * fix(datastore): fixed integration_tests * fix(datastore): set timeout_minutes for integration_tests * fix(upload): added BenchmarkUploadFile * fix(golang):upgraded go with 1.16 in github actions * fix(golangci): fixed golangci issues * fix(golang):upgraded go with 1.17 in dockerfile * fix(golang):upgraded docker images with golang:1.17.1-alpine3.14 * fix(golang):upgraded docker images with golang:1.17.1-alpine3.14 * fix(upload): added BenchmarkUploadFileWithNoDisk * fix(devops): test integration-tests * fix(devops): test integration-tests * fix(devops): run integration-tests with non-root * fix(devops): run integration-tests with non-root * fix(devops): fixed Makefile with tag instead space * fix(upload): updated BenchmarkUploadFile * fix(devops): fixed file permission for integration-tests * fix(devops): fixed file permission and removed action-docker-layer-caching from integration-tests * fix(devops): test integration-tests * fix(devops): test integration-tests * fix(devops): test integration-tests * fix(gomod): import gosdk v1.2.87-beat.1 via gomod * fix(gomod): import gosdk v1.2.87-beat.1 via gomod * fix(gomod): import gosdk v1.2.87-beat.1 via gomod in docker build * fix(docker): remove copy .gosdk * fix(gomod): upgraded gosdk with v1.2.88 Co-authored-by: Lz <code@geax.io> Co-authored-by: Lz <Lz> * added codeql-analysis (#347) * Fix/clean GitHub action (#348) * fix(devops):clean Dockerize, and enabled unit tests * fix(devops):clean github actions * fix(devops): replace runner with self-hosted runners * fix(devops): fixed network issue * fix(devops): removed network create script * fix(devops): run integration-test on ubuntu-20.04 * fix(devops): run CodeQL on self-hosted runners * fix(devops): run CodeQL on [self-hosted, build] * fix(devops): try run CodeQL/integration-tests on [self-hosted, build] * fix(devops): run CodeQL/integration-tests on github runner ubuntu-20.04 * fix(devops): use external network in integration-tesets * fix(devops): reverted testnet0 to external * Fix/GitHub action checkout (#352) * fix(devops):used checkout@v1 * fix(devops):try run CodeQL on self-hosted * fix(devops):try run CodeQL on [self-hosted,build] * fix(devops):try run CodeQL on [self-hosted,docker-builds] * fix(devops):setup golang 1.16.x in CodeQL * fix(devops):use checkout@v1 in dockerize.yml * fix(devops):enabled dockerize.yml on any branch for testing * fix(devops):use checkout@v1 in integration-tests * fix(devops):test docker build on fix/github_action_checkout * fix(devops): fixed checkout issue on [self-hosted, build] * fix(devops): reverted integration-test to run on ubuntu-20.04 * Create dependabot.yml (#359) * Fix/rate limit crash (#370) * fix(challenge): added recover in challenge worker * fix(ratelimit): upgraded tollbooth with v6 * fix(ratelimit): removed ratelimit from grpc-web * fix(ratelimit): reverted common.UserRateLimit * fix(ratelimit): fixed grcp test code * fix(ratelimit): use Middleware to limit request * fix(dev): fixed cli * respond with certain level if level is present (#373) * chore(deps): bump go.uber.org/zap from 1.19.0 to 1.19.1 (#360) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.19.0 to 1.19.1. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.19.0...v1.19.1) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/mitchellh/mapstructure from 1.3.1 to 1.4.2 (#363) Bumps [github.com/mitchellh/mapstructure](https://github.com/mitchellh/mapstructure) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mitchellh/mapstructure/releases) - [Changelog](https://github.com/mitchellh/mapstructure/blob/master/CHANGELOG.md) - [Commits](https://github.com/mitchellh/mapstructure/compare/v1.3.1...v1.4.2) --- updated-dependencies: - dependency-name: github.com/mitchellh/mapstructure dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/spf13/viper from 1.7.0 to 1.9.0 (#361) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.7.0 to 1.9.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.7.0...v1.9.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lz <imlangzi@qq.com> * Fix/gorm (#376) * fix(gomod): upgraded gorm and postgres driver * fix(gomod): downgraded gorm and postgres driver * fix(mux): remvoved grpc server wrapper * fix(mux): moved startGRPCServer for integration-tests only * fix(grpc):fixed syntax typo * fix(filestore):hide error if file doesn't exists on delete * fix(tests):fixed mock issue for gorm * fix(gomod):upgraded zap * fix(devops):updated reviewer for dependabot pr * chore(deps): bump google.golang.org/grpc from 1.36.0 to 1.41.0 (#364) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.36.0 to 1.41.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.36.0...v1.41.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/improbable-eng/grpc-web (#366) Bumps [github.com/improbable-eng/grpc-web](https://github.com/improbable-eng/grpc-web) from 0.14.0 to 0.14.1. - [Release notes](https://github.com/improbable-eng/grpc-web/releases) - [Changelog](https://github.com/improbable-eng/grpc-web/blob/master/CHANGELOG.md) - [Commits](https://github.com/improbable-eng/grpc-web/compare/v0.14.0...v0.14.1) --- updated-dependencies: - dependency-name: github.com/improbable-eng/grpc-web dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/grpc-ecosystem/grpc-gateway/v2 (#368) Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.3.0 to 2.6.0. - [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases) - [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/.goreleaser.yml) - [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.3.0...v2.6.0) --- updated-dependencies: - dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * added backup job * backup (#383) * Update and rename build.yml to build-&-publish-docker-image Update and rename build.yml to build-&-publish-docker-image * chore(deps): bump gorm.io/gorm from 1.21.15 to 1.21.16 (#384) Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.21.15 to 1.21.16. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/compare/v1.21.15...v1.21.16) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(copy):0chain/zboxcli:115 fixed hash issue on copy (#387) * fix(copy):0chain/zboxcli:115 fixed hash issue on copy * fix(devops): dont' run CodeQL and benchmark on pull request * fix(devops): prevent duplicated ci jobs on pull request * fix(devops): prevent duplicated ci jobs on pull request * fix(devops): enabled unit tests ci job on all pull request * fix(devops): enabled unit tests ci job on all pull request * fix(copy):#0chain/zboxcli:115 remove logging * :bug: Error sharing files with wrong clientID (#392) * :bug: error sharing files with wrong clientID * :bug: fixing unittests * :bug: removing duplicated check * fix(docs):build.blobber.sh has been split into 3 files (#396) * Fix/challenge log (#400) * fix(challenge): improved logging for challenge * fix(challenge): improved logging and fixed VerifyMerklePath * fix(gomod): fixed gosdk package for ci jobs * fix(gomod): fixed gosdk package * Fixed a Typo error in README.md file (#402) * Update backup gitaction for condition check. * Commit date correction in backup.yml * fix(docker):# fixed alpine mirros issue (#414) * blobber readme changes (#410) Co-authored-by: Lz <imlangzi@qq.com> * fix(git): fixed conflict * chore(deps): bump gorm.io/driver/postgres from 1.1.2 to 1.2.1 (#411) Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.1.2 to 1.2.1. - [Release notes](https://github.com/go-gorm/postgres/releases) - [Commits](https://github.com/go-gorm/postgres/compare/v1.1.2...v1.2.1) --- updated-dependencies: - dependency-name: gorm.io/driver/postgres dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump gorm.io/gorm from 1.21.16 to 1.22.2 (#412) Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.21.16 to 1.22.2. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/compare/v1.21.16...v1.22.2) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixed missing build tag in dockerized images (#415) * add CGO_ENABLED=1 to the unit test (#418) * add CGO_ENABLED=1 to the unit test * add CGO_ENABLED=1 to test and build command * fixed timestamp issue fixed timestamp issue on TestWriterMarker_GethashData Co-authored-by: Lz <imlangzi@qq.com> * :bug: Root folder sharing not allowing to dig inside 2nd layer subfolders (#393) * :bug: resolving issue with sharing root folder * :bug: adding more unit tests * :bug: Fixing issue with Encrypted Files (#409) * fix(download): fixed download file with authticket * fix(gomod): upgrade gosdk * fix(test): fixed mock issue * fix(test): fixed mock issue * :bug: fixing issue with enc files * :bug: temporary removing tests * :bug: resolving encrypted download issue Co-authored-by: Lz <imlangzi@qq.com> * chore(deps): bump github.com/improbable-eng/grpc-web (#419) Bumps [github.com/improbable-eng/grpc-web](https://github.com/improbable-eng/grpc-web) from 0.14.1 to 0.15.0. - [Release notes](https://github.com/improbable-eng/grpc-web/releases) - [Changelog](https://github.com/improbable-eng/grpc-web/blob/master/CHANGELOG.md) - [Commits](https://github.com/improbable-eng/grpc-web/compare/v0.14.1...v0.15.0) --- updated-dependencies: - dependency-name: github.com/improbable-eng/grpc-web dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump google.golang.org/grpc from 1.41.0 to 1.42.0 (#416) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.41.0 to 1.42.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.41.0...v1.42.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update build-&-publish-docker-image.yml * Signature verification in file meta api to ensure authorized access to allocation owner or a registered collaborator (#394) * Allocation signature verificatin for owner and collaborators in file-meta handler * fix(gomod): upgraded gosdk with latest commit * Allocation signature verificatin for owner and collaborators in file-meta handler Co-authored-by: Lz <imlangzi@qq.com> * fix: rollback to herumi bls (#425) * refactor(main):improved startup code * fix(gomod): fixed go.mod * fix(gomod): rollback to herumi bls * fix(gomod): rollback to herumi bls * fix(test): fixed NewSignatureScheme * fix(test): fixed signatureScheme.RecoverKeys * fix(test): fixed chunk_size issue on tests * fix(test): fixed ipv6 issue on integration tests * fix(test): reverted uncomment for debugging * fix(devops): removed build validator from integration tests * fix(devops): split integrations-tests into smaller step * fix(devops): added new shell script and docker-compose for github action * fix(devops): fixed docker-compose-github.yml * fix(devops): run docker-compose as deamon * fix(devops): print docker ps for debugging * fix(devops): expost ports * add system tests workflow * refactor(main):improved startup code (#424) * refactor(main):improved startup code * fix(gomod): fixed go.mod * refactor grpc code Signed-off-by: Kush Trivedi <kushthedude@gmail.com> Co-authored-by: Kush Trivedi <kushthedude@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> * start grpc server in background (#428) * start grpc server in background * fix(main): fixed progress bar * move herumi installation to base image and use it to the entire docke… (#422) * move herumi installation to base image and use it to the entire dockerfile * update go.sum * update build publish docker image in github actions Co-authored-by: Lz <imlangzi@qq.com> * fix(devops): fixed git clone with checkout@v1 * fix(devops):merged dockerize.yml into build-&-publish-docker-image.yml * fix(devops):merged ci.yml into tests.yml * fix(devops):added multiple mirrors for apline package repositories * fix script for linux build (#433) * Fix/integration tests GitHub (#429) * fix(devops): added gRPC status checking * fix(devops): enabled tesets on pr and tags * fix(devops): fixed yml syntax issues * fix(devops): fixed yml syntax issues * fix(devops): fixed yml syntax issues * fix(main): fixed grpc server startup bug * fix(dockerfile):uncomment local GOPROXY * fix(devops):run integration-tests in single thread * fix(devops):enabled integration switch * feat(devops): run blobber outside docker on integration-tests job * fix(devops): fixed sed issue on linux * fix(devops): skip to setup on chain if it is integration-test on github * fix(devops): merged Run blobber and Run tests * fix(devops): moved integration variable to env * fix(devops): fixed panic issue if zcn is offline on integration-tests * fix(devops): reverted uncommentted code for debugging * fix(devops): fixed evn vars for Run Tests * fix(devops): fixed use make command instead of script * fix(devops): run make integration-tests as sudoer * fix(devops): use custom go to build it * fix(devops): sleep more time to wait grpc server to up * fix(devops): added status checking * fix(devops): added sleep time for build * fix(devops): removed local-build from local-run * fix(devops): run make local-run with sudoer * fix(devops): disable workers on integration-tests * fix(devops): enabled dockerize job on PR for system_test * fix(devops): fixed GITHUB_REF for PR * chore(deps): bump gorm.io/gorm from 1.22.2 to 1.22.3 (#434) Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.22.2 to 1.22.3. - [Release notes](https://github.com/go-gorm/gorm/releases) - [Commits](https://github.com/go-gorm/gorm/compare/v1.22.2...v1.22.3) --- updated-dependencies: - dependency-name: gorm.io/gorm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump gorm.io/driver/postgres from 1.2.1 to 1.2.2 (#430) Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/go-gorm/postgres/releases) - [Commits](https://github.com/go-gorm/postgres/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: gorm.io/driver/postgres dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Expanding unit-tests && fixing issue with renaming dirs (#386) * :bug: expanding unit-tests && fixing issue with renaming dirs * :art: resolving unit tests * :art: lint fix * :hammer: more failing tests Co-authored-by: Lz <imlangzi@qq.com> * issue 420: override "{}" when 'latest_redeemed_rm' is empty string. (#432) * issue 420: override "{}" when 'latest_redeemed_rm' is empty string. Signed-off-by: Pradip Parmar <prince.soamedia@gmail.com> * mock query args added for update query. Signed-off-by: Pradip Parmar <prince.soamedia@gmail.com> Co-authored-by: Lz <imlangzi@qq.com> * Trigger system tests from blobber PR (#427) * Trigger system tests from blobber PR * Add skip tests option * change text * change if conditions * add concurrency * add concurrency * test commit * add configurable system tests branch * add configurable system tests branch Co-authored-by: Lz <imlangzi@qq.com> * :bug: Reject rename if file already exists (#390) * :bug: reject rename if file already exists * :hammer: make it more clean * Update code/go/0chain.net/blobbercore/allocation/renamefilechange.go * :hammer: removing unnecesery code Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> Co-authored-by: Lz <imlangzi@qq.com> * fix zbox list-all wrong return, and make error format clearer (#435) Co-authored-by: Lz <imlangzi@qq.com> * Update/gosdk (#436) * fix zbox list-all wrong return, and make error format clearer * upgrade gosdk Co-authored-by: Lz <imlangzi@qq.com> * fix wrong error output and remove readonly check for storage hander (#438) * fix zbox list-all wrong return, and make error format clearer * remove readOnly check, and fix wrong error return * fix(list):#426 fixed invlaid error for zbox list-all Co-authored-by: Lz <imlangzi@qq.com> * fix substitution bug * fix(devops):fixed docker image tag * fix(devops):fixed docker image tag * [Feature] Improved stats page (#431) * Improved stats (infra and db info, failed challenge list) * Added requested changes from PR review * Removed logs and merged dbstats function * fix(stats):make code more clean Co-authored-by: Lz <imlangzi@qq.com> * in case of listing for newallocation (#447) if we try to get file ref from db for path / it is not available. in that case we ignore the error which result in nil fileref and nil pointer error. to resolve that condition in case of nil fileref and path / we can use / directing to get the data and avoid nil pointer issue. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> * Create dir logic added if given path is not available. (#446) * Create dir logic added if given path is not available. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * copy_ok testcase query mock change. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed createdir methor from obejct operation and added mkdir in ref. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * testcase fix Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * allocation id issue resolved Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> * Feature/use system tests action (#456) * replace existing system tests trigger and poll with native action * read correct var * add substitution correctly * allow tests to be skipped * re-order params to push blobber/validator options first * test commit * fic formatting * retry failures * feat(wasmsdk):0chain/gosdk#294 fixed cors on blobber hanlders (#457) * feat(wasmsdk):0chain/gosdk#294 fixed cors on blobber hanlders * feat(wasmsdk):0chain/gosdk#294 fixed cors on blobber hanlders * feat(wasmsdk):0chain/gosdk#294 fixed cors on handlers * feat(wasmsdk):0chain/gosdk#294 fixed cors on handlers * fix cors and max_file_size checking (#458) * feat(wasmsdk):0chain/gosdk#313 fixed cors on handlers * feat(upload):ignore file size checking if max_file_size is 0 * feat(upload):rejected upload if actual size is greater than max_file_size * fix(upload): renamed changeProcesser with fileChanger * Remove max_file_size restriction (#460) * Remove max_file_size restriction * Fix undefined variable issue * ignore token that never expired (has 0 value) (#461) * ignore token that never expired (has 0 value) * grouping expiration check Co-authored-by: Lz <imlangzi@qq.com> * improved expiration checking Co-authored-by: Lz <imlangzi@qq.com> * Feature/use system tests action (#463) * replace existing system tests trigger and poll with native action * read correct var * add substitution correctly * allow tests to be skipped * re-order params to push blobber/validator options first * test commit * fic formatting * retry failures * add auto system tests * ignore validator publish which is failing * add self hosted runner for system tests * hardcode a runner that works * hardcode a runner that works * hardcode a runner that works * remove conditional * change runners again!!! * debug * test manual trigger * test manual trigger * add manual PR notification to automatic workflow * derive docker image from branch * derive docker image from branch * new commit * debug logging * fix logic to support merge PRs * add escape for when PR not raised * don't run system tests on workflow dispatch for dockerize * don't run system tests on workflow dispatch for dockerize * add auto cancel on new commit so resources are not hogged on system tests * add workflow dispatch skip to default system tests instead of manual * rename workflow to be consistent with other repos * only check image presence if not skipping tests * Update PR template and typo fixes (#466) * replace existing system tests trigger and poll with native action * read correct var * add substitution correctly * allow tests to be skipped * re-order params to push blobber/validator options first * test commit * fic formatting * retry failures * add auto system tests * ignore validator publish which is failing * add self hosted runner for system tests * hardcode a runner that works * hardcode a runner that works * hardcode a runner that works * remove conditional * change runners again!!! * debug * test manual trigger * test manual trigger * add manual PR notification to automatic workflow * derive docker image from branch * derive docker image from branch * new commit * debug logging * fix logic to support merge PRs * add escape for when PR not raised * don't run system tests on workflow dispatch for dockerize * don't run system tests on workflow dispatch for dockerize * add auto cancel on new commit so resources are not hogged on system tests * add workflow dispatch skip to default system tests instead of manual * rename workflow to be consistent with other repos * only check image presence if not skipping tests * Add PR template * checkout current branch explicitly on manual system tests * checkout current branch explicitly on manual system tests (#469) * checkout current branch explicitly on manual system tests * remove additional slow running stages + add resiliency on publish * remove additional slow running stages + add resiliency on publish * rename stages * Fix stats error for non-html endpoints (#475) * resolve stats pagination error by setting request data in context * handle nil value for pagination request data for endpoints without pagintion * Bug/issue 401 copy file when no dir (#464) * Create dir logic added if given path is not available. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * copy_ok testcase query mock change. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed createdir methor from obejct operation and added mkdir in ref. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * testcase fix Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * allocation id issue resolved Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * fix(delete):#451 improved delete logic on reference_objects * handling for revert on fail for copy command. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * testcases updated for copy_ok. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * trying system test with copy-zbox branch. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * Revert "fix(delete):#451 improved delete logic on reference_objects" This reverts commit 29c5f5227b882e76416500305f8f01977ec9a0a4. * handling for copy to root Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * updated testcase branch to validate testcase changes. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed testing branch from system-test Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * system testcase branch name change Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * wallet id reverted Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * copy in dir with child fixed Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> * notify all PRs on manual system tests (#478) * fix(gosdk): upgraded gosdk with 20211230004341-97405e30f6ea (#481) * fix(gosdk): upgraded gosdk with 20211230004341-97405e30f6ea * fix(devops): updated pull request template * fix(devops): fixed runs-on * fix(gomod):go mod tidy * fix(test):fixed rename_test * fix(devops): improved tests.yml * fix(devops): updated runs-on for docker build * fix(devops): improved tests.yml * fix(devops): improved tag for pr * fix(devops): improved tag for pr * fix(devops): improved docker image tag for pr * fix(devops): improved docker image tag for pr * fix(devops): improved docker image tag for pr * fix(devops): fixed invalid syntax on tests.yml * fix(gomod): upgrade gosdk * fix(devops): fixed job names for check * fix(devops):skip-go-installation in golangcli * fix(devops):removed needs from intergation-tests * fix(devops):added cache for go/pkg * fix(devops):fixed syntax on yml * fix(devops):fixed syntax on yml * fix(devops):improved tests.yml * fix(devops):updated runs-on * fix(devops): removed cache actions for go/pkg. download it from github is not faster than goproxy * fix(devops):run system_test with fix/docker_image_tag_for_pr * fix(devops): improved get tag script * fix(devops): simplied job names for dockerize * fix(devops): reverted system_tests to master * fix(devops): improved dockerize, pr template and upgrade gosdk with 3d69e6515423408ebbf99563a73d1996f73ea78c: * fix(gomod): upgraded deps (#489) * fix(gomod): upgraded deps * fix(grpc):fixed deprecated warning on grpc.WithInsecure * handling for delete root (#453) * Create dir logic added if given path is not available. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * copy_ok testcase query mock change. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed createdir methor from obejct operation and added mkdir in ref. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * testcase fix Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * allocation id issue resolved Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * handling for delete root Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * fix(delete):#451 improved delete logic on reference_objects * query update Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * delete refactor and issue fix. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> Co-authored-by: Ryan <ryanstewart456@gmail.com> * Bug/issue 401 copy file when no dir (#490) * Create dir logic added if given path is not available. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * copy_ok testcase query mock change. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed createdir methor from obejct operation and added mkdir in ref. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed unwanted changes Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * testcase fix Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * allocation id issue resolved Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * fix(delete):#451 improved delete logic on reference_objects * handling for revert on fail for copy command. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * testcases updated for copy_ok. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * trying system test with copy-zbox branch. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * Revert "fix(delete):#451 improved delete logic on reference_objects" This reverts commit 29c5f5227b882e76416500305f8f01977ec9a0a4. * handling for copy to root Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * updated testcase branch to validate testcase changes. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed testing branch from system-test Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * system testcase branch name change Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * wallet id reverted Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * copy in dir with child fixed Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * handling for copy in dir with child. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> * collaborators added in list api (#452) * collaborators added in list api Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * show collaborators to owner only. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed changes to check system-tests. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * rollback Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * nil handling in collaborator list Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Ryan <ryanstewart456@gmail.com> Co-authored-by: Lz <imlangzi@qq.com> * Get Refs with Authticket (#495) * Remove redundant check * Add latest read marker in response * Add authticket access to GetRefs function Add latest marker in response * Remove read marker as it cannot be used properly * Fix json missing tag name * Allow other client to access with right credential Check if shareinfo is revoked * Fix conditon checking * https flags added in blobber server. (#500) * https flags added in blobber server. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * if both port available we need to listen on both: http and https Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> * fix(gomod): upgrade gosdk, gorm and zap (#501) * removed physical createdir, updated createdir default size. (#491) * removed physical createdir, updated createdir default size. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * issues/441 duplicate dir creation handling. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * unit test fix Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * issue handling Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * removed createDir from fileStore. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> Co-authored-by: Kishan-Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> * readme updated for https. (#505) * readme updated for https. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * https docker-compose for example. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * cert path changed. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * port exported. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> * fix(main): register with https on zcn (#510) * fix(main): register with https on zcn * fix(main): register blobber with https on zcn * fix(gomod):upgraded grpc packages (#512) * fix(gomod):upgraded grpc packages * fix(gomod):upgraded gosdk * fix(docker): removed debugging gcflags for compile optimizations * fix(docker): don't use git on run docker image * fix(docker): use alpine:3.14 instead of golang image for production * fix(devops): added concurrency for benchmark * fix(node): added cli argument --hosturl to register url on zcn (#513) * fix(node): added cli argument --hosturl to register url on zcn * fix(node): fixed synatx issue * fix(upload): thumbnail is lost (#516) * fix(upload): thumbnail is not committed correcly on upload/update request * fix(devops): short name for UI pretty on github checks * fix(devops): short name for UI pretty on github checks * fix(hash): updated sha1 with sha256 for file hash (#515) * fix(hash): updated sha1 with sha256 for file hash * Put spread out sql in one place (#519) * Fix issue raised by linter (#520) * Fix issue raised by gocritic linter * Fix issue raised by goimports linter * Fix issue raised by gosec linter * Fix issue raised by unconvert linter * Fix issue raised by unparam linter * Fix issue raised by misspell linter * Fix issue raised by whitespace linter * Optimize/verify auth ticket function (#525) * Optimize auth ticket verification function * Fix mock * Fix/public share issue (#528) * Fix expiration issue, add default 90 days to public share * Remove redundant and erroneous checking * Modify . import issue * Remove redundant allocationID retrieval * Move condition checking * Allow collaborators to provide share to other clients (#531) * Allow collaborators to provide share to other clients * Allow only owners to share file check if client is same as allocation owner * Remove double checking clientid * write-marker for copied files. (#492) * write-marker for copied files. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * error check for newdir stats. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> * Optimize/download (#526) * Optimize auth ticket verification function * Fix mock * Reduce code * Optimize redundant code * Upgrade gosdk * Make authticket mandatory to other clients Modify tests accordingly * Allow collaborator to download file without authticket * Fix collaborator file download test * Fix Checking clientid from authtoken * fix(merkle): fixed merkle chunk size for challenge hash (#533) * fix(merkle): fixed merkle chunk size for challenge hash * fix(gomod): upgraded zap and grpc * fix(gomod): upgraded gosdk * fix(merkel):fixed merkel chunk size bug * fix(merkel):fixed panic if chunksize is less than 1024 * fix(gomod): upgraded gosdk * fix(download): fixed encryption header issues (#536) * fix(download): fixed encryption header issues * fix(download): fixed encryption header issues * Fix/reduce encryption header size (#538) * fix(download): reduced EncryptionHeaderSize with 257 * fix(download): reduced EncryptionHeaderSize with 256 * Feat/db auto migrate (#539) * feat(datastore): added AutoMigrate * download migrated from post to get (#540) * fix(writemarker): added distributed locks for WM (#546) * delete file query update. (#542) * Update PR template (#553) * change data reading from form to header for download. (#550) * change statucode for delete file when file not found. (#551) * Update PULL_REQUEST_TEMPLATE.md (#560) * fix/updated WriteMarkerMutex (#555) * feat(writemarker): updated WriteMarker mutex * feat(writemarker): updated CreateAt with int64 * Feature/99 statuscode 204 for file not found (#559) * simplify logic for delete Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * commit handler logic update. Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * status handling for respond method Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> * feat(delete): improved status code 204 logic Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Lz <imlangzi@qq.com> * Feat/hashnode API (#558) * feat(writemarker): updated WriteMarker mutex * feat(writemarker): updated CreateAt with int64 * fix(ref): load root hash node * fix(ref): added unit tests for hashnode * fix(ref): added unit tests for hashnode * feat(writemarker): updated WriteMarker mutex * feat(writemarker): updated CreateAt with int64 * fix(ref): load root hash node * fix(ref): added unit tests for hashnode * fix(ref): added unit tests for hashnode * fix(ref):fixed typo * fix(ref):fixed typo * fix(writelock):renamed connectionID with sessionID * fix(writelock):renamed connectionID with sessionID * fix(writelock):revered sessionID to connectionID * fix(gomod): upgraded gorm * feat(writemarker): fixed sql issue on postgres * feat(gomod): updated gosdk * skip minio setup if minio.start is false in config. (#564) Signed-off-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> * fix(devops): enabled build job for tag (#566) * fix(devops): enabled build job for tag * fix(devops): enabled build job for tag * Update build-&-publish-docker-image.yml * fix(gomod): upgraded gprc-gateway with v2.8.0 (#567) * fix(writelock):release lock if file is committed (#570) * fix(writelock):release lock if file is committed * fix(writelock):improved delete handler with restful delete method * fix(handler): fixed signature issue for collaborator * fix(devops): build multi platform images (#568) * fix(challenge): removed unused lock on challenge worker (#574) * Fix file upload inside file (#578) * Reject file upload inside file * Reject directory creation inside filepath * Comment out to test issue * Fix issue due to sql query * Validate path to copy object * Optimize changes * Fix path value * fix(docker): fixed validator workdir issue (#581) * fix(gomod): upgraded grpc (#580) * fix(resty): upgraded gosdk for restry (#576) * fix(devops): enabled workflow_dispatch on dockerize job (#587) * fix(copy):fixed panicking issue and missing stats bug (#584) * fix(gomod): upgraded testify (#593) * fix(init): try ping postgres to check if it is ready (#586) * fix(challenge):db conn is not closed (#591) * fix(download):fixed Access-Control-Allow-Headers for wasm sdk (#595) * fix(gomod):upgraded gorm and grpc (#599) * Feat/available after (#600) * Feat/batch chunks upload (#603) * Modify/read marker2 (#582) * Fix path value * Modify readmarker counter to readsize Some reduction and optimizations Generate new proto file * Modify fields of tables and reduc some fields * Upgrade gosdk * Modify tests * Fix Readsize in test's readmarker * Upgrade gosdk to specific commit * Update build-&-publish-docker-image.yml add workflow_dispatch * Tidy go.sum * Remove unrequired function and function parameters * Fix lint issues * Fix create and update issue of pending * Point gosdk to specific commit Co-authored-by: vinayakgautamops <95210787+vinayakgautamops@users.noreply.github.com> * :hammer: init commit * :art: linting * fix(createdir):improved it as idempotent (#604) * fix(devops):upload coverage to Codecov (#614) * fix(getobjecttree): getobjecttree should work even allocation is empty (#605) * fix(collaborator):updated permission checking on file upload/update/d… (#613) * fix(devops):fixed incorrect url for codecov status badge (#616) * Update build-&-publish-docker-image.yml (#608) * Update build-&-publish-docker-image.yml * Update build-&-publish-docker-image.yml fix params * Created config_change_alert.yaml (#617) * Update gosdk to add 'state_changes_count' (#609) * Update system_tests.yml (#619) * Issue 524 (#529) Root hash calculation optimization * Sa optimise (#623) * - logging added * - removing blobbers from storageallocation * Feat/partial delete suppport (#626) * fix(objecttree):fixed status code with 404 * fix(filechange):removed unused error * fix(devops): fixed checkout action issue * fix(gosdk): upgraded gorm (#629) * feat(devops): automatically upgrade gosdk (#633) * Remove unused param (#634) * add new filter param + new runners (#638) * add new filter param + new runners * consume master actions * Enhancement/db automigration2 (#615) * Delete sql files * Add/Update config * Add/Update gorm tags Move table struct * Create user, database and automigrate schemas Add interface Delete unrequired code * Fix/sync create and update time * Rename field * Rename fields * Fix column name for sql command * Modify automigration logic Skip automigration if automigrate is false Don't drop table if table is in keep_tables listing * Fix map read issue * Modify automigration flow Drop all is considered as default * Fix column name error * Fix primaryKey tag * Fix unaddressable issue * Skip value update by gorm * Add gorm's size tag * Fix unaddressable issue with gorm * Modify size of columns * point actions to feat branch * Add migration support for integration testing * Update build-&-publish-docker-image.yml Co-authored-by: Kishan-Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> * Skip gorm inserting values to sequence field (#645) * Fix/revert to readcounter (#632) * Add new return value * Remove pending_read field * Revert ReadSize to ReadCounter Optimize logic Implement lock for updating readmarker * Change ReadSize to ReadCounter * Update sql fields * Fix test according to revert to readcounter * Return error on stale read marker Add test for stale read marker * Modify sql * Fix field name and tag * Fix context issue and blobber node id * Fix/return data even for non-nil error * Rename column * Skip lint for a line * Remove unnecessary if condition * Add missing blobber id in response Co-authored-by: Kishan-Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> * fix integration tests for docker.local (#654) * fix(writemarker):improved ReddemWriteMarkers to fix #624 (#647) * Fix/blobber reg (#643) * fix(stats):fixed panicking issue on loadAllocReadmarkersStat for #644 (#655) * Update config_change_alert.yaml (#650) Co-authored-by: Lz <imlangzi@qq.com> Co-authored-by: Piers Shepperson <piers.shepperson@btinternet.com> Co-authored-by: Lz <imlangzi@qq.com> Co-authored-by: Lz <code@geax.io> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> Co-authored-by: Laxmi Prasad Oli <olilaxmiprasad@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: anish-squareops <anish@squareops.com> Co-authored-by: anish-squareops <68534207+anish-squareops@users.noreply.github.com> Co-authored-by: Mohd. Shahnawaz Ali Choudhary <57221398+m-s-a-c@users.noreply.github.com> Co-authored-by: Artem Bogomaz <artembogomaz@gmail.com> Co-authored-by: Vishwajeet Takle <81675776+VishwajeetT22@users.noreply.github.com> Co-authored-by: hm90121 <65766301+hm90121@users.noreply.github.com> Co-authored-by: Rezoan Tamal <36768796+iamrz1@users.noreply.github.com> Co-authored-by: Andika Demas Riyandi <andika.riyan@gmail.com> Co-authored-by: stewartie4 <ryanstewart456@gmail.com> Co-authored-by: Kush Trivedi <kushthedude@gmail.com> Co-authored-by: prince <prince.soamedia@gmail.com> Co-authored-by: Pradip Parmar <pradip@alfa-creator.com> Co-authored-by: Kishan-Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: vinayakgautamops <95210787+vinayakgautamops@users.noreply.github.com> Co-authored-by: peterlimg <54137706+peterlimg@users.noreply.github.com> Co-authored-by: Ayoub BOUROUMINE <47432728+abouroumine@users.noreply.github.com> Co-authored-by: Sumit Sardana <50195022+ssardana08@users.noreply.github.com> Co-authored-by: Roman <rrrooommmaaa@mail.ru>
1 parent 6d0abe2 commit b6b9bce

File tree

253 files changed

+15507
-6993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+15507
-6993
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gomod" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
open-pull-requests-limit: 10
13+
reviewers:
14+
- cnlangzi
15+
labels:
16+
- pr/dependencies

.github/workflows/backup.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Mirror repo to S3
2+
3+
on:
4+
schedule:
5+
# Runs everyday at 12:25 am
6+
- cron: '25 0 * * * '
7+
workflow_dispatch:
8+
9+
jobs:
10+
s3Backup:
11+
runs-on: docker-builds
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: Get info
16+
id: get_info
17+
run: |
18+
GIT_COMMIT_DATE="$((`git log -n 1 --date-order --all | grep Date | awk '{ print $4 }'`))"
19+
YESTERDAY_DATE="$((`date | awk '{ print $3 }'`-1))"
20+
echo ::set-output name=GIT_COMMIT_DATE::${GIT_COMMIT_DATE}
21+
echo ::set-output name=YESTERDAY_DATE::${YESTERDAY_DATE}
22+
echo $GIT_COMMIT_DATE
23+
echo $YESTERDAY_DATE
24+
25+
- name: Create backup
26+
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
27+
run: |
28+
github-backup 0chain -P -t ${{ secrets.ACCESS_TOKEN }} --output-directory=/github-backup/blobber --all -O -R blobber
29+
30+
- name: Create zip
31+
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
32+
run: zip -r blobber.zip /github-backup/blobber
33+
34+
- name: Set AWS credentials
35+
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
36+
uses: aws-actions/configure-aws-credentials@v1
37+
with:
38+
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
39+
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
40+
aws-region: us-east-2
41+
42+
- name: Backup to s3
43+
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
44+
run: |
45+
aws s3 cp blobber.zip s3://${{ secrets.MIRROR_TARGET }}/blobber.zip

.github/workflows/benchmark.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Benchmark
2+
3+
concurrency:
4+
group: "benchmark-${{ github.ref }}"
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [ master, staging ]
10+
11+
jobs:
12+
benchmark:
13+
runs-on: [self-hosted, conductor-test]
14+
steps:
15+
- name: Setup go 1.17
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: '1.17' # The Go version to download (if necessary) and use.
19+
20+
- name: Clone blobber
21+
uses: actions/checkout@v2
22+
23+
- name: Run benchmark
24+
run: CGO_ENABLED=1 go test -tags bn256 -benchmem -run="BenchmarkUploadFile*" -bench="BenchmarkUploadFile*" ./... | tee benchmark.txt
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: "Dockerize"
2+
3+
concurrency:
4+
group: "publish-${{ github.ref }}"
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- staging
11+
tags:
12+
- '*'
13+
pull_request:
14+
workflow_dispatch:
15+
16+
env:
17+
BLOBBER_REGISTRY: ${{ secrets.BLOBBER_REGISTRY }}
18+
VALIDATOR_REGISTRY: ${{ secrets.VALIDATOR_REGISTRY }}
19+
20+
jobs:
21+
blobber:
22+
runs-on: [self-hosted, build]
23+
steps:
24+
- name: Set docker image tag
25+
run: |
26+
if [[ "${{github.ref}}" == refs/pull/* ]]; then
27+
tag=${GITHUB_REF/\/merge/}
28+
echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV
29+
else
30+
echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV
31+
fi
32+
33+
echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
34+
echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV
35+
36+
- name: Setup go 1.17
37+
uses: actions/setup-go@v2
38+
with:
39+
go-version: '1.17' # The Go version to download (if necessary) and use.
40+
41+
- name: Clone blobber
42+
uses: actions/checkout@v1
43+
44+
- name: Login to Docker Hub
45+
uses: docker/login-action@v1
46+
with:
47+
username: ${{ secrets.DOCKERHUB_USERNAME }}
48+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
49+
50+
- name: Build base
51+
run: |
52+
export DOCKER_IMAGE_BASE="${BLOBBER_REGISTRY}:base"
53+
export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
54+
./docker.local/bin/build.base.sh
55+
56+
- name: Build blobber
57+
run: |
58+
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
59+
60+
export DOCKER_IMAGE_BASE="${BLOBBER_REGISTRY}:base"
61+
export DOCKER_IMAGE_BLOBBER="-t ${BLOBBER_REGISTRY}:${TAG} -t ${BLOBBER_REGISTRY}:${TAG}-${SHORT_SHA}"
62+
export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
63+
64+
./docker.local/bin/build.blobber.sh
65+
66+
validator:
67+
runs-on: [self-hosted, build]
68+
steps:
69+
- name: Set docker image tag
70+
run: |
71+
if [[ "${{github.ref}}" == refs/pull/* ]]; then
72+
tag=${GITHUB_REF/\/merge/}
73+
echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV
74+
else
75+
echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV
76+
fi
77+
78+
echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
79+
echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV
80+
81+
- name: Setup go 1.17
82+
uses: actions/setup-go@v2
83+
with:
84+
go-version: '1.17' # The Go version to download (if necessary) and use.
85+
86+
- name: Clone blobber
87+
uses: actions/checkout@v1
88+
89+
- name: Login to Docker Hub
90+
uses: docker/login-action@v1
91+
with:
92+
username: ${{ secrets.DOCKERHUB_USERNAME }}
93+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
94+
95+
- name: Build base
96+
run: |
97+
export DOCKER_IMAGE_BASE="${VALIDATOR_REGISTRY}:base"
98+
export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
99+
./docker.local/bin/build.base.sh
100+
101+
- name: Build validator
102+
run: |
103+
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
104+
105+
export DOCKER_IMAGE_BASE="${VALIDATOR_REGISTRY}:base"
106+
export DOCKER_IMAGE_VALIDATOR="-t ${VALIDATOR_REGISTRY}:${TAG} -t ${VALIDATOR_REGISTRY}:${TAG}-${SHORT_SHA}"
107+
export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
108+
109+
./docker.local/bin/build.validator.sh
110+
111+
112+
system-tests:
113+
if: github.event_name != 'workflow_dispatch'
114+
needs: [blobber, validator]
115+
runs-on: [ tests-suite ]
116+
steps:
117+
- name: "Get current PR"
118+
uses: jwalton/gh-find-current-pr@v1
119+
id: findPr
120+
with:
121+
github-token: ${{ github.token }}
122+
123+
- name: "Set PR status as pending"
124+
uses: niteoweb/pull_request_status_action@v1.0.0
125+
if: steps.findPr.outputs.number
126+
with:
127+
pr_number: ${{ steps.findPr.outputs.pr }}
128+
description: "System tests running with default config..."
129+
state: "pending"
130+
repository: ${{ github.repository }}
131+
context: "0Chain System Tests"
132+
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
133+
env:
134+
GITHUB_TOKEN: ${{ github.token }}
135+
136+
- name: "Setup"
137+
run: |
138+
if [[ "${{github.ref}}" == refs/pull/* ]]; then
139+
tag=${GITHUB_REF/\/merge/}
140+
echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV
141+
else
142+
echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV
143+
fi
144+
145+
echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
146+
echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV
147+
echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV
148+
echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV
149+
150+
- name: "Deploy 0Chain"
151+
uses: 0chain/actions/deploy-0chain@master
152+
with:
153+
kube_config: ${{ secrets[format('DEV{0}KC', env.RUNNER_NUMBER)] }}
154+
teardown_condition: "TESTS_PASSED"
155+
miner_image: staging
156+
sharder_image: staging
157+
blobber_image: ${{ env.TAG }}-${{ env.SHORT_SHA }}
158+
validator_image: ${{ env.TAG }}-${{ env.SHORT_SHA }}
159+
zbox_image: staging
160+
zblock_image: staging
161+
zdns_image: staging
162+
explorer_image: latest
163+
zproxy_image: staging
164+
zsearch_image: staging
165+
zbox_cli_branch: staging
166+
zwallet_cli_branch: staging
167+
custom_go_sdk_version: staging
168+
169+
- name: "Run System tests"
170+
uses: 0chain/actions/run-system-tests@master
171+
with:
172+
system_tests_branch: master
173+
network: ${{ env.NETWORK_URL }}
174+
zbox_cli_branch: staging
175+
zwallet_cli_branch: staging
176+
svc_account_secret: ${{ github.token }}
177+
deploy_report_page: false
178+
archive_results: true
179+
run_flaky_tests: false
180+
retry_failures: true
181+
182+
- name: "Set PR status as ${{ job.status }}"
183+
if: ${{ (success() || failure()) && steps.findPr.outputs.number }}
184+
uses: niteoweb/pull_request_status_action@v1.0.0
185+
with:
186+
pr_number: ${{ steps.findPr.outputs.pr }}
187+
description: "System tests with default config ${{ job.status }}"
188+
state: ${{ job.status }}
189+
repository: ${{ github.repository }}
190+
context: "0Chain System Tests"
191+
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
192+
env:
193+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/build.yml

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)