Skip to content

Commit

Permalink
Merge branch 'pj/update-cli-usage' of github.com:SiaFoundation/renter…
Browse files Browse the repository at this point in the history
…d into pj/update-cli-usage
  • Loading branch information
peterjan committed May 16, 2024
2 parents 1bea38a + 9e2358e commit e5722aa
Show file tree
Hide file tree
Showing 42 changed files with 1,123 additions and 286 deletions.
127 changes: 76 additions & 51 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -70,16 +70,20 @@ jobs:
strategy:
matrix:
network: ["mainnet" , "zen"]
arch: [ amd64, arm64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Setup
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
go generate ./...
if [ ${{ matrix.arch }} == "arm64" ]; then
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
fi
- name: Set build tag environment variable
run: |
if [[ "${{ matrix.network }}" == "zen" ]]; then
Expand All @@ -89,38 +93,41 @@ jobs:
echo "BUILD_TAGS=netgo" >> $GITHUB_ENV
echo "ZIP_OUTPUT_SUFFIX=" >> $GITHUB_ENV
fi
- name: Build amd64
- name: Build ${{ matrix.arch }}
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
GOARCH: ${{ matrix.arch }}
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd${{ env.ZIP_OUTPUT_SUFFIX }}_${GOOS}_${GOARCH}.zip
go build -tags="$BUILD_TAGS" -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: arm64
CC: aarch64-linux-gnu-gcc
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd${{ env.ZIP_OUTPUT_SUFFIX }}_${GOOS}_${GOARCH}.zip
go build -tags="$BUILD_TAGS" -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v3
- name: Get Release Asset
uses: actions/github-script@v7
id: get_release_asset
with:
name: renterd
script: |
const arch = context.matrix.arch,
network = context.matrix.network,
release = ['renterd', 'linux'];
if (network === 'zen')
release.push('zen');
release.push(arch);
return release.join('-');
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_payload.outputs.result }}
path: release/
build-mac:
runs-on: macos-latest
strategy:
matrix:
network: ["mainnet" , "zen"]
arch: [ amd64, arm64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -168,27 +175,7 @@ jobs:
echo "BUILD_TAGS=netgo" >> $GITHUB_ENV
echo "ZIP_OUTPUT_SUFFIX=" >> $GITHUB_ENV
fi
- name: Build amd64
env:
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_KEY_B64: ${{ secrets.APPLE_KEY_B64 }}
APPLE_CERT_B64: ${{ secrets.APPLE_CERT_B64 }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd${{ env.ZIP_OUTPUT_SUFFIX }}_${GOOS}_${GOARCH}.zip
go build -tags="$BUILD_TAGS" -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/renterd
cp README.md LICENSE bin/
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/renterd
ditto -ck bin $ZIP_OUTPUT
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- name: Build arm64
- name: Build ${{ matrix.arch }}
env:
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
Expand All @@ -199,7 +186,7 @@ jobs:
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
CGO_ENABLED: 1
GOOS: darwin
GOARCH: arm64
GOARCH: ${{ matrix.arch }}
run: |
mkdir -p release
ZIP_OUTPUT=release/renterd${{ env.ZIP_OUTPUT_SUFFIX }}_${GOOS}_${GOARCH}.zip
Expand All @@ -208,15 +195,30 @@ jobs:
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/renterd
ditto -ck bin $ZIP_OUTPUT
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- uses: actions/upload-artifact@v3
- name: Get Release Asset
uses: actions/github-script@v7
id: get_release_asset
with:
name: renterd
script: |
const arch = context.matrix.arch,
network = context.matrix.network,
release = ['renterd', 'darwin'];
if (network === 'zen')
release.push('zen');
release.push(arch);
return release.join('-');
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_payload.outputs.result }}
path: release/
build-windows:
runs-on: windows-latest
strategy:
matrix:
network: ["mainnet" , "zen"]
arch: [ amd64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -236,11 +238,11 @@ jobs:
run: |
dotnet tool install --global AzureSignTool
go generate ./...
- name: Build amd64
- name: Build ${{ matrix.arch }}
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: amd64
GOARCH: ${{ matrix.arch }}
shell: bash
run: |
mkdir -p release
Expand All @@ -249,14 +251,37 @@ jobs:
azuresigntool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v bin/renterd.exe
cp README.md LICENSE bin/
7z a $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v3
- name: Get Release Asset
uses: actions/github-script@v7
id: get_release_asset
with:
name: renterd
script: |
const arch = context.matrix.arch,
network = context.matrix.network,
release = ['renterd', 'windows'];
if (network === 'zen')
release.push('zen');
release.push(arch);
return release.join('-');
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_payload.outputs.result }}
path: release/

combine-release-assets:
runs-on: ubuntu-latest
needs: [ build-linux, build-mac, build-windows ]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: renterd-release-assets-combined

dispatch-homebrew: # only runs on full releases
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
needs: [docker, build-linux, build-mac, build-windows]
needs: [ build-mac ]
runs-on: ubuntu-latest
steps:
- name: Extract Tag Name
Expand All @@ -278,7 +303,7 @@ jobs:
}
dispatch-linux: # run on full releases, release candidates, and master branch
if: startsWith(github.ref, 'refs/tags/v') || endsWith(github.ref, 'master')
needs: [docker, build-linux, build-mac, build-windows]
needs: [ build-linux ]
runs-on: ubuntu-latest
steps:
- name: Build Dispatch Payload
Expand Down
2 changes: 2 additions & 0 deletions autopilot/contract_pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
)

var (
errInvalidHandshake = errors.New("couldn't read host's handshake")
errInvalidHandshakeSignature = errors.New("host's handshake signature was invalid")
errInvalidMerkleProof = errors.New("host supplied invalid Merkle proof")
)
Expand Down Expand Up @@ -73,6 +74,7 @@ func (pr pruneResult) toAlert() (id types.Hash256, alert *alerts.Alert) {
utils.IsErr(pr.err, utils.ErrConnectionTimedOut) ||
utils.IsErr(pr.err, utils.ErrConnectionResetByPeer) ||
utils.IsErr(pr.err, errInvalidHandshakeSignature) ||
utils.IsErr(pr.err, errInvalidHandshake) ||
utils.IsErr(pr.err, utils.ErrNoRouteToHost) ||
utils.IsErr(pr.err, utils.ErrNoSuchHost)); shouldTrigger {
alert = newContractPruningFailedAlert(pr.hk, pr.version, pr.fcid, pr.err)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
go.sia.tech/jape v0.11.2-0.20240124024603-93559895d640
go.sia.tech/mux v1.2.0
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca
go.sia.tech/web/renterd v0.52.0
go.sia.tech/web/renterd v0.52.1
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.23.0
golang.org/x/sys v0.20.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1650,8 +1650,8 @@ go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca h1:aZMg2AKevn7jKx+wlusWQf
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca/go.mod h1:h/1afFwpxzff6/gG5i1XdAgPK7dEY6FaibhK7N5F86Y=
go.sia.tech/web v0.0.0-20240422221546-c1709d16b6ef h1:X0Xm9AQYHhdd85yi9gqkkCZMb9/WtLwC0nDgv65N90Y=
go.sia.tech/web v0.0.0-20240422221546-c1709d16b6ef/go.mod h1:nGEhGmI8zV/BcC3LOCC5JLVYpidNYJIvLGIqVRWQBCg=
go.sia.tech/web/renterd v0.52.0 h1:LD57G2SOLFTD0yk/234szASFpsj868cxOgR49BGVyUA=
go.sia.tech/web/renterd v0.52.0/go.mod h1:SWwKoAJvLxiHjTXsNPKX3RLiQzJb/vxwcpku3F78MO8=
go.sia.tech/web/renterd v0.52.1 h1:iNoCyNosuJJE+J1LmOBMouUyzT5r1b/xEoBUPCCjR84=
go.sia.tech/web/renterd v0.52.1/go.mod h1:SWwKoAJvLxiHjTXsNPKX3RLiQzJb/vxwcpku3F78MO8=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
Expand Down
2 changes: 2 additions & 0 deletions internal/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func NewBus(cfg BusConfig, dir string, seed types.PrivateKey, l *zap.Logger) (ht
Logger: l.Sugar(),
GormLogger: dbLogger,
RetryTransactionIntervals: []time.Duration{200 * time.Millisecond, 500 * time.Millisecond, time.Second, 3 * time.Second, 10 * time.Second, 10 * time.Second},
LongQueryDuration: cfg.DatabaseLog.SlowThreshold,
LongTxDuration: cfg.DatabaseLog.SlowThreshold,
})
if err != nil {
return nil, nil, err
Expand Down
Loading

0 comments on commit e5722aa

Please sign in to comment.