diff --git a/.github/buildenv/Dockerfile b/.github/buildenv/Dockerfile deleted file mode 100644 index 0c9cd77ba1cd..000000000000 --- a/.github/buildenv/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -FROM apache/ozone-build -USER root -ADD entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -USER jenkins1001 -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/buildenv/entrypoint.sh b/.github/buildenv/entrypoint.sh deleted file mode 100755 index 2d71dedf83d9..000000000000 --- a/.github/buildenv/entrypoint.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -l -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -echo "Execution command inside docker with user $(whoami)" -#fix permission which is not defined by github actions -"$@" diff --git a/.github/workflows/post-commit.yml b/.github/workflows/post-commit.yml index c5f4cf67e36d..4fbdc1b6df6b 100644 --- a/.github/workflows/post-commit.yml +++ b/.github/workflows/post-commit.yml @@ -189,6 +189,39 @@ jobs: name: acceptance-${{ matrix.suite }} path: /mnt/ozone/target/acceptance continue-on-error: true + kubernetes: + needs: compile + runs-on: ubuntu-18.04 + timeout-minutes: 60 + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false + steps: + - name: Checkout project + uses: actions/checkout@v2 + with: + path: ozone + - name: Move Ozone to /mnt + run: | + sudo chmod 777 /mnt + mv ozone /mnt/ + - name: Download compiled Ozone binaries + uses: actions/download-artifact@v2 + with: + name: ozone-bin + - name: Untar binaries + run: | + mkdir -p /mnt/ozone/hadoop-ozone/dist/target + tar xzvf hadoop-ozone*.tar.gz -C /mnt/ozone/hadoop-ozone/dist/target + - name: Execute tests + run: | + cd /mnt/ozone/hadoop-ozone/dist/target/ozone-* && sudo mkdir .aws && sudo chmod 777 .aws && sudo chown 1000 .aws + cd /mnt/ozone && hadoop-ozone/dev-support/checks/kubernetes.sh + - name: Archive build results + uses: actions/upload-artifact@v2 + if: always() + with: + name: kubernetes + path: /mnt/ozone/target/kubernetes + continue-on-error: true integration: runs-on: ubuntu-18.04 timeout-minutes: 120 @@ -207,10 +240,17 @@ jobs: uses: actions/checkout@v2 with: path: mnt/ozone - - name: Execute tests - uses: ./mnt/ozone/.github/buildenv + - name: Cache for maven dependencies + uses: actions/cache@v2 with: - args: ./mnt/ozone/hadoop-ozone/dev-support/checks/integration.sh -P${{ matrix.profile }} + path: ~/.m2/repository + key: maven-repo-${{ hashFiles('**/pom.xml') }}-8-${{ matrix.check }} + restore-keys: | + maven-repo-${{ hashFiles('**/pom.xml') }}-8 + maven-repo-${{ hashFiles('**/pom.xml') }} + maven-repo- + - name: Execute tests + run: mnt/ozone/hadoop-ozone/dev-support/checks/integration.sh -P${{ matrix.profile }} - name: Summary of failures run: cat mnt/ozone/target/${{ github.job }}/summary.txt if: always() @@ -221,6 +261,12 @@ jobs: name: it-${{ matrix.profile }} path: mnt/ozone/target/integration continue-on-error: true + - name: Delete temporary build artifacts before caching + run: | + #Never cache local artifacts + rm -rf ~/.m2/repository/org/apache/hadoop/hadoop-hdds* + rm -rf ~/.m2/repository/org/apache/hadoop/hadoop-ozone* + if: always() coverage: runs-on: ubuntu-18.04 timeout-minutes: 30 @@ -266,36 +312,9 @@ jobs: name: coverage path: target/coverage continue-on-error: true - kubernetes: - needs: compile - runs-on: ubuntu-18.04 - timeout-minutes: 60 - if: github.event_name != 'pull_request' || github.event.pull_request.draft == false - steps: - - name: Checkout project - uses: actions/checkout@v2 - with: - path: ozone - - name: Move Ozone to /mnt - run: | - sudo chmod 777 /mnt - mv ozone /mnt/ - - name: Download compiled Ozone binaries - uses: actions/download-artifact@v2 - with: - name: ozone-bin - - name: Untar binaries - run: | - mkdir -p /mnt/ozone/hadoop-ozone/dist/target - tar xzvf hadoop-ozone*.tar.gz -C /mnt/ozone/hadoop-ozone/dist/target - - name: Execute tests + - name: Delete temporary build artifacts before caching run: | - cd /mnt/ozone/hadoop-ozone/dist/target/ozone-* && sudo mkdir .aws && sudo chmod 777 .aws && sudo chown 1000 .aws - cd /mnt/ozone && hadoop-ozone/dev-support/checks/kubernetes.sh - - name: Archive build results - uses: actions/upload-artifact@v2 + #Never cache local artifacts + rm -rf ~/.m2/repository/org/apache/hadoop/hadoop-hdds* + rm -rf ~/.m2/repository/org/apache/hadoop/hadoop-ozone* if: always() - with: - name: kubernetes - path: /mnt/ozone/target/kubernetes - continue-on-error: true