diff --git a/.github/workflows/ci-unit-tests-os.yml b/.github/workflows/ci-unit-tests-os.yml index d37328a5c12..b23941aa7df 100644 --- a/.github/workflows/ci-unit-tests-os.yml +++ b/.github/workflows/ci-unit-tests-os.yml @@ -73,7 +73,7 @@ jobs: ### Build and test Zebra on all OSes ### ######################################## test: - name: Test ${{ matrix.rust }} on ${{ matrix.os }}${{ matrix.features }} + name: Test ${{ matrix.rust }} on ${{ matrix.os }} # The large timeout is to accommodate: # - macOS and Windows builds (typically 50-90 minutes), and timeout-minutes: 120 @@ -83,11 +83,9 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: [stable, beta] - # TODO: When vars.EXPERIMENTAL_FEATURES has features in it, add it here. - # Or work out a way to trim the space from the variable: GitHub doesn't allow empty variables. - # Or use `default` for the empty feature set and EXPERIMENTAL_FEATURES, and update the branch protection rules. - #features: ${{ fromJSON(format('["", "{0}"]', vars.EXPERIMENTAL_FEATURES)) }} - features: [""] + # We only test with default features in this workflow + # Other feature combinations are tested in specific workflows + features: ["default-release-binaries"] exclude: # We're excluding macOS beta for the following reasons: # - the concurrent macOS runner limit is much lower than the Linux limit @@ -121,8 +119,7 @@ jobs: #with: # workspaces: ". -> C:\\zebra-target" with: - # Split the experimental features cache from the regular cache, to avoid linker errors. - # (These might be "disk full" errors, or they might be dependency resolution issues.) + # Split the cache by feature set to avoid linker errors key: ${{ matrix.features }} - name: Change target output directory on Windows diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 1cf4e6b5da7..21032d00881 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -15,30 +15,9 @@ on: - released jobs: - # Each time this workflow is executed, a build will be triggered to create a new image - # with the corresponding tags using information from git - - # The image will be named `zebra:-experimental` - build-experimental: - name: Build Experimental Features Release Docker - uses: ./.github/workflows/sub-build-docker-image.yml - with: - dockerfile_path: ./docker/Dockerfile - dockerfile_target: runtime - image_name: zebra - tag_suffix: -experimental - features: ${{ format('{0} {1}', vars.RUST_PROD_FEATURES, vars.RUST_EXPERIMENTAL_FEATURES) }} - rust_log: ${{ vars.RUST_LOG }} - # This step needs access to Docker Hub secrets to run successfully - secrets: inherit - # The image will be named `zebra:` - # It should be built last, so tags with the same name point to the production build, not the experimental build. build: name: Build Release Docker - # Run this build last, regardless of whether experimental worked - needs: build-experimental - if: always() uses: ./.github/workflows/sub-build-docker-image.yml with: dockerfile_path: ./docker/Dockerfile @@ -53,7 +32,7 @@ jobs: failure-issue: name: Open or update issues for release binaries failures # When a new job is added to this workflow, add it to this list. - needs: [ build, build-experimental ] + needs: [ build ] # Open tickets for any failed build in this workflow. if: failure() || cancelled() runs-on: ubuntu-latest diff --git a/book/src/user/docker.md b/book/src/user/docker.md index 90dad34a2d7..90ba102579d 100644 --- a/book/src/user/docker.md +++ b/book/src/user/docker.md @@ -54,6 +54,27 @@ docker build \ . ``` +### Alternatives + +See [Building Zebra](https://github.com/ZcashFoundation/zebra#manual-build) for more information. + + +### Building with Custom Features + +Zebra supports various features that can be enabled during build time using the `FEATURES` build argument: + +For example, if we'd like to enable metrics on the image, we'd build it using the following `build-arg`: + +> [!IMPORTANT] +> To fully use and display the metrics, you'll need to run a Prometheus and Grafana server, and configure it to scrape and visualize the metrics endpoint. This is explained in more detailed in the [Metrics](https://zebra.zfnd.org/user/metrics.html#zebra-metrics) section of the User Guide. + +```shell +# Build with specific features +docker build -f ./docker/Dockerfile --target runtime \ + --build-arg FEATURES="default-release-binaries prometheus" \ + --tag zebra:metrics . +``` + All available Cargo features are listed at .