diff --git a/.github/workflows/beta.yaml b/.github/workflows/beta.yaml deleted file mode 100644 index aeb7fd494..000000000 --- a/.github/workflows/beta.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# Run tests using the beta Rust compiler - -name: Beta Rust - -on: - schedule: - # 06:50 UTC every Monday - - cron: '50 6 * * 1' - workflow_dispatch: - -concurrency: - group: beta-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - IROH_FORCE_STAGING_RELAYS: "1" - -jobs: - tests: - uses: './.github/workflows/tests.yaml' - with: - rust-version: beta - notify: - needs: tests - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - name: Extract test results - run: | - printf '${{ toJSON(needs) }}\n' - result=$(echo '${{ toJSON(needs) }}' | jq -r .tests.result) - echo TESTS_RESULT=$result - echo "TESTS_RESULT=$result" >>"$GITHUB_ENV" - - name: Notify discord on failure - uses: n0-computer/discord-webhook-notify@v1 - if: ${{ env.TESTS_RESULT == 'failure' }} - with: - severity: error - details: | - Rustc beta tests failed - See https://github.com/n0-computer/iroh/actions/workflows/beta.yaml - webhookUrl: ${{ secrets.DISCORD_N0_GITHUB_CHANNEL_WEBHOOK_URL }} - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef9185282..7a89c00f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,54 +146,7 @@ jobs: run: cross test --all --target ${{ matrix.target }} -- --test-threads=12 env: RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG' }} - - - # wasm_build: - # name: Build wasm32 - # runs-on: ubuntu-latest - # steps: - # - name: Checkout sources - # uses: actions/checkout@v4 - - # - name: Install stable toolchain - # uses: dtolnay/rust-toolchain@stable - - # - name: Add wasm target - # run: rustup target add wasm32-unknown-unknown - - # - name: wasm32 build - # run: cargo build --all-features --target wasm32-unknown-unknown - - check_semver: - runs-on: ubuntu-latest - env: - RUSTC_WRAPPER: "sccache" - SCCACHE_GHA_ENABLED: "on" - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.6 - - - name: Setup Environment (PR) - if: ${{ github.event_name == 'pull_request' }} - shell: bash - run: | - echo "HEAD_COMMIT_SHA=$(git rev-parse origin/${{ github.base_ref }})" >> ${GITHUB_ENV} - - name: Setup Environment (Push) - if: ${{ github.event_name == 'push' || github.event_name == 'merge_group' }} - shell: bash - run: | - echo "HEAD_COMMIT_SHA=$(git rev-parse origin/main)" >> ${GITHUB_ENV} - - name: Check semver - # uses: obi1kenobi/cargo-semver-checks-action@v2 - uses: n0-computer/cargo-semver-checks-action@feat-baseline - with: - package: iroh, iroh-base, iroh-blobs, iroh-cli, iroh-dns-server, iroh-gossip, iroh-metrics, iroh-net, iroh-net-bench, iroh-docs - baseline-rev: ${{ env.HEAD_COMMIT_SHA }} - use-cache: false - + check_fmt: timeout-minutes: 30 name: Checking fmt @@ -287,72 +240,6 @@ jobs: command: check command-arguments: "-Dwarnings" - # netsim-integration-tests: - # permissions: write-all - # if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" - # uses: './.github/workflows/netsim_runner.yaml' - # secrets: inherit - # with: - # branch: ${{ github.ref }} - # max_workers: 4 - # netsim_branch: "main" - # sim_paths: "sims/iroh/iroh.json,sims/integration" - # pr_number: ${{ github.event.pull_request.number || '' }} - - # docker_build_and_test: - # name: Docker Test - # if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" - # timeout-minutes: 30 - # runs-on: [self-hosted, linux, X64] - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: Install rust - # uses: dtolnay/rust-toolchain@master - # with: - # toolchain: stable - - # - name: Install sccache - # uses: mozilla-actions/sccache-action@v0.0.6 - - # - name: Prep - # run: sudo apt-get install musl-tools -y - - # - name: Build iroh - # run: cargo build --profile=dev-ci --all-features --bin iroh --target x86_64-unknown-linux-musl - - # - name: Prep bins - # run: | - # mkdir -p bins/linux/amd64 - # cp target/x86_64-unknown-linux-musl/dev-ci/iroh bins/linux/amd64/iroh - - # - name: Cleanup Docker - # continue-on-error: true - # run: | - # docker kill $(docker ps -q) - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - - # - name: Build Docker image - # uses: docker/build-push-action@v6 - # with: - # context: . - # push: false - # load: true - # tags: n0computer/iroh-test:latest - # target: iroh - # platforms: linux/amd64 - # file: docker/Dockerfile.ci - - # - name: Run Docker image & stats test - # run: | - # docker run -p 9090:9090 -p 4919:4919/udp -Pd n0computer/iroh-test:latest --rpc-addr 0.0.0.0:4919 start - # # Give the server time to start - # sleep 3 - # target/x86_64-unknown-linux-musl/dev-ci/iroh --rpc-addr 127.0.0.1:4919 stats - codespell: timeout-minutes: 30 runs-on: ubuntu-latest diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 0216b7e25..000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,115 +0,0 @@ -name: Docker - -on: - workflow_dispatch: - inputs: - release_version: - description: "Release version" - required: true - type: string - default: "" - base_hash: - description: "Commit hash from which to build" - required: true - type: string - default: "" - publish: - description: "Publish to Docker Hub" - required: true - type: boolean - default: false - workflow_call: - inputs: - release_version: - description: "Release version" - required: true - type: string - default: "" - base_hash: - description: "Commit hash from which to build" - required: true - type: string - default: "" - publish: - description: "Publish to Docker Hub" - required: true - type: boolean - default: false - -env: - IROH_FORCE_STAGING_RELAYS: "1" - -jobs: - build_and_publish: - timeout-minutes: 30 - name: Docker - runs-on: [self-hosted, linux, X64] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Prep dirs - run: | - mkdir -p bins/linux/amd64 - mkdir -p bins/linux/arm64 - - - name: Setup awscli on linux - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install --update - - - name: Set aws credentials - run: | - echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV - echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV - - - name: Fetch release binaries - run: | - aws s3 cp s3://vorc/iroh-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh - aws s3 cp s3://vorc/iroh-relay-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh-relay - aws s3 cp s3://vorc/iroh-dns-server-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh-dns-server - - aws s3 cp s3://vorc/iroh-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh - aws s3 cp s3://vorc/iroh-relay-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh-relay - aws s3 cp s3://vorc/iroh-dns-server-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh-dns-server - - - name: Build Docker image (iroh) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ inputs.publish }} - tags: n0computer/iroh:latest,n0computer/iroh:${{ inputs.release_version }} - target: iroh - platforms: linux/amd64,linux/arm64/v8 - file: docker/Dockerfile.ci - - - name: Build Docker image (iroh-relay) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ inputs.publish }} - tags: n0computer/iroh-relay:latest,n0computer/iroh-relay:${{ inputs.release_version }} - target: iroh-relay - platforms: linux/amd64,linux/arm64/v8 - file: docker/Dockerfile.ci - - - name: Build Docker image (iroh-dns-server) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ inputs.publish }} - tags: n0computer/iroh-dns-server:latest,n0computer/iroh-dns-server:${{ inputs.release_version }} - target: iroh-dns-server - platforms: linux/amd64,linux/arm64/v8 - file: docker/Dockerfile.ci \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 15aa17c27..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,290 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - release_version: - description: "Release version" - required: true - default: "" - create_release: - description: "Create release" - required: true - default: "true" - upload_artifacts: - description: "Upload artifacts" - required: true - default: "true" - upload_url: - description: "Upload URL" - required: false - default: "" - base_hash: - description: "Commit hash from which to build" - required: false - type: string - default: "" - push: - tags: - - "v*" - -concurrency: - group: release-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - RUSTFLAGS: -Dwarnings - RUSTDOCFLAGS: -Dwarnings - MSRV: "1.76" - SCCACHE_CACHE_SIZE: "50G" - BIN_NAMES: "iroh,iroh-relay,iroh-dns-server" - RELEASE_VERSION: ${{ github.event.inputs.release_version }} - -jobs: - create-release: - name: create-release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.release.outputs.upload_url }} - release_version: ${{ env.RELEASE_VERSION }} - steps: - - name: Get the release version from the tag or input - shell: bash - if: env.RELEASE_VERSION == '' - run: | - if "${{ github.event.inputs.release_version }}" != ""; then - echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV - echo "version is: ${{ env.RELEASE_VERSION }}" - else - # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 - echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - echo "version is: ${{ env.RELEASE_VERSION }}" - fi - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Create GitHub release - id: release - if: github.event.inputs.create_release == 'true' || github.event_name == 'push' - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - draft: true - tag_name: ${{ env.RELEASE_VERSION || github.event.inputs.release_version}} - release_name: ${{ env.RELEASE_VERSION || github.event.inputs.release_version }} - - build_release: - timeout-minutes: 60 - name: Build release binaries - needs: create-release - runs-on: ${{ matrix.runner }} - outputs: - release_version: ${{ needs.create-release.outputs.release_version }} - base_hash: ${{ steps.define_hash.outputs.base_hash }} - continue-on-error: false - strategy: - fail-fast: false - matrix: - name: [ubuntu-latest, ubuntu-arm-latest, macOS-latest, macOS-arm-latest, windows-latest] - rust: [stable] - experimental: [false] - include: - - name: ubuntu-arm-latest - os: ubuntu-latest - release-os: linux - release-arch: aarch64 - cargo_targets: "aarch64-unknown-linux-musl" - runner: [self-hosted, linux, ARM64] - - name: ubuntu-latest - os: ubuntu-latest - release-os: linux - release-arch: amd64 - cargo_targets: "x86_64-unknown-linux-musl" - runner: [self-hosted, linux, X64] - - name: macOS-latest - os: macOS-latest - release-os: darwin - release-arch: x86_64 - cargo_targets: "x86_64-apple-darwin" - runner: [self-hosted, macOS, ARM64] - - name: macOS-arm-latest - os: macOS-latest - release-os: darwin - release-arch: aarch64 - cargo_targets: "aarch64-apple-darwin" - runner: [self-hosted, macOS, ARM64] - - name: windows-latest - os: windows-latest - release-os: windows - release-arch: amd64 - cargo_targets: "x86_64-pc-windows-msvc" - runner: [self-hosted, windows, X64] - env: - # Using self-hosted runners so use local cache for sccache and - # not SCCACHE_GHA_ENABLED. - # RUSTC_WRAPPER: "sccache" - RUST_BACKTRACE: full - RUSTV: ${{ matrix.rust }} - steps: - - name: Checkout - if: inputs.base_hash == '' - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Checkout specified commit - if: inputs.base_hash != '' - uses: actions/checkout@v4 - with: - ref: ${{ inputs.base_hash }} - submodules: recursive - - - name: Set build arch - run: | - echo "RELEASE_ARCH=${{ matrix.release-arch }}" >> $GITHUB_ENV - echo "RELEASE_OS=${{ matrix.release-os }}" >> $GITHUB_ENV - - - name: Define hash - if: matrix.os == 'ubuntu-latest' - id: define_hash - run: | - echo "base_hash=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" - - - name: Ensure musl support - if: ${{ contains(matrix.cargo_targets, '-musl') }} - run: sudo apt-get install musl-tools -y - - - name: Install Rust - if: matrix.os != 'windows-latest' - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ matrix.rust }} - targets: ${{ matrix.cargo_targets }} - - - name: Install Rust - if: matrix.os == 'windows-latest' - run: | - rustup toolchain install stable - rustup target add ${{ matrix.cargo_targets }} - - - name: build release - if: matrix.os != 'windows-latest' - shell: bash - run: | - if [ "${{ matrix.name }}" = "ubuntu-arm-latest" ]; then - export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc - export CC=aarch64-linux-gnu-gcc - fi - cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }} - - - name: build release - if: matrix.os == 'windows-latest' - run: cargo build --profile optimized-release --all-features --target ${{ matrix.cargo_targets }} - - - name: attach artifacts - if: matrix.os != 'windows-latest' - uses: actions/upload-artifact@v4 - with: - name: iroh-${{env.RELEASE_OS }}-${{env.RELEASE_ARCH}} - path: target/${{ matrix.cargo_targets }}/optimized-release/iroh - compression-level: 0 - - - name: attach artifacts - if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v4 - with: - name: iroh-windows-amd64.exe - path: target/${{ matrix.cargo_targets }}/optimized-release/iroh.exe - compression-level: 0 - - - name: Setup awscli on linux - if: matrix.name == 'ubuntu-latest' - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install --update - - - name: Setup awscli on linux - if: matrix.name == 'ubuntu-arm-latest' - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install --update - - - name: Setup awscli on mac - if: matrix.os == 'macos-latest' - run: | - curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" - sudo installer -pkg AWSCLIV2.pkg -target / - - - name: Set aws credentials - if: matrix.os != 'windows-latest' - run: | - echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV - echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV - - - name: push release - if: matrix.os != 'windows-latest' - run: | - aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh s3://vorc/iroh-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress - aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-relay s3://vorc/iroh-relay-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress - aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-dns-server s3://vorc/iroh-dns-server-${RELEASE_OS}-${RELEASE_ARCH}-${GITHUB_SHA::7} --no-progress - - - name: push release latest - if: matrix.os != 'windows-latest' - run: | - aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh s3://vorc/iroh-${RELEASE_OS}-${RELEASE_ARCH}-latest --no-progress - aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-relay s3://vorc/iroh-relay-${RELEASE_OS}-${RELEASE_ARCH}-latest --no-progress - aws s3 cp ./target/${{ matrix.cargo_targets }}/optimized-release/iroh-dns-server s3://vorc/iroh-dns-server-${RELEASE_OS}-${RELEASE_ARCH}-latest --no-progress - - - name: Build archives - if: matrix.os != 'windows-latest' - shell: bash - run: | - IFS=',' read -ra BIN_NAMES <<< "${{ env.BIN_NAMES }}" - ASSETS="" - for BIN_NAME in "${BIN_NAMES[@]}"; do - staging="$BIN_NAME-${{ needs.create-release.outputs.release_version }}-${{ matrix.cargo_targets }}" - mkdir -p "$staging" - cp "target/${{ matrix.cargo_targets }}/optimized-release/$BIN_NAME" "$staging/" - tar czf "$staging.tar.gz" -C "$staging" . - ASSETS+="$staging.tar.gz," - done - echo "ASSET=$(echo $ASSETS | sed 's/,$//')" >> $GITHUB_ENV - - - name: Build archives (windows) - if: matrix.os == 'windows-latest' - shell: pwsh - run: | - $BIN_NAMES = "${{ env.BIN_NAMES }}".Split(',') - $ASSETS = @() - foreach ($BIN_NAME in $BIN_NAMES) { - $staging = "$BIN_NAME-${{ needs.create-release.outputs.release_version }}-${{ matrix.cargo_targets }}" - New-Item -ItemType Directory -Force -Path "$staging" - Copy-Item -Path "target/${{ matrix.cargo_targets }}/optimized-release/$BIN_NAME.exe" -Destination "$staging/" - Set-Location -Path "$staging" - Compress-Archive -Path * -DestinationPath "../$staging.zip" - $ASSETS += "$staging.zip" - Set-Location -Path .. - } - $ASSETS = $ASSETS -join ',' - Add-Content -Path $env:GITHUB_ENV -Value "ASSET=$ASSETS" - - - uses: n0-computer/actions-upload-release-asset@main - if: (github.event.inputs.upload_artifacts == 'true' || github.event_name == 'push') - with: - upload_url: ${{ github.event.inputs.upload_url || needs.create-release.outputs.upload_url }} - asset_path: ${{ env.ASSET }} - - docker: - needs: build_release - uses: './.github/workflows/docker.yaml' - secrets: inherit - with: - release_version: ${{ needs.build_release.outputs.release_version }} - base_hash: ${{ needs.build_release.outputs.base_hash }} - publish: true \ No newline at end of file diff --git a/.github/workflows/test_relay_server.yml b/.github/workflows/test_relay_server.yml deleted file mode 100644 index 6182f283e..000000000 --- a/.github/workflows/test_relay_server.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Deploy Test Relay Server - -on: - workflow_dispatch: - schedule: - - cron: '0 4 * * *' - -concurrency: - group: relay-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - RUSTFLAGS: -Dwarnings - RUSTDOCFLAGS: -Dwarnings - MSRV: "1.76" - SCCACHE_CACHE_SIZE: "50G" - IROH_FORCE_STAGING_RELAYS: "1" - -jobs: - build_relay_server: - runs-on: [self-hosted, linux, X64] - if: github.ref_name=='main' - env: - # Using self-hosted runners so use local cache for sccache and - # not SCCACHE_GHA_ENABLED. - RUSTC_WRAPPER: "sccache" - RUST_BACKTRACE: full - RUSTV: stable - steps: - - uses: actions/checkout@v4 - - name: Install rust stable - uses: dtolnay/rust-toolchain@stable - - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.6 - - - name: build release - run: | - cargo build --release --all-features --bin iroh-relay - - - name: Setup awscli on linux - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install --update - - name: Set aws credentials - run: | - echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV - echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV - - - name: push release - run: | - aws s3 cp ./target/release/iroh-relay s3://vorc/iroh-relay-linux-amd64-${GITHUB_SHA::7} --no-progress - - - name: Set iroh-relay tag - id: set_tag - run: | - echo ::set-output name=tag::${GITHUB_SHA::7} - - - deploy_iroh-relay: - runs-on: ubuntu-latest - if: github.ref_name=='main' - needs: build_relay_server - steps: - - uses: actions/checkout@v4 - - name: Run Staging Deploy Playbook - uses: arqu/action-ansible-playbook@master - with: - playbook: redeploy-relay.yml - directory: .github/ansible - key: ${{ secrets.TEST_DERPER_SSH_PKEY }} - inventory: ${{ secrets.TEST_DERPER_INVENTORY }} - known_hosts: ${{ secrets.TEST_DERPER_KNOWN_HOSTS }} - options: --extra-vars ansible_ssh_user=root --extra-vars relay_version=${{ needs.build_relay_server.outputs.set_tag.tag }}