From 94bd5571ed398b4faab6327ac59a473874e58017 Mon Sep 17 00:00:00 2001 From: Manali-Jain-squareops <86873900+Manali-Jain-squareops@users.noreply.github.com> Date: Wed, 19 Jul 2023 15:50:06 +0530 Subject: [PATCH 1/4] build base blobber optimization (#1169) * Add path in thumbnail hash (#1098) * get path from changes * pass rootRef in apply changes * add logs * fix deletechange * fix multi op and copy * fix delete root dir * fix delete root change * fix lint issue * cleanup and stats change * rename func to processMove * calculate object tree in ref path * rmv return from deleteChange * revert changes * move to filestore changes * check prevRoot * add logs and condition * check filestore * requested changes * validate nil proof * add move and copy dir tests * add logs * use path to add child * fix error log * fix add child * add proof log * add more logs * change read log * log objectPath * add commit logs * commit thumbnail first * add missing param * add missing param * add path in the thumbnail hash * add allocID and validation root index * use write * add condn in count query * rmv thumbnail_filename * log wm * cleanup * add rollback wm check * allow empty allocation root * fix tests * check path in upload * fix check * empty commit --------- Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: Yury * Dep/update (#1153) * dependencies update * dependencies update * Remove fileID from fileMetaHash (#1114) * rmv fileID from hash calc * Trigger Build * adding false commit to restart systemtests * add path in fileMetaHash * empty commit --------- Co-authored-by: Yury Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com> Co-authored-by: boddumanohar Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> * optimize image (#1148) Co-authored-by: boddumanohar * once for logger init * Update challenge timing submission (#1140) * update challenge timing submission * fix createdAt in challenge timing table --------- Co-authored-by: Yury * Fix blobber size (#1163) * build base blobber optimization * fixed indentation * fix * fix * fix * Do not redeem readmarkers for free reads (#1166) * do not redeem readmarkers for free reads * fix unit tests, remove readmarker handling from download method * added docker ignore * added docker ignore - testing * once for logger init (#1156) * once for logger init * init logging the same way we do in 0chain * init logging the same way we do in 0chain * Hotfix/map concurrent write (#1158) * once for logger init * wider locking window * Hotfix/remove custom nonce (#1141) * removed custom nonce managing logic * fixed logging * updated gosdk * uncommented previous nonce logic * uncommented previous nonce logic * uncommented previous nonce logic * uncommented previous nonce logic * Use single file to avoid maintaining multiple version of same file (#1160) * Use single file to avoid maintaining multiple version of same file * Fix config path * Remove variable * Update path variable for blobber service --------- Co-authored-by: Yury * fix consume quota lock (#1173) * Fix rm and wm timestamp (#1162) * once for logger init * init logging the same way we do in 0chain * init logging the same way we do in 0chain * add lastChallengeTime log * empty commit * refactor timestamp check in markers * Add diff txn for move to filestore * return if duplicate --------- Co-authored-by: dabasov * fixed gitactions fix issue * remove printing private key in logs (#1161) Co-authored-by: Yury * Fix concurrent upload issue (#1174) * Fix concurrent upload issue * Fix concurrent upload issue * Fix/concurrent upload issue (#1175) * Fix concurrent upload issue * Fix concurrent upload issue * Fix concurrent upload issue * Fix concurrent upload issue --------- Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com> Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: Yury Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com> Co-authored-by: boddumanohar Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Co-authored-by: stewartie4 Co-authored-by: Dinmukhammed <52813950+din-mukhammed@users.noreply.github.com> Co-authored-by: Laxmi Prasad Oli Co-authored-by: root --- .../build-&-publish-docker-image.yml | 48 +++++++++++++++++-- docker.local/.dockerignore | 5 ++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-&-publish-docker-image.yml b/.github/workflows/build-&-publish-docker-image.yml index 30d0aef92..9d78f2677 100644 --- a/.github/workflows/build-&-publish-docker-image.yml +++ b/.github/workflows/build-&-publish-docker-image.yml @@ -16,6 +16,8 @@ env: BLOBBER_REGISTRY: ${{ secrets.BLOBBER_REGISTRY }} VALIDATOR_REGISTRY: ${{ secrets.VALIDATOR_REGISTRY }} DOCKER_CLI_EXPERIMENTAL: enabled + BLOBBER_BUILDBASE: blobber_base + BLOBBER_BUILD_BASE_REGISTRY: ${{ secrets.BLOBBER_BUILD_BASE_REGISTRY }} jobs: blobber: @@ -39,7 +41,7 @@ jobs: go-version: ^1.20 # 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: | @@ -60,6 +62,26 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Get changed files using defaults + id: changed-files + uses: tj-actions/changed-files@v18.4 + + - name: Pull Build Base + run: | + docker pull $BLOBBER_BUILD_BASE_REGISTRY:staging + docker tag $BLOBBER_BUILD_BASE_REGISTRY:staging $BLOBBER_BUILDBASE + + - name: Build Base image + if: contains(steps.changed-files.outputs.modified_files, 'docker.local/base.Dockerfile') + run: | + SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) + + ./docker.local/bin/build.base.sh && + docker tag $BLOBBER_BUILDBASE $BLOBBER_BUILD_BASE_REGISTRY:$TAG + docker tag $BLOBBER_BUILDBASE $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA + docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG + docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA + - name: Build blobber run: | SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) @@ -68,7 +90,7 @@ jobs: 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.sh + ./docker.local/bin/build.blobber.sh validator: runs-on: [self-hosted, arc-runner] @@ -112,6 +134,26 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Get changed files using defaults + id: changed-files + uses: tj-actions/changed-files@v18.4 + + - name: Pull Build Base + run: | + docker pull $BLOBBER_BUILD_BASE_REGISTRY:staging + docker tag $BLOBBER_BUILD_BASE_REGISTRY:staging $BLOBBER_BUILDBASE + + - name: Build Base image + if: contains(steps.changed-files.outputs.modified_files, 'docker.local/base.Dockerfile') + run: | + SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) + + ./docker.local/bin/build.base.sh + docker tag $BLOBBER_BUILDBASE $BLOBBER_BUILD_BASE_REGISTRY:$TAG + docker tag $BLOBBER_BUILDBASE $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA + docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG + docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA + - name: Build validator run: | SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) @@ -119,7 +161,7 @@ jobs: export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push" export DOCKER_IMAGE_VALIDATOR="-t ${VALIDATOR_REGISTRY}:${TAG} -t ${VALIDATOR_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.validator.sh + ./docker.local/bin/build.validator.sh system-tests: diff --git a/docker.local/.dockerignore b/docker.local/.dockerignore index 628d1ada6..55bfc88ca 100644 --- a/docker.local/.dockerignore +++ b/docker.local/.dockerignore @@ -1,8 +1,13 @@ passphrase.txt logs/ +docs/ .git *.md .cache awsnet docker.local/blobber* +docker.aws/* +config/ +docker-clean/ +keys_config **/pkg \ No newline at end of file From 32bc5de95d25b4ac34c90cef34a1ca9773ff38eb Mon Sep 17 00:00:00 2001 From: Yury Date: Sat, 22 Jul 2023 15:27:14 +0300 Subject: [PATCH 2/4] updated dependencies (#1172) * Add path in thumbnail hash (#1098) * get path from changes * pass rootRef in apply changes * add logs * fix deletechange * fix multi op and copy * fix delete root dir * fix delete root change * fix lint issue * cleanup and stats change * rename func to processMove * calculate object tree in ref path * rmv return from deleteChange * revert changes * move to filestore changes * check prevRoot * add logs and condition * check filestore * requested changes * validate nil proof * add move and copy dir tests * add logs * use path to add child * fix error log * fix add child * add proof log * add more logs * change read log * log objectPath * add commit logs * commit thumbnail first * add missing param * add missing param * add path in the thumbnail hash * add allocID and validation root index * use write * add condn in count query * rmv thumbnail_filename * log wm * cleanup * add rollback wm check * allow empty allocation root * fix tests * check path in upload * fix check * empty commit --------- Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: Yury * Dep/update (#1153) * dependencies update * dependencies update * Remove fileID from fileMetaHash (#1114) * rmv fileID from hash calc * Trigger Build * adding false commit to restart systemtests * add path in fileMetaHash * empty commit --------- Co-authored-by: Yury Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com> Co-authored-by: boddumanohar Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> * optimize image (#1148) Co-authored-by: boddumanohar * once for logger init * Update challenge timing submission (#1140) * update challenge timing submission * fix createdAt in challenge timing table --------- Co-authored-by: Yury * Fix blobber size (#1163) * Do not redeem readmarkers for free reads (#1166) * do not redeem readmarkers for free reads * fix unit tests, remove readmarker handling from download method * updated dependencies * once for logger init (#1156) * once for logger init * init logging the same way we do in 0chain * init logging the same way we do in 0chain * Hotfix/map concurrent write (#1158) * once for logger init * wider locking window * Hotfix/remove custom nonce (#1141) * removed custom nonce managing logic * fixed logging * updated gosdk * uncommented previous nonce logic * uncommented previous nonce logic * uncommented previous nonce logic * uncommented previous nonce logic * Use single file to avoid maintaining multiple version of same file (#1160) * Use single file to avoid maintaining multiple version of same file * Fix config path * Remove variable * Update path variable for blobber service --------- Co-authored-by: Yury * fix consume quota lock (#1173) * Fix rm and wm timestamp (#1162) * once for logger init * init logging the same way we do in 0chain * init logging the same way we do in 0chain * add lastChallengeTime log * empty commit * refactor timestamp check in markers * Add diff txn for move to filestore * return if duplicate --------- Co-authored-by: dabasov * fixed gitactions fix issue * remove printing private key in logs (#1161) Co-authored-by: Yury * Fix concurrent upload issue (#1174) * Fix concurrent upload issue * Fix concurrent upload issue * Update go.mod --------- Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com> Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com> Co-authored-by: boddumanohar Co-authored-by: Manali-Jain-squareops <86873900+Manali-Jain-squareops@users.noreply.github.com> Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Co-authored-by: stewartie4 Co-authored-by: Dinmukhammed <52813950+din-mukhammed@users.noreply.github.com> Co-authored-by: Laxmi Prasad Oli Co-authored-by: root --- go.mod | 16 ++++++++-------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index d2b1f2958..df39f01df 100644 --- a/go.mod +++ b/go.mod @@ -21,12 +21,12 @@ require ( github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.24.0 - golang.org/x/crypto v0.10.0 + golang.org/x/crypto v0.11.0 golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.9.0 + golang.org/x/sys v0.10.0 golang.org/x/time v0.3.0 // indirect - google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect - google.golang.org/grpc v1.56.1 + google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect + google.golang.org/grpc v1.56.2 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 google.golang.org/protobuf v1.31.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -44,7 +44,7 @@ require ( require google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect -require github.com/pressly/goose/v3 v3.13.1 +require github.com/pressly/goose/v3 v3.13.4 require ( github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 // indirect @@ -85,11 +85,11 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgx/v5 v5.4.0 // indirect + github.com/jackc/pgx/v5 v5.4.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.16.6 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/klauspost/reedsolomon v1.11.7 // indirect github.com/machinebox/graphql v0.2.2 // indirect @@ -120,7 +120,7 @@ require ( go.mongodb.org/mongo-driver v1.11.3 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect diff --git a/go.sum b/go.sum index 10a27165f..745928389 100644 --- a/go.sum +++ b/go.sum @@ -435,8 +435,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.4.0 h1:BSr+GCm4N6QcgIwv0DyTFHK9ugfEFF9DzSbbzxOiXU0= -github.com/jackc/pgx/v5 v5.4.0/go.mod h1:q6iHT8uDNXWiFNOlRqJzBTaSH3+2xCXkokxHZC5qWFY= +github.com/jackc/pgx/v5 v5.4.1 h1:oKfB/FhuVtit1bBM3zNRRsZ925ZkMN3HXL+LgLUM9lE= +github.com/jackc/pgx/v5 v5.4.1/go.mod h1:q6iHT8uDNXWiFNOlRqJzBTaSH3+2xCXkokxHZC5qWFY= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -473,8 +473,8 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= -github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/reedsolomon v1.11.7 h1:9uaHU0slncktTEEg4+7Vl7q7XUNMBUOK4R9gnKhMjAU= @@ -524,7 +524,7 @@ github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6 github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/microsoft/go-mssqldb v1.1.0 h1:jsV+tpvcPTbNNKW0o3kiCD69kOHICsfjZ2VcVu2lKYc= +github.com/microsoft/go-mssqldb v1.3.0 h1:JcPVl+acL8Z/cQcJc9zP0OkjQ+l20bco/cCDpMbmGJk= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -604,8 +604,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pressly/goose/v3 v3.13.1 h1:4kYsfsboJvQDg1MEcMnXs8ubbz4AeHHXMW19XEAy3vI= -github.com/pressly/goose/v3 v3.13.1/go.mod h1:1WCIzQuOGhpx+D7bal+tGadbwVPmdfy9fltqYLMA8lM= +github.com/pressly/goose/v3 v3.13.4 h1:9xRcg/hEU9HqeRNeKh69VLtPWCKAYTX6l2VsXWOX86A= +github.com/pressly/goose/v3 v3.13.4/go.mod h1:Fo8rYaf9tYfQiDpo+ymrnZi8vvLkvguRl16nu7QnUT4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -631,7 +631,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remeh/sizedwaitgroup v1.0.0 h1:VNGGFwNo/R5+MJBf6yrsr110p0m4/OX4S3DCy7Kyl5E= github.com/remeh/sizedwaitgroup v1.0.0/go.mod h1:3j2R4OIe/SeS6YDhICBy22RWjJC5eNCJ1V+9+NVNYlo= @@ -798,8 +798,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -835,7 +835,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -974,8 +974,8 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -986,8 +986,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1156,8 +1156,8 @@ google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1234,7 +1234,7 @@ lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= modernc.org/ccgo/v3 v3.16.14 h1:af6KNtFgsVmnDYrWk3PQCS9XT6BXe7o3ZFJKkIKvXNQ= modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM= From 697233e06e04fe4856332180e5574d29838e7a71 Mon Sep 17 00:00:00 2001 From: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Date: Sun, 23 Jul 2023 21:11:34 +0530 Subject: [PATCH 3/4] Fix/get open challenges (#1181) * Fix * Fix * Fix * Fix * Fix * Fix * Fix * Improved logging * Fix challenge table --- .../blobbercore/challenge/challenge.go | 34 +++++++++++-------- .../blobbercore/challenge/entity.go | 5 +-- .../blobbercore/challenge/protocol.go | 2 +- .../blobbercore/challenge/worker.go | 8 +++-- goose/migrations/001_blobber_meta.sql | 1 + 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/code/go/0chain.net/blobbercore/challenge/challenge.go b/code/go/0chain.net/blobbercore/challenge/challenge.go index 3f77cb801..4bdea9cfb 100644 --- a/code/go/0chain.net/blobbercore/challenge/challenge.go +++ b/code/go/0chain.net/blobbercore/challenge/challenge.go @@ -24,25 +24,23 @@ type BCChallengeResponse struct { Challenges []*ChallengeEntity `json:"challenges"` } -var lastChallengeTimestamp int +var lastChallengeRound int64 func syncOpenChallenges(ctx context.Context) { - const incrOffset = 20 defer func() { if r := recover(); r != nil { logging.Logger.Error("[recover]challenge", zap.Any("err", r)) } }() - offset := 0 params := make(map[string]string) params["blobber"] = node.Self.ID - params["offset"] = strconv.Itoa(offset) - params["limit"] = "20" - if lastChallengeTimestamp > 0 { - params["from"] = strconv.Itoa(lastChallengeTimestamp) + + params["limit"] = "50" + if lastChallengeRound > 0 { + params["from"] = strconv.FormatInt(lastChallengeRound, 10) } - logging.Logger.Info("[challenge]sync:pull", zap.Any("params", params)) + start := time.Now() var downloadElapsed, jsonElapsed time.Duration @@ -54,6 +52,9 @@ func syncOpenChallenges(ctx context.Context) { return default: } + + logging.Logger.Info("[challenge]sync:pull", zap.Any("params", params)) + var challenges BCChallengeResponse var challengeIDs []string challenges.Challenges = make([]*ChallengeEntity, 0) @@ -75,13 +76,13 @@ func syncOpenChallenges(ctx context.Context) { break } sort.Slice(challenges.Challenges, func(i, j int) bool { - return challenges.Challenges[i].CreatedAt < challenges.Challenges[j].CreatedAt + return challenges.Challenges[i].RoundCreatedAt < challenges.Challenges[j].RoundCreatedAt }) count += len(challenges.Challenges) for _, c := range challenges.Challenges { challengeIDs = append(challengeIDs, c.ChallengeID) - if c.CreatedAt > common.Timestamp(lastChallengeTimestamp) { - lastChallengeTimestamp = int(c.CreatedAt) + if c.RoundCreatedAt >= lastChallengeRound { + lastChallengeRound = c.RoundCreatedAt } toProcessChallenge <- c } @@ -93,8 +94,6 @@ func syncOpenChallenges(ctx context.Context) { if len(challenges.Challenges) == 0 { break } - offset += incrOffset - params["offset"] = strconv.Itoa(offset) } dbTimeStart := time.Now() @@ -110,6 +109,11 @@ func syncOpenChallenges(ctx context.Context) { func validateOnValidators(c *ChallengeEntity) { + logging.Logger.Info("[challenge]validate: ", + zap.Any("challenge", c), + zap.String("challenge_id", c.ChallengeID), + ) + ctx := datastore.GetStore().CreateTransaction(context.TODO()) defer ctx.Done() @@ -119,7 +123,7 @@ func validateOnValidators(c *ChallengeEntity) { logging.Logger.Error("[challengetiming]add: ", zap.String("challenge_id", c.ChallengeID), zap.Error(err)) - deleteChallenge(int64(c.CreatedAt)) + deleteChallenge(c.RoundCreatedAt) tx.Rollback() } @@ -150,7 +154,7 @@ func validateOnValidators(c *ChallengeEntity) { zap.Time("created", createdTime), zap.Error(err)) //TODO: Should we delete the challenge from map or send it back to the todo channel? - deleteChallenge(int64(c.CreatedAt)) + deleteChallenge(c.RoundCreatedAt) tx.Rollback() return } diff --git a/code/go/0chain.net/blobbercore/challenge/entity.go b/code/go/0chain.net/blobbercore/challenge/entity.go index 30eb0bf39..d30fb28f2 100644 --- a/code/go/0chain.net/blobbercore/challenge/entity.go +++ b/code/go/0chain.net/blobbercore/challenge/entity.go @@ -97,8 +97,9 @@ type ChallengeEntity struct { Timestamp common.Timestamp `gorm:"column:timestamp;not null;default:0" json:"timestamp"` // This time is taken from Blockchain challenge object. - CreatedAt common.Timestamp `gorm:"created_at" json:"created"` - UpdatedAt time.Time `gorm:"updated_at;type:timestamp without time zone;not null;default:current_timestamp" json:"-"` + RoundCreatedAt int64 `gorm:"round_created_at" json:"round_created_at"` + CreatedAt common.Timestamp `gorm:"created_at" json:"created"` + UpdatedAt time.Time `gorm:"updated_at;type:timestamp without time zone;not null;default:current_timestamp" json:"-"` } func (ChallengeEntity) TableName() string { diff --git a/code/go/0chain.net/blobbercore/challenge/protocol.go b/code/go/0chain.net/blobbercore/challenge/protocol.go index 1c297fdf3..67a853300 100644 --- a/code/go/0chain.net/blobbercore/challenge/protocol.go +++ b/code/go/0chain.net/blobbercore/challenge/protocol.go @@ -48,7 +48,7 @@ type ChallengeResponse struct { func (cr *ChallengeEntity) CancelChallenge(ctx context.Context, errReason error) { cancellation := time.Now() db := datastore.GetStore().GetTransaction(ctx) - deleteChallenge(int64(cr.CreatedAt)) + deleteChallenge(cr.RoundCreatedAt) cr.Status = Cancelled cr.StatusMessage = errReason.Error() cr.UpdatedAt = cancellation.UTC() diff --git a/code/go/0chain.net/blobbercore/challenge/worker.go b/code/go/0chain.net/blobbercore/challenge/worker.go index 4afc61c56..4c2b01d6f 100644 --- a/code/go/0chain.net/blobbercore/challenge/worker.go +++ b/code/go/0chain.net/blobbercore/challenge/worker.go @@ -81,6 +81,8 @@ func challengeProcessor(ctx context.Context) { return case it := <-toProcessChallenge: + + logging.Logger.Info("processing_challenge", zap.Any("challenge_id", it.ChallengeID)) if ok := it.createChallenge(); !ok { continue } @@ -142,7 +144,7 @@ func commitOnChainWorker(ctx context.Context) { }() err := challenge.VerifyChallengeTransaction(txn) if err == nil || err != ErrEntityNotFound { - deleteChallenge(int64(challenge.CreatedAt)) + deleteChallenge(int64(challenge.RoundCreatedAt)) } }(&chall) } @@ -175,11 +177,11 @@ func getBatch(batchSize int) (chall []ChallengeEntity) { func (it *ChallengeEntity) createChallenge() bool { challengeMapLock.Lock() - if _, ok := challengeMap.Get(int64(it.CreatedAt)); ok { + if _, ok := challengeMap.Get(it.RoundCreatedAt); ok { challengeMapLock.Unlock() return false } - challengeMap.Put(int64(it.CreatedAt), it) + challengeMap.Put(it.RoundCreatedAt, it) challengeMapLock.Unlock() return true } diff --git a/goose/migrations/001_blobber_meta.sql b/goose/migrations/001_blobber_meta.sql index 7b5d72ec1..9eb80ae34 100644 --- a/goose/migrations/001_blobber_meta.sql +++ b/goose/migrations/001_blobber_meta.sql @@ -140,6 +140,7 @@ CREATE TABLE public.challenges ( object_path jsonb, sequence bigint, "timestamp" bigint DEFAULT 0 NOT NULL, + round_created_at bigint, created_at bigint, updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL ); From 37b1a6cd2a5203b9da3c90e9dc98cdab862e683c Mon Sep 17 00:00:00 2001 From: Ebrahim Gomaa Date: Tue, 25 Jul 2023 19:49:14 +0300 Subject: [PATCH 4/4] Fix/remove postgres post (#1176) * Add path in thumbnail hash (#1098) * get path from changes * pass rootRef in apply changes * add logs * fix deletechange * fix multi op and copy * fix delete root dir * fix delete root change * fix lint issue * cleanup and stats change * rename func to processMove * calculate object tree in ref path * rmv return from deleteChange * revert changes * move to filestore changes * check prevRoot * add logs and condition * check filestore * requested changes * validate nil proof * add move and copy dir tests * add logs * use path to add child * fix error log * fix add child * add proof log * add more logs * change read log * log objectPath * add commit logs * commit thumbnail first * add missing param * add missing param * add path in the thumbnail hash * add allocID and validation root index * use write * add condn in count query * rmv thumbnail_filename * log wm * cleanup * add rollback wm check * allow empty allocation root * fix tests * check path in upload * fix check * empty commit --------- Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: Yury * Dep/update (#1153) * dependencies update * dependencies update * Remove fileID from fileMetaHash (#1114) * rmv fileID from hash calc * Trigger Build * adding false commit to restart systemtests * add path in fileMetaHash * empty commit --------- Co-authored-by: Yury Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com> Co-authored-by: boddumanohar Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> * optimize image (#1148) Co-authored-by: boddumanohar * once for logger init * Update challenge timing submission (#1140) * update challenge timing submission * fix createdAt in challenge timing table --------- Co-authored-by: Yury * Fix blobber size (#1163) * Do not redeem readmarkers for free reads (#1166) * do not redeem readmarkers for free reads * fix unit tests, remove readmarker handling from download method * once for logger init (#1156) * once for logger init * init logging the same way we do in 0chain * init logging the same way we do in 0chain * Hotfix/map concurrent write (#1158) * once for logger init * wider locking window * Hotfix/remove custom nonce (#1141) * removed custom nonce managing logic * fixed logging * updated gosdk * uncommented previous nonce logic * uncommented previous nonce logic * uncommented previous nonce logic * uncommented previous nonce logic * Use single file to avoid maintaining multiple version of same file (#1160) * Use single file to avoid maintaining multiple version of same file * Fix config path * Remove variable * Update path variable for blobber service --------- Co-authored-by: Yury * fix consume quota lock (#1173) * Fix rm and wm timestamp (#1162) * once for logger init * init logging the same way we do in 0chain * init logging the same way we do in 0chain * add lastChallengeTime log * empty commit * refactor timestamp check in markers * Add diff txn for move to filestore * return if duplicate --------- Co-authored-by: dabasov * fixed gitactions fix issue * remove printing private key in logs (#1161) Co-authored-by: Yury * Fix concurrent upload issue (#1174) * Fix concurrent upload issue * Fix concurrent upload issue * Fix/concurrent upload issue (#1175) * Fix concurrent upload issue * Fix concurrent upload issue * Fix concurrent upload issue * Fix concurrent upload issue * remove from docker compose files * remove reference to postgres-post * remove in conductor docker compose * remove useless changes --------- Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com> Co-authored-by: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Co-authored-by: Yury Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com> Co-authored-by: boddumanohar Co-authored-by: Manali-Jain-squareops <86873900+Manali-Jain-squareops@users.noreply.github.com> Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Co-authored-by: stewartie4 Co-authored-by: Dinmukhammed <52813950+din-mukhammed@users.noreply.github.com> Co-authored-by: Laxmi Prasad Oli Co-authored-by: root --- docker.local/b0docker-compose-debug.yml | 16 ---------------- docker.local/b0docker-compose-github.yml | 12 ------------ docker.local/b0docker-compose.yml | 17 ----------------- docker.local/docker-compose.yml | 18 ------------------ docker.local/https.docker-compose.yml | 19 +------------------ 5 files changed, 1 insertion(+), 81 deletions(-) diff --git a/docker.local/b0docker-compose-debug.yml b/docker.local/b0docker-compose-debug.yml index 4b39e5194..99d577073 100644 --- a/docker.local/b0docker-compose-debug.yml +++ b/docker.local/b0docker-compose-debug.yml @@ -14,26 +14,10 @@ services: - ./sql_init:/docker-entrypoint-initdb.d networks: default: - postgres-post: - image: postgres:14 - environment: - POSTGRES_PORT: 5432 - POSTGRES_HOST: postgres - POSTGRES_USER: postgres - volumes: - - ../bin:/blobber/bin - - ../sql:/blobber/sql - command: bash /blobber/bin/postgres-entrypoint.sh - links: - - postgres:postgres validator: image: validator environment: - DOCKER= true - depends_on: - - postgres-post - links: - - postgres-post:postgres-post volumes: - ../config:/validator/config - ./blobber${BLOBBER}/data:/validator/data diff --git a/docker.local/b0docker-compose-github.yml b/docker.local/b0docker-compose-github.yml index a8e82ce93..838981ebf 100644 --- a/docker.local/b0docker-compose-github.yml +++ b/docker.local/b0docker-compose-github.yml @@ -14,18 +14,6 @@ services: - ./sql_init:/docker-entrypoint-initdb.d networks: default: - postgres-post: - image: postgres:14 - environment: - POSTGRES_PORT: 5432 - POSTGRES_HOST: postgres - POSTGRES_USER: postgres - volumes: - - ../bin:/blobber/bin - - ../sql:/blobber/sql - command: bash /blobber/bin/postgres-entrypoint.sh - links: - - postgres:postgres networks: default: diff --git a/docker.local/b0docker-compose.yml b/docker.local/b0docker-compose.yml index fee51770a..05bc5aa32 100644 --- a/docker.local/b0docker-compose.yml +++ b/docker.local/b0docker-compose.yml @@ -14,27 +14,10 @@ services: - ./sql_init:/docker-entrypoint-initdb.d networks: default: - postgres-post: - image: postgres:14 - environment: - POSTGRES_PORT: 5432 - POSTGRES_HOST: postgres - POSTGRES_USER: postgres - POSTGRES_PASSWORD: secret - volumes: - - ../bin:/blobber/bin - - ../sql:/blobber/sql - command: bash /blobber/bin/postgres-entrypoint.sh - links: - - postgres:postgres validator: image: validator environment: - DOCKER= true - depends_on: - - postgres-post - links: - - postgres-post:postgres-post volumes: - ${CONFIG_PATH:-../config}:/validator/config #value after :- is default value - ./blobber${BLOBBER}/data:/validator/data diff --git a/docker.local/docker-compose.yml b/docker.local/docker-compose.yml index 6ff4cfb98..56d4cb4d4 100644 --- a/docker.local/docker-compose.yml +++ b/docker.local/docker-compose.yml @@ -11,28 +11,10 @@ services: - "543${BLOBBER}:5432" labels: zchain: "postgres" - postgres-post: - image: postgres:14 - environment: - POSTGRES_PORT: 5432 - POSTGRES_HOST: postgres - POSTGRES_USER: postgres - volumes: - - ../bin:/blobber/bin - - ../sql:/blobber/sql - labels: - zchain: "postgres-post" - command: bash /blobber/bin/postgres-entrypoint.sh - links: - - postgres:postgres validator: image: validator environment: - DOCKER= true - depends_on: - - postgres-post - links: - - postgres-post:postgres-post volumes: - ../config:/validator/config - ./blobber${BLOBBER}/data:/validator/data diff --git a/docker.local/https.docker-compose.yml b/docker.local/https.docker-compose.yml index a2cf562bc..bd146aee6 100644 --- a/docker.local/https.docker-compose.yml +++ b/docker.local/https.docker-compose.yml @@ -4,34 +4,17 @@ services: image: postgres:14 volumes: - ./blobber${BLOBBER}/data/postgresql:/var/lib/postgresql/data + - ./sql_init:/docker-entrypoint-initdb.d networks: default: ports: - "543${BLOBBER}:5432" labels: zchain: "postgres" - postgres-post: - image: postgres:14 - environment: - POSTGRES_PORT: 5432 - POSTGRES_HOST: postgres - POSTGRES_USER: postgres - volumes: - - ../bin:/blobber/bin - - ../sql:/blobber/sql - labels: - zchain: "postgres-post" - command: bash /blobber/bin/postgres-entrypoint.sh - links: - - postgres:postgres validator: image: validator environment: - DOCKER= true - depends_on: - - postgres-post - links: - - postgres-post:postgres-post volumes: - ../config:/validator/config - ./blobber${BLOBBER}/data:/validator/data