-
Notifications
You must be signed in to change notification settings - Fork 616
HDDS-2400. Enable github actions based builds for Ozone #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6528cd8
4f2cae3
7c54960
8025665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| USER root | ||
| ADD entrypoint.sh /entrypoint.sh | ||
| RUN chmod +x /entrypoint.sh | ||
| USER jenkins1001 | ||
| ENTRYPOINT ["/entrypoint.sh"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # 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. | ||
| #!/bin/sh -l | ||
| if [ "$WITH_DOCKERD" ]; then | ||
| sudo dockerd & | ||
| sleep 5 | ||
| chmod 777 /var/run/docker.sock | ||
|
|
||
| fi | ||
| echo "Execution command inside docker with user $(whoami)" | ||
| #fix permission which is not defined by github actions | ||
| "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we were using Alpine for most base. But this is good too. Just commenting since I remember you telling me the reason for this change, but I forgot what it was. Something to do with Java or something ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recently we switched to use centos. Centos is used in the runtime images (apache/ozone and apache/ozone-runner) and it seems to be reasonable to run the unit test in the same environment. We used alpine earlier but we found very strange seg faults from the rocksdb JNI -> libmusl which has been disappeared with using centos. This specific line is about the VM. Github actions / azure starts a new VM for each step and we run our build inside a docker container (centos) started by the host (ubuntu). Except for acceptance testing which requires docker (and nothing more) where it was easier to run the docker-compose based tests from the VM itself. |
||
| steps: | ||
| - uses: actions/checkout@master | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that patch will get rebased automatically the master? if so, awesome.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, It doesn't. But this is the place where we can implement an automatic rebase. The original branch is available from the event file, so we can easily implement it. |
||
| - 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we run this if and only if the build is successful ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can, but this is fast enough, I think we can run it always. But we can define some ordering between build and acceptance/integration which is not yet implemented here. |
||
| - 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, should we serialize this behind the build ? that way if there is a compilation error we will see it and bail.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added dependencies between acceptance and others. I am not sure if we need other one here as findbugs is very fast it's not a big difference (in terms of resource usage) if findbugs are executed later. But I am open to do it. I would start the experiment and measure the resource usage and adjust the dependencies based on the data. |
||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this depend on unit.sh ? and enforce Unit.sh with vengeance ? All of us will be uncomfortable for a while, but then we will realize that unittests being green is the natural state. what do you think ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a dependency between acceptance and the fast jobs (unit/findbugs/checkstyle/builds) |
||
| runs-on: ubuntu-18.04 | ||
| 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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' | ||
|
|
||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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