Skip to content

Commit

Permalink
Replace the usage of ubuntu 20.04 (#1877)
Browse files Browse the repository at this point in the history
Co-authored-by: Tan Nguyen <[email protected]>
  • Loading branch information
tan3-netapp and Tan Nguyen authored Mar 6, 2025
1 parent fa03d6e commit 2f7618b
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 148 deletions.
202 changes: 101 additions & 101 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,125 +22,125 @@ jobs:
matrix:
include:
- name: Build Release
runner: ubuntu-20.04
runner: ubuntu-24.04
cargo_flags: --release
profile: release

- name: Build Debug
runner: ubuntu-20.04
runner: ubuntu-24.04
cargo_flags:
profile: debug

name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# rust-cache already handles all the sane defaults for caching rust builds.
# However because we are running seperate debug/release builds in parallel,
# we also need to add the runner and cargo_flags to the key so that a seperate cache is used.
# Otherwise only the last build to finish would get saved to the cache.
# We allow different test_flags to share a cache as they should have identical build outputs
key: ${{ matrix.runner }} - ${{ matrix.cargo_flags }}
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# rust-cache already handles all the sane defaults for caching rust builds.
# However because we are running seperate debug/release builds in parallel,
# we also need to add the runner and cargo_flags to the key so that a seperate cache is used.
# Otherwise only the last build to finish would get saved to the cache.
# We allow different test_flags to share a cache as they should have identical build outputs
key: ${{ matrix.runner }} - ${{ matrix.cargo_flags }}

# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-20.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-24.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]

# It is currently impossible to combine j4rs, rust-cache and nextest:
# * j4rs needs to store jars somewhere, by default this is in target/debug/jassets, we do have the option to move this somewhere outside of target.
# * rust-cache will delete all files in target/debug other than `build`, `deps` and `.fingerprint`
# * nextest will only archive files within the target directory
# There is no way of combining all of these requirements.
# We will need to find one of these projects that is suitable to have its requirements loosened.
# I suspect that rust-cache is the project that needs to change, maybe add a config field to include extra paths in the cache, similar to nextest's archive.include.
# This is going to be tricky and require discussion with the various upstream projects, and will take a while to land anything.
#
# So for now we need a quick workaround.
# This workaround is to force j4rs to be rebuilt from scratch via cargo clean.
# This has a cost on CI runtime and in the future we should find another solution as discussed above.
- name: Workaround j4rs cache issue
run: cargo clean -p j4rs ${{ matrix.cargo_flags }}
# It is currently impossible to combine j4rs, rust-cache and nextest:
# * j4rs needs to store jars somewhere, by default this is in target/debug/jassets, we do have the option to move this somewhere outside of target.
# * rust-cache will delete all files in target/debug other than `build`, `deps` and `.fingerprint`
# * nextest will only archive files within the target directory
# There is no way of combining all of these requirements.
# We will need to find one of these projects that is suitable to have its requirements loosened.
# I suspect that rust-cache is the project that needs to change, maybe add a config field to include extra paths in the cache, similar to nextest's archive.include.
# This is going to be tricky and require discussion with the various upstream projects, and will take a while to land anything.
#
# So for now we need a quick workaround.
# This workaround is to force j4rs to be rebuilt from scratch via cargo clean.
# This has a cost on CI runtime and in the future we should find another solution as discussed above.
- name: Workaround j4rs cache issue
run: cargo clean -p j4rs ${{ matrix.cargo_flags }}

- name: Build tests
run: |
cargo test --doc ${{ matrix.cargo_flags }} --all-features -- --show-output --nocapture
cargo nextest archive --archive-file nextest-${{ matrix.profile }}.tar.zst ${{ matrix.cargo_flags }} --all-features --all-targets
- name: Upload built tests to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-${{ matrix.profile }}
path: nextest-${{ matrix.profile }}.tar.zst
- name: Report disk usage
run: |
df -h
echo -e "\ntarget dir usage:"
du -h $PWD/target
echo -e "\n.cargo dir usage:"
du -h ~/.cargo
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
- name: Build tests
run: |
cargo test --doc ${{ matrix.cargo_flags }} --all-features -- --show-output --nocapture
cargo nextest archive --archive-file nextest-${{ matrix.profile }}.tar.zst ${{ matrix.cargo_flags }} --all-features --all-targets
- name: Upload built tests to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-${{ matrix.profile }}
path: nextest-${{ matrix.profile }}.tar.zst
- name: Report disk usage
run: |
df -h
echo -e "\ntarget dir usage:"
du -h $PWD/target
echo -e "\n.cargo dir usage:"
du -h ~/.cargo
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
run_tests_partitioned:
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
profile: ["release", "debug"]
partition: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]
profile: [ "release", "debug" ]
name: Test ${{ matrix.profile}} ${{ matrix.partition }}/15
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: build_check_and_upload
steps:
- uses: actions/checkout@v4
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-20.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- run: mkdir -p ~/.cargo/bin
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-${{ matrix.profile }}
- name: Run tests
run: |
~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-${{ matrix.profile }}.tar.zst \
--partition count:${{ matrix.partition }}/15 --extract-to . --run-ignored all
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
- uses: actions/checkout@v4
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-24.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- run: mkdir -p ~/.cargo/bin
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-${{ matrix.profile }}
- name: Run tests
run: |
~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-${{ matrix.profile }}.tar.zst \
--partition count:${{ matrix.partition }}/15 --extract-to . --run-ignored all
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
88 changes: 44 additions & 44 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,48 @@ env:
jobs:
job:
name: Formatting and lints
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-20.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Ensure `cargo fmt --all` was run
run: cargo fmt --all -- --check
- name: Ensure that all crates compile and have no warnings under every possible combination of features
# some things to explicitly point out:
# * clippy also reports rustc warnings and errors
# * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default.
run: cargo hack --feature-powerset --at-least-one-of valkey,cassandra,kafka,opensearch clippy --all-targets --locked -- -D warnings
- name: Report disk usage
run: |
df -h
echo -e "\ntarget dir usage:"
du -h $PWD/target
echo -e "\n.cargo dir usage:"
du -h ~/.cargo
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-24.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Ensure `cargo fmt --all` was run
run: cargo fmt --all -- --check
- name: Ensure that all crates compile and have no warnings under every possible combination of features
# some things to explicitly point out:
# * clippy also reports rustc warnings and errors
# * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default.
run: cargo hack --feature-powerset --at-least-one-of valkey,cassandra,kafka,opensearch clippy --all-targets --locked -- -D warnings
- name: Report disk usage
run: |
df -h
echo -e "\ntarget dir usage:"
du -h $PWD/target
echo -e "\n.cargo dir usage:"
du -h ~/.cargo
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
git status
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
publish-binary:
name: "Publish Binary to GitHub"
needs: prepublish-check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install ubuntu packages
Expand All @@ -55,7 +55,7 @@ jobs:
publish-crates-io:
name: "Publish to crates.io"
needs: prepublish-check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install ubuntu packages
Expand Down
2 changes: 1 addition & 1 deletion windsock-cloud-docker/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Container {
"-d",
"--name",
"windsock-cloud",
"ubuntu:20.04",
"ubuntu:22.04",
"sleep",
"infinity",
])
Expand Down

0 comments on commit 2f7618b

Please sign in to comment.