Skip to content

Conversation

@elek
Copy link
Member

@elek elek commented Nov 7, 2019

What changes were proposed in this pull request?

Current PR checks are executed in a private branch based on the scripts in https://github.com/elek/argo-ozone

but the results are stored in a public repositories:

As we discussed during the community calls, it would be great to use github actions (or any other cloud based build) to make all the build definitions more accessible for the community.

@vivekratnavel checked CircleCI which has better reporting capabilities. But INFRA has concerns about the permission model of circle-ci:

it is highly unlikley we will allow a bot to be able to commit code (whether or not that is the intention, allowing circle-ci will make this possible, and is a complete no)

See:

Fortunately we have a clear contract. Or build scripts are stored under hadoop-ozone/dev-support/checks (return code show the result, details are printed out to the console output). It's very easy to experiment with different build systems.

Github action seems to be an obvious choice: it's integrated well with GitHub and it has more generous resource limitations.

With this Jira I propose to enable github actions based PR checks for a few tests (author, rat, unit, acceptance, checkstyle, findbugs) as an experiment.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-2400

How was this patch tested?

You should see the result of the github actions based build on the last commit of this PR.

@elek
Copy link
Member Author

elek commented Nov 7, 2019

For some reason builds are not triggered. It's not clear if it should be merged first or it's disabled for this repo...

Copy link
Contributor

@anuengineer anuengineer left a comment

Choose a reason for hiding this comment

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

Some comments/questions below.

# 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

jobs:
build:
name: compile
runs-on: ubuntu-18.04
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

name: compile
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

name: unit
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we run this if and only if the build is successful ?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

path: target/checkstyle
findbugs:
name: findbugs
runs-on: ubuntu-18.04
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

name: findbugs
path: target/findbugs
acceptance:
name: acceptance
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Member Author

Choose a reason for hiding this comment

The 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)

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.

@elek
Copy link
Member Author

elek commented Nov 12, 2019

Seems to be fine, I think it's ready to merge. The acceptance test is failing on the trunk, too.

Copy link
Contributor

@anuengineer anuengineer left a comment

Choose a reason for hiding this comment

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

+1. LGTM. Thank for getting this done. This is huge. I really love this work.

@anuengineer anuengineer merged commit 86c76ff into apache:master Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants