diff --git a/.github/buildenv/Dockerfile b/.github/buildenv/Dockerfile new file mode 100644 index 000000000000..a8f96cff58bc --- /dev/null +++ b/.github/buildenv/Dockerfile @@ -0,0 +1,20 @@ +# 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 elek/ozone-build:20191106-1 +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 new file mode 100755 index 000000000000..2d71dedf83d9 --- /dev/null +++ b/.github/buildenv/entrypoint.sh @@ -0,0 +1,18 @@ +#!/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/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000000..d07906991fc9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,113 @@ +# 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. +name: Build +on: push +jobs: + build: + name: compile + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/build.sh + rat: + name: rat + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/rat.sh + - uses: actions/upload-artifact@master + if: always() + with: + name: rat + path: target/rat + author: + name: author + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/author.sh + - uses: actions/upload-artifact@master + if: always() + with: + name: author + path: target/author + unit: + name: unit + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/unit.sh + - uses: actions/upload-artifact@master + if: always() + with: + name: unit + path: target/unit + checkstyle: + name: checkstyle + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/checkstyle.sh + - uses: actions/upload-artifact@master + if: always() + with: + name: checkstyle + path: target/checkstyle + findbugs: + name: findbugs + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/findbugs.sh + - uses: actions/upload-artifact@master + if: always() + with: + name: findbugs + path: target/findbugs + acceptance: + name: acceptance + runs-on: ubuntu-18.04 + needs: + - build + - rat + - checkstyle + - unit + - findbugs + steps: + - uses: actions/checkout@master + - uses: ./.github/buildenv + with: + args: ./hadoop-ozone/dev-support/checks/build.sh + - run: sudo pip install robotframework + - run: sudo chown runner -R . + - run: cd ./hadoop-ozone/dist/target/ozone-*-SNAPSHOT/ && mkdir .aws && sudo chown 1000 .aws + - run: ./hadoop-ozone/dev-support/checks/acceptance.sh + - uses: actions/upload-artifact@master + if: always() + with: + name: acceptance + path: target/acceptance diff --git a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot index c91cbb648554..92887f1d52d3 100644 --- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot +++ b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot @@ -111,9 +111,9 @@ Test Bucket Acls Test key handling [arguments] ${protocol} ${server} ${volume} Execute ozone sh key put ${protocol}${server}/${volume}/bb1/key1 /opt/hadoop/NOTICE.txt - Execute rm -f NOTICE.txt.1 - Execute ozone sh key get ${protocol}${server}/${volume}/bb1/key1 NOTICE.txt.1 - Execute ls -l NOTICE.txt.1 + Execute rm -f /tmp/NOTICE.txt.1 + Execute ozone sh key get ${protocol}${server}/${volume}/bb1/key1 /tmp/NOTICE.txt.1 + Execute ls -l /tmp/NOTICE.txt.1 ${result} = Execute ozone sh key info ${protocol}${server}/${volume}/bb1/key1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="key1")' Should contain ${result} creationTime ${result} = Execute ozone sh key list ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.name=="key1") | .name' diff --git a/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs.robot b/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs.robot index f728691b5f77..74114ff6bb59 100644 --- a/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs.robot +++ b/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs.robot @@ -80,11 +80,11 @@ Run ozoneFS tests ${result} = Execute ozone sh key list o3://om/fstest/bucket1 | grep -v WARN | jq -r '.name' Should not contain ${result} testdir - Execute rm -Rf localdir1 - Execute mkdir localdir1 - Execute cp NOTICE.txt localdir1/LOCAL.txt + Execute rm -Rf /tmp/localdir1 + Execute mkdir /tmp/localdir1 + Execute cp NOTICE.txt /tmp/localdir1/LOCAL.txt Execute ozone fs -mkdir -p o3fs://bucket1.fstest/testdir1 - Execute ozone fs -copyFromLocal localdir1 o3fs://bucket1.fstest/testdir1/ + Execute ozone fs -copyFromLocal /tmp/localdir1 o3fs://bucket1.fstest/testdir1/ Execute ozone fs -put NOTICE.txt o3fs://bucket1.fstest/testdir1/NOTICE.txt ${result} = Execute ozone fs -ls -R o3fs://bucket1.fstest/testdir1/ @@ -104,9 +104,9 @@ Run ozoneFS tests ${rc} ${result} = Run And Return Rc And Output ozone fs -copyFromLocal NOTICE.txt o3fs://bucket1.fstest/KEY.txt Should Be Equal As Integers ${rc} 1 Should contain ${result} File exists - Execute rm -Rf GET.txt - Execute ozone fs -get o3fs://bucket1.fstest/KEY.txt GET.txt - Execute ls -l GET.txt + Execute rm -Rf /tmp/GET.txt + Execute ozone fs -get o3fs://bucket1.fstest/KEY.txt /tmp/GET.txt + Execute ls -l /tmp/GET.txt ${rc} ${result} = Run And Return Rc And Output ozone fs -ls o3fs://abcde.pqrs/ Should Be Equal As Integers ${rc} 1 Should Match Regexp ${result} (Check access operation failed)|(Volume pqrs is not found)