Add file size verification to POSC plugin to prevent incomplete uploads #345
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| workflow_dispatch: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| env: | |
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
| BUILD_TYPE: Debug | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| external-gtest: [ YES ] | |
| os: [ ubuntu-24.04 ] | |
| runs-on: ${{ matrix.os }} | |
| name: Build with external_gtest=${{ matrix.external-gtest }} on ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Generate cache key | |
| id: cache_key | |
| working-directory: ${{runner.workspace}} | |
| run: | | |
| git clone https://github.com/xrootd/xrootd.git | |
| cd xrootd | |
| git remote add github_pelican https://github.com/PelicanPlatform/xrootd.git | |
| git fetch github_pelican | |
| git checkout -b v5.8.4-pelican -t github_pelican/v5.8.4-pelican | |
| echo "git:$(git rev-parse HEAD)" > key | |
| echo "os:$(uname -svmo)" >> key | |
| echo "week:$(date '+%Y-%U')" >> key | |
| cat key | |
| echo "key=xrootd-asan-$(sha256sum key | cut -f 1 -d ' ')" >> $GITHUB_OUTPUT | |
| # Disable auto-update of the manpages during apt installs; saves a few seconds. | |
| sudo rm -f /var/lib/man-db/auto-update | |
| - name: Try download from cache | |
| uses: actions/cache/restore@v4 | |
| id: cache | |
| with: | |
| path: ${{ runner.workspace }}/xrootd/build/release_dir | |
| key: ${{ steps.cache_key.outputs.key }} | |
| # Only need the go build environment if there was a cache miss | |
| - uses: actions/setup-go@v5 | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| with: | |
| go-version: '1.23.5' | |
| - name: Install XRootD | |
| working-directory: ${{runner.workspace}} | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| # Build deps | |
| sudo apt update && sudo apt-get install -y cmake libz-dev uuid-dev libcurl4-openssl-dev libcurl4 pkg-config libssl-dev g++ libscitokens-dev libgtest-dev | |
| # Build our preferred set of patches on xrootd | |
| rm -rf xrootd | |
| git clone https://github.com/xrootd/xrootd.git | |
| cd xrootd | |
| git remote add github_pelican https://github.com/PelicanPlatform/xrootd.git | |
| git fetch github_pelican | |
| git checkout -b v5.8.4-pelican -t github_pelican/v5.8.4-pelican | |
| mkdir -p build/release_dir | |
| cd build | |
| cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/release_dir -DENABLE_ASAN=TRUE | |
| make -j $(($(nproc) + 2)) install | |
| # Install the load tester | |
| go install github.com/bbockelm/go-wrk@92dbe19 | |
| cp ~/go/bin/go-wrk release_dir/bin/ | |
| # Download minio and mc for S3 tests (platform-specific) | |
| if [[ "$(uname -s)" == "Darwin" ]]; then | |
| MINIO_OS="darwin" | |
| else | |
| MINIO_OS="linux" | |
| fi | |
| if [[ "$(uname -m)" == "arm64" || "$(uname -m)" == "aarch64" ]]; then | |
| MINIO_ARCH="arm64" | |
| else | |
| MINIO_ARCH="amd64" | |
| fi | |
| curl -o release_dir/bin/minio "https://dl.min.io/server/minio/release/${MINIO_OS}-${MINIO_ARCH}/minio" | |
| chmod +x release_dir/bin/minio | |
| curl -o release_dir/bin/mc "https://dl.min.io/client/mc/release/${MINIO_OS}-${MINIO_ARCH}/mc" | |
| chmod +x release_dir/bin/mc | |
| - name: Upload XRootD to cache | |
| uses: actions/cache/save@v4 | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| id: cache-save | |
| with: | |
| path: ${{ runner.workspace }}/xrootd/build/release_dir | |
| key: ${{ steps.cache_key.outputs.key }} | |
| - name: Install build deps | |
| if: steps.cache.outputs.cache-hit == 'true' | |
| run: | | |
| sudo apt update && sudo apt-get install -y cmake libcurl4-openssl-dev libcurl4 pkg-config libssl-dev g++ libscitokens-dev libgtest-dev | |
| - name: Create Build Environment | |
| # Some projects don't allow in-source building, so create a separate build directory | |
| # We'll use this as our working directory for all subsequent commands | |
| run: cmake -E make_directory ${{runner.workspace}}/build | |
| - name: Configure CMake | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: CMAKE_PREFIX_PATH=$PWD/../xrootd/build/release_dir/lib/cmake/XRootD cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_TESTS=yes -DENABLE_ASAN=true -DXROOTD_PLUGINS_EXTERNAL_GTEST=${{ matrix.external-gtest }} | |
| - name: Build | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| # Execute the build. You can specify a specific target with "--target <NAME>" | |
| run: cmake --build . --config $BUILD_TYPE --parallel $(($(nproc) + 2)) | |
| - name: Unit Tests | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| # Execute tests defined by the CMake configuration. | |
| # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
| run: ctest -C $BUILD_TYPE --verbose | |
| - name: Start xrootd | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: ASAN_OPTIONS=detect_odr_violation=0 LD_LIBRARY_PATH=$PWD/../xrootd/build/release_dir/lib $PWD/../xrootd/build/release_dir/bin/xrootd -c ${{runner.workspace}}/xrootd-s3-http/test/s3-xrootd-test.cfg & | |
| - name: Get a file | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: curl -f http://localhost:8080/aws-opendata/2024/wod_apb_2024.nc -o wod_apb_2024.nc | |
| - name: Fail a file | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: | | |
| if curl -f http://localhost:8080/aws-opendata/2024/bogus_file_name; then | |
| echo "Error: Command unexpectedly succeeded." | |
| exit 1 | |
| else | |
| echo "Command failed as expected." | |
| fi | |
| - name: Get metadata | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: curl -f -k -X PROPFIND http://localhost:8080/aws-opendata/2024/wod_apb_2024.nc -d prop_query |