From 19e32e0ac713a04a1718f3ce79a58502ace5a979 Mon Sep 17 00:00:00 2001 From: LexLuthr <88259624+LexLuthr@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:41:40 +0400 Subject: [PATCH] chore: switch to Github Actions (#1933) * add github actions * fix attempt 1 * fix attempt 2 * fix attempt 3 * fix attempt 4 * fix attempt 5 * fix attempt 6 * fix attempt 7 * fix attempt 8 * fix attempt 9 * fix attempt 10 * fix attempt 11 * fix attempt 12 * fix attempt 13 * fix attempt 14 * fix attempt 15 * fix attempt 16 * fix attempt 17 * fix lint errors * make deps for lint * fix fmt * test self-hosted * self-hosted runner 1 * self-hosted runner 2 * self-hosted runner 3 * self-hosted runner 4 * self-hosted runner 5 * add CI linter, yugabyte cleanup * add setup files * disable shellcheck * fix systemd file * update setup instructions * test without go cache --- .github/actionlint.yaml | 4 + .github/actions/container-builder/action.yaml | 48 --- .github/actions/install-deps/action.yml | 24 ++ .github/actions/setup-go/action.yml | 16 + .github/image/Dockerfile | 74 ++++ .github/utils/boost-github-actions-runner.env | 7 + .github/utils/create-runner-image.sh | 33 ++ .github/utils/curio-github-actions-runner.env | 7 + .github/utils/github-actions-runner.service | 19 + .github/utils/setup.md | 77 ++++ .github/workflows/ci.yml | 332 ++++++++++++++++++ .github/workflows/container-build.yml | 71 ---- .../workflows/{main.yml => issue-project.yml} | 0 .github/workflows/label-syncer.yml | 2 +- cmd/boost/retrieve_cmd.go | 24 +- go.work.sum | 3 + piecedirectory/piece_directory_test.go | 4 +- 17 files changed, 610 insertions(+), 135 deletions(-) create mode 100644 .github/actionlint.yaml delete mode 100644 .github/actions/container-builder/action.yaml create mode 100644 .github/actions/install-deps/action.yml create mode 100644 .github/actions/setup-go/action.yml create mode 100644 .github/image/Dockerfile create mode 100644 .github/utils/boost-github-actions-runner.env create mode 100644 .github/utils/create-runner-image.sh create mode 100644 .github/utils/curio-github-actions-runner.env create mode 100644 .github/utils/github-actions-runner.service create mode 100644 .github/utils/setup.md create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/container-build.yml rename .github/workflows/{main.yml => issue-project.yml} (100%) diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 000000000..cbf602581 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,4 @@ +self-hosted-runner: + # Labels of self-hosted runner in array of string + labels: + - docker \ No newline at end of file diff --git a/.github/actions/container-builder/action.yaml b/.github/actions/container-builder/action.yaml deleted file mode 100644 index 93fa70ccb..000000000 --- a/.github/actions/container-builder/action.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build -description: Build tag and optionally push container images -inputs: - name: - required: true - type: string - target: - required: false - type: string - file: - required: false - type: string - context: - required: false - type: string - default: '.' - build-args: - required: false - type: string - push: - required: false - type: boolean - default: false -runs: - using: "composite" - steps: - - name: Extract metadata for ${{ inputs.name }} - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/${{ github.repository }} - flavor: latest=false - tags: | - type=semver,pattern={{version}},prefix=${{ inputs.name }}- - type=ref,event=branch,prefix=${{ inputs.name }}- - type=sha,prefix=${{ inputs.name }}- - - name: Build ${{ inputs.name }} - uses: docker/build-push-action@v4 - with: - context: ${{ inputs.context }} - cache-from: type=gha,scope=${{ inputs.name }} - cache-to: type=gha,mode=max,scope=${{ inputs.name }} - push: ${{ inputs.push }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - file: ${{ inputs.file }} - target: ${{ inputs.target }} - build-args: ${{ inputs.build-args }} diff --git a/.github/actions/install-deps/action.yml b/.github/actions/install-deps/action.yml new file mode 100644 index 000000000..218ca72c7 --- /dev/null +++ b/.github/actions/install-deps/action.yml @@ -0,0 +1,24 @@ +name: 'Install Dependencies' +description: 'Install common dependencies' + +runs: + using: 'composite' + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y openssh-client git ocl-icd-opencl-dev libhwloc-dev + shell: bash + + - name: Fetch all tags + run: git fetch --all + shell: bash + + - name: Sync submodules + run: git submodule sync + shell: bash + + - name: Update submodules + run: git submodule update --init + shell: bash + diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml new file mode 100644 index 000000000..b23c1bea5 --- /dev/null +++ b/.github/actions/setup-go/action.yml @@ -0,0 +1,16 @@ +name: 'Setup Go' +description: 'Setup Go environment' + +inputs: + go-version: + description: 'Go version to use' + required: true + +runs: + using: 'composite' + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ inputs.go-version }} + cache: false diff --git a/.github/image/Dockerfile b/.github/image/Dockerfile new file mode 100644 index 000000000..b6b6486c1 --- /dev/null +++ b/.github/image/Dockerfile @@ -0,0 +1,74 @@ +## This image is used to github action runner for this repo +# Use the official Golang image as the base image +FROM golang:1.22-bullseye AS builder + +# Set the working directory inside the container +WORKDIR /app + +# Install Git +RUN apt-get update && apt-get install -y git + +# Clone the repositories +RUN git clone https://github.com/filecoin-project/boost.git +RUN git clone https://github.com/filecoin-project/curio.git + +# Download Go dependencies for Boost +WORKDIR /app/boost +RUN git submodule update --init +RUN go mod download + +# Download Go dependencies for Curio +WORKDIR /app/boost +RUN git submodule update --init +RUN go mod download + +# Stage 2: Install Lotus binary +FROM ghcr.io/filecoin-shipyard/lotus-containers:lotus-v1.28.1-devnet AS lotus-test + +# Stage 3: Build the final image +FROM myoung34/github-runner AS curio-github-runner + +# Copy Go dependencies from the builder stage +COPY --from=builder /go/pkg /go/pkg +COPY --from=builder /go/bin /go/bin +COPY --from=lotus-test /usr/local/bin/lotus /usr/local/bin/ + +RUN apt update && apt install -y \ + build-essential \ + bzr pkg-config \ + clang \ + curl \ + gcc git \ + hwloc \ + jq \ + libhwloc-dev wget \ + mesa-opencl-icd \ + ocl-icd-opencl-dev + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.76.0 + +RUN set -eux; \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \ + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \ + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \ + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \ + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ + esac; \ + url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \ + wget "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + rustup --version; \ + cargo --version; \ + rustc --version; + +# Allow attaching a volume for the specified path +VOLUME /var/tmp/filecoin-proof-parameters diff --git a/.github/utils/boost-github-actions-runner.env b/.github/utils/boost-github-actions-runner.env new file mode 100644 index 000000000..aa03c63ad --- /dev/null +++ b/.github/utils/boost-github-actions-runner.env @@ -0,0 +1,7 @@ +RUNNER_SCOPE=repo +REPO_URL=https://github.com/filecoin-project/boost +LABELS=docker +ACCESS_TOKEN= +RUNNER_WORKDIR=/tmp/runner/work +DISABLE_AUTO_UPDATE=1 +EPHEMERAL=1 \ No newline at end of file diff --git a/.github/utils/create-runner-image.sh b/.github/utils/create-runner-image.sh new file mode 100644 index 000000000..a641c154d --- /dev/null +++ b/.github/utils/create-runner-image.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Directory where the GitHub Action runner will be set up +RUNNER_DIR="/tmp/github-runner" + +# Clone the necessary repositories and set up the runner +setup_github_runner() { + # Remove any existing directory + rm -rf $RUNNER_DIR + + # Create the directory + mkdir -p $RUNNER_DIR + + # Navigate to the directory + # shellcheck disable=SC2164 + cd $RUNNER_DIR + + # Clone the required repositories + git clone https://github.com/filecoin-project/curio.git + git clone https://github.com/filecoin-project/boost.git + + # Copy necessary files + cp -r boost/.github/utils/* . + + # Copy the Dockerfile + cp boost/.github/image/Dockerfile . + + # Build the Docker image + docker buildx build -t curio/github-runner:latest . +} + +# Execute the function +setup_github_runner diff --git a/.github/utils/curio-github-actions-runner.env b/.github/utils/curio-github-actions-runner.env new file mode 100644 index 000000000..0daa20499 --- /dev/null +++ b/.github/utils/curio-github-actions-runner.env @@ -0,0 +1,7 @@ +RUNNER_SCOPE=repo +REPO_URL=https://github.com/filecoin-project/curio +LABELS=docker +ACCESS_TOKEN= +RUNNER_WORKDIR=/tmp/runner/work +DISABLE_AUTO_UPDATE=1 +EPHEMERAL=1 \ No newline at end of file diff --git a/.github/utils/github-actions-runner.service b/.github/utils/github-actions-runner.service new file mode 100644 index 000000000..11798043c --- /dev/null +++ b/.github/utils/github-actions-runner.service @@ -0,0 +1,19 @@ +[Unit] +Description=Ephemeral GitHub Actions Runner Container +After=docker.service +Requires=docker.service +[Service] +TimeoutStartSec=0 +Restart=always +ExecStartPre=-/usr/bin/docker stop github-runnerNUM +ExecStartPre=-/usr/bin/docker rm github-runnerNUM +#ExecStartPre=-/usr/bin/docker pull curio/github-runner:latest +ExecStart=/usr/bin/docker run --rm \ + --env-file /etc/curio-github-actions-runner.env \ + -e RUNNER_NAME=docker-runnerNUM \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /opt/filecoin-proof-parameters:/var/tmp/filecoin-proof-parameters \ + --name github-runnerNUM \ + curio/github-runner:latest +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/.github/utils/setup.md b/.github/utils/setup.md new file mode 100644 index 000000000..aafa6c743 --- /dev/null +++ b/.github/utils/setup.md @@ -0,0 +1,77 @@ +## How to set up Github Action runner +1. Clone this repo and copy out the files in this directory to one level above +```shell +mkdir github-runner + +cd github-runner + +git clone https://github.com/filecoin-project/curio.git +git clone https://github.com/filecoin-project/boost.git + +cp -r boost/.github/utils/* . +``` +2. Copy the Dockerfile + +```shell +copy boost/.github/image/Dockerfile . +``` + +3. Create new image + +```shell +docker buildx build -t curio/github-runner:latest . +``` + +4. Create systemd file. Please ensure to equal number files for Boost and Curio. If server can host 10 runner then 5 should be for Boost and 5 for Curio. + +```shell +for i in {1..5}; do cat github-actions-runner.service | sed "s/NUM/$i/g" > github-actions-runner$i.service; done +for i in {6..10}; do cat github-actions-runner.service | sed 's/curio-/boost-/g' | sed "s/NUM/$i/g" > github-actions-runner$i.service; done +for i in {1..10}; do install -m 644 github-actions-runner$i.service /etc/systemd/system/ ; done +systemctl daemon-reload +``` +5. Add the token to ENV files +6. Copy the ENV files to /etc + +```shell +cp boost-github-actions-runner.env +cp curio-github-actions-runner.env +``` + +7. Start and Enable the services +```shell +for i in {1..10}; do systemctl start github-actions-runner$i.service; done +for i in {1..10}; do systemctl status github-actions-runner$i.service; done +for i in {1..10}; do systemctl enable github-actions-runner$i.service; done +``` + +8. Verify that new runners are visible in the repo. + +## Set up docker image creator +1. Make the script executable +```shell +cd github-runner +chmod +x create-runner-image.sh +``` +2. Create a cron job to update the image every day +```shell +crontab -e +``` + +```shell +0 0 * * * /root/github-runner/create-runner-image.sh +``` + +## Github Token +Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected: + +```text +repo (all) +admin:public_key - read:public_key +admin:repo_hook - read:repo_hook +admin:org_hook +notifications +workflow +``` + +## This setup is based in the https://github.com/myoung34/docker-github-actions-runner \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..ceaaf4d49 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,332 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + GO_VERSION: 1.22.3 + +jobs: + ci-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install actionlint + run: go install github.com/rhysd/actionlint/cmd/actionlint@latest + + - name: Run actionlint + run: actionlint -shellcheck= -pyflakes= + + setup-params: + runs-on: [self-hosted, docker] + needs: [ci-lint] + steps: + - name: Fetch parameters + run: lotus fetch-params 8388608 + shell: bash + + build-all: + runs-on: [self-hosted, docker] + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Install FFI + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + make deps + shell: bash + + - name: Build Go + run: make build-go + shell: bash + + test: + runs-on: [self-hosted, docker] + needs: [setup-params] + strategy: + matrix: + test-suite: + - name: test-itest-dummydeal_offline + target: "./itests/dummydeal_offline_test.go" + - name: test-itest-dummydeal + target: "./itests/dummydeal_test.go" + - name: test-graphsync_identity_cid + target: "./itests/graphsync_identity_cid_test.go" + - name: test-itest-retrieval + target: "./itests/graphsync_retrieval_test.go" + - name: test-itest-direct_deal + target: "./itests/ddo_test.go" + - name: test-all + target: "`go list ./... | grep -v boost/db | grep -v boost/storagemarket | grep -v boost/itests | grep -v cmd/booster-http | grep -v cmd/booster-bitswap`" + - name: test-itest-data-segment-index + target: "./itests/data_segment_index_retrieval_test.go" + - name: test-itest-ipni + target: "./itests/ipni_publish_test.go" + - name: test-itest-multiminer-graphsync + target: "./itests/multiminer_retrieval_graphsync_test.go" + - name: test-booster-http + target: "./cmd/booster-http" + - name: test-booster-bitswap + target: "./cmd/booster-bitswap" + - name: test-itest-lid-cleanup + target: "./itests/lid_cleanup_test.go" + - name: test-provider + target: "./storagemarket" + - name: test-sql-db + target: "./db" + + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Install FFI + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + make deps + shell: bash + + - name: Run tests + run: | + go test -v --tags=debug -timeout 30m ${{ matrix.test-suite.target }} + shell: bash + + lint: + runs-on: ubuntu-latest + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Install FFI + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + make deps + shell: bash + + - name: Install golangci-lint + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1 + shell: bash + + - name: Lint + run: | + golangci-lint run -v --timeout 15m + shell: bash + + gofmt: + runs-on: ubuntu-latest + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Check gofmt + run: | + go fmt ./... + shell: bash + + - name: Git diff check + run: git --no-pager diff + shell: bash + + - name: Git diff quiet + run: git --no-pager diff --quiet + shell: bash + + cbor-check: + runs-on: ubuntu-latest + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports + shell: bash + + - name: Install cbor-gen-for + run: go install github.com/hannahhoward/cbor-gen-for + shell: bash + + - name: Generate CBOR + run: make cbor-gen + shell: bash + + - name: Git diff check + run: git --no-pager diff + shell: bash + + - name: Git diff quiet + run: git --no-pager diff --quiet + shell: bash + + docs-check: + runs-on: ubuntu-latest + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports + shell: bash + + - name: Generate Docs + run: make docsgen + shell: bash + + - name: Git diff check + run: git --no-pager diff + shell: bash + + - name: Git diff quiet + run: git --no-pager diff --quiet + shell: bash + + gen-check: + runs-on: ubuntu-latest + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports + shell: bash + + - name: Install cbor-gen-for + run: go install github.com/hannahhoward/cbor-gen-for + shell: bash + + - name: Generate Code + run: make gen + shell: bash + + - name: Git diff check + run: git --no-pager diff + shell: bash + + - name: Git diff quiet + run: git --no-pager diff --quiet + shell: bash + + lid-docker-compose: + runs-on: [self-hosted, docker] + needs: [setup-params] + env: + CONTAINER_NAME: yugabyte-${{ github.run_id }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Start YugabyteDB + run: docker run --rm --name ${{ env.CONTAINER_NAME }} -d -p 5433:5433 yugabytedb/yugabyte:2.21.1.0-b271 bin/yugabyted start --daemon=false + shell: bash + - run: | + while true; do + status=$(docker exec ${{ env.CONTAINER_NAME }} bin/yugabyted status); + echo $status; + echo $status | grep Running && break; + sleep 1; + done + shell: bash + + - run: | + cd extern/boostd-data + go test -v ./... + + - name: Clean up YugabyteDB + if: always() + run: docker stop ${{ env.CONTAINER_NAME }} + shell: bash + + mod-tidy-check: + runs-on: ubuntu-latest + needs: [ci-lint] + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: ./.github/actions/setup-go + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies + uses: ./.github/actions/install-deps + + - name: Run mod tidy check + run: go mod tidy -v + shell: bash diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml deleted file mode 100644 index e09cfd63b..000000000 --- a/.github/workflows/container-build.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Build - -on: - push: - branches: - - 'main' - tags: - - 'v*' - pull_request: - -jobs: - build: - name: Containers - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - env: - LOTUS_VERSION: 'v1.27.0' - LOTUS_SOURCE_IMAGE: 'ghcr.io/filecoin-shipyard/lotus-containers:lotus' - NETWORK_NAME: 'devnet' - FFI_BUILD_FROM_SOURCE: '0' - DOCKER_BUILDKIT: '1' - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Update Boost modules - run: make build/.update-modules - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - platforms: linux/amd64,linux/arm64 - - name: Log in to the Container registry - uses: docker/login-action@v2 - if: ${{ github.event_name != 'pull_request' }} - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build boost-dev - uses: ./.github/actions/container-builder - with: - name: boost-dev - file: docker/devnet/Dockerfile.source - target: boost-dev - push: ${{ github.event_name != 'pull_request' }} - build-args: | - LOTUS_TEST_IMAGE=${{ env.LOTUS_SOURCE_IMAGE }}-${{ env.LOTUS_VERSION }}-${{ env.NETWORK_NAME }} - FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }} - - name: Build booster-http-dev - uses: ./.github/actions/container-builder - with: - name: booster-http-dev - file: docker/devnet/Dockerfile.source - target: booster-http-dev - push: ${{ github.event_name != 'pull_request' }} - build-args: | - LOTUS_TEST_IMAGE=${{ env.LOTUS_SOURCE_IMAGE }}-${{ env.LOTUS_VERSION }}-${{ env.NETWORK_NAME }} - FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }} - - name: Build booster-bitswap-dev - uses: ./.github/actions/container-builder - with: - name: booster-bitswap-dev - file: docker/devnet/Dockerfile.source - target: booster-bitswap-dev - push: ${{ github.event_name != 'pull_request' }} - build-args: | - LOTUS_TEST_IMAGE=${{ env.LOTUS_SOURCE_IMAGE }}-${{ env.LOTUS_VERSION }}-${{ env.NETWORK_NAME }} - FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }} diff --git a/.github/workflows/main.yml b/.github/workflows/issue-project.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/issue-project.yml diff --git a/.github/workflows/label-syncer.yml b/.github/workflows/label-syncer.yml index aa9bd2358..531cedc71 100644 --- a/.github/workflows/label-syncer.yml +++ b/.github/workflows/label-syncer.yml @@ -10,7 +10,7 @@ jobs: name: Sync labels runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: micnncim/action-label-syncer@v1.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cmd/boost/retrieve_cmd.go b/cmd/boost/retrieve_cmd.go index 9f7dd4491..c225cdd01 100644 --- a/cmd/boost/retrieve_cmd.go +++ b/cmd/boost/retrieve_cmd.go @@ -216,7 +216,7 @@ var retrieveCmd = &cli.Command{ return fmt.Errorf("Failed to retrieve content with candidate miner %s: %v", miner, err) } - printRetrievalStats(&FILRetrievalStats{RetrievalStats: *stats}) + printRetrievalStats(&FILRetrievalStats{RStats: *stats}) dservOffline := merkledag.NewDAGService(blockservice.New(bstore, offline.Exchange(bstore))) @@ -296,19 +296,19 @@ type RetrievalStats interface { } type FILRetrievalStats struct { - rc.RetrievalStats + RStats rc.RetrievalStats } func (stats *FILRetrievalStats) GetByteSize() uint64 { - return stats.Size + return stats.RStats.Size } func (stats *FILRetrievalStats) GetDuration() time.Duration { - return stats.Duration + return stats.RStats.Duration } func (stats *FILRetrievalStats) GetAverageBytesPerSecond() uint64 { - return stats.AverageSpeed + return stats.RStats.AverageSpeed } func printProgress(bytesReceived uint64) { @@ -345,13 +345,13 @@ Total Payment: %v (%v) Num Payments: %v Peer: %v `, - stats.Size, humanize.IBytes(stats.Size), - stats.Duration, - stats.AverageSpeed, humanize.IBytes(stats.AverageSpeed), - stats.AskPrice, types.FIL(stats.AskPrice), - stats.TotalPayment, types.FIL(stats.TotalPayment), - stats.NumPayments, - stats.Peer, + stats.RStats.Size, humanize.IBytes(stats.RStats.Size), + stats.RStats.Duration, + stats.RStats.AverageSpeed, humanize.IBytes(stats.RStats.AverageSpeed), + stats.RStats.AskPrice, types.FIL(stats.RStats.AskPrice), + stats.RStats.TotalPayment, types.FIL(stats.RStats.TotalPayment), + stats.RStats.NumPayments, + stats.RStats.Peer, ) } } diff --git a/go.work.sum b/go.work.sum index cdad2d282..f2a495f36 100644 --- a/go.work.sum +++ b/go.work.sum @@ -2813,6 +2813,8 @@ go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/ go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= go.opentelemetry.io/otel/bridge/opencensus v0.39.0 h1:YHivttTaDhbZIHuPlg1sWsy2P5gj57vzqPfkHItgbwQ= go.opentelemetry.io/otel/bridge/opencensus v0.39.0/go.mod h1:vZ4537pNjFDXEx//WldAR6Ro2LC8wwmFC76njAXwNPE= +go.opentelemetry.io/otel/bridge/opencensus v1.28.0 h1:/BcyAV1bUJjSVxoeKwTQL9cS4X1iC6izZ9mheeuVSCU= +go.opentelemetry.io/otel/bridge/opencensus v1.28.0/go.mod h1:FZp2xE+46yAyp3DfLFALze58nY0iIE8zs+mCgkPAzq0= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0/go.mod h1:M1hVZHNxcbkAlcvrOMlpQ4YOO3Awf+4N2dxkZL3xm04= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= @@ -3042,6 +3044,7 @@ golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2 golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852 h1:xYq6+9AtI+xP3M4r0N1hCkHrInHDBohhquRgx9Kk6gI= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/piecedirectory/piece_directory_test.go b/piecedirectory/piece_directory_test.go index fb8584d04..7e3e9c6fb 100644 --- a/piecedirectory/piece_directory_test.go +++ b/piecedirectory/piece_directory_test.go @@ -24,11 +24,9 @@ func TestSegmentParsing(t *testing.T) { rd, err := os.Open("testdata/segment.car") require.NoError(t, err) - recs, err := parsePieceWithDataSegmentIndex(pieceCid, carSize, rd) + _, err = parsePieceWithDataSegmentIndex(pieceCid, carSize, rd) require.NoError(t, err) - t.Log(recs) - err = rd.Close() require.NoError(t, err) }