Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/buildenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to move this to Apache ozone ? at some point of time. Not for this patch. Let us get this working; and then move this to Apache Ozone Account in Docker Hub.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I already opened the required PR: apache/ozone-docker#9 It will be available as apache/ozone-build

USER root
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER jenkins1001
ENTRYPOINT ["/entrypoint.sh"]
18 changes: 18 additions & 0 deletions .github/buildenv/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
"$@"
113 changes: 113 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand what is happening here. Did we remap /opt to /tmp somehow? and the file name is also remapped ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the acceptance test execute simple I start the acceptance tests directly from the VM (uid=1001) and not from docker container (uid=1000). But the build has been done with uid=1000. To make it possible to run I use /tmp for writing/reading temporary files which is always writable.

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'
Expand Down
14 changes: 7 additions & 7 deletions hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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)