Skip to content

Commit

Permalink
Merge branch 'staging' into sprint-1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayashsatolia403 authored Nov 1, 2024
2 parents 533ee14 + 58fc68a commit edddb25
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/build-&-publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,30 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# - name: Login to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}

# - name: Get changed files using defaults
# id: changed-files
# uses: tj-actions/[email protected]

- name: Pull Build Base
env:
DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
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')
env:
DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
./docker.local/bin/build.base.sh &&
Expand All @@ -82,7 +88,10 @@ jobs:
docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA
- name: Build blobber
env:
DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
export DOCKER_IMAGE_BASE="$BLOBBER_BUILD_BASE_REGISTRY:$TAG"
export DOCKER_IMAGE_SWAGGER="${BLOBBER_REGISTRY}:swagger_test"
Expand Down Expand Up @@ -123,11 +132,11 @@ jobs:
# with:
# go-version: ^1.21 # The Go version to download (if necessary) and use.

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# - name: Login to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Clone blobber
uses: actions/checkout@v3
Expand All @@ -144,13 +153,19 @@ jobs:
# fetch-depth: 0

- name: Pull Build Base
env:
DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
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')
env:
DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
./docker.local/bin/build.base.sh
Expand All @@ -160,7 +175,10 @@ jobs:
docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA
- name: Build validator
env:
DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }}
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8)
export DOCKER_IMAGE_BASE="$BLOBBER_BUILD_BASE_REGISTRY:$TAG"
# export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push"
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/readmarker/authticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (authToken *AuthTicket) Verify(allocationObj *allocation.Allocation, client
if authToken.OwnerID != allocationObj.OwnerID {
return common.NewError("invalid_parameters", "Invalid auth ticket. Owner ID mismatch")
}
if authToken.Timestamp > (common.Now() + 2) {
if authToken.Timestamp > (common.Now() + 120) {
return common.NewError("invalid_parameters", "Invalid auth ticket. Timestamp in future")
}

Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/reference/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func GetReferenceByLookupHashForDownload(ctx context.Context, allocationID, path
func GetReferencesByName(ctx context.Context, allocationID, name string) (refs []*Ref, err error) {
db := datastore.GetStore().GetTransaction(ctx)
err = db.Model(&Ref{}).
Where("allocation_id = ? AND name LIKE ?", allocationID, "%"+name+"%").
Where("allocation_id = ? AND name ILIKE ?", allocationID, "%"+name+"%").
Limit(20).
Find(&refs).Error
if err != nil {
Expand Down

0 comments on commit edddb25

Please sign in to comment.