Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Fix build on Ubuntu-18.04 server #540

Merged
merged 43 commits into from
Apr 28, 2021
Merged

Conversation

andriytk
Copy link
Contributor

@andriytk andriytk commented Mar 25, 2021

Motr can be built and run on Ubuntu-18.04 server now.

The steps:

  1. Install Lustre client:

    a) download and install 3 packages from
    https://downloads.whamcloud.com/public/lustre/lustre-2.12.6/ubuntu1804/client/ : source, modules and utils (last two are optional, see the note below);

    b) unpack /usr/src/lustre.tar.bz2, configure --without-servers and build it (make).

    Note: if you wish, you can install Lustre bins after you build them with make install command instead of installing pre-built packages from Whamcloud. If you do so, don't forget to run sudo depmod, otherwise the wrong lnet.ko might be taken from the standard linux-modules-extra package when the module is loaded. And it won't work with Motr.

  2. Install Motr deps:

    sudo apt install castxml binutils-dev libxml-libxml-perl \
            liblist-moreutils-perl libyaml-libyaml-perl \
            libfile-find-rule-perl libio-all-perl libfile-slurp-perl \
            libmce-perl libdatetime-perl libsereal-perl \
            python3-ply libaio-dev libedit-dev uuid-dev libsystemd-dev \
            python-dev expect genders attr systemtap
    sudo apt install --no-install-recommends asciidoc docbook-xml xsltproc

    Note: you can take the ready VM from here and skip the above two steps.

  3. Build Motr:

    ./autogen.sh && ./configure --with-lustre=/usr/src/lustre-2.12.6 && make
    

    Note: in the command above the Lustre sources were placed and built at /usr/src/lustre-2.12.6 directory, specify your directory there.

Now you can try to run some tests:

  1. Unit tests: scripts/m0 run-ut.
  2. System tests: scripts/m0 run-st 26motr-user-kernel-tests.

@andriytk
Copy link
Contributor Author

All UTs pass now.

@andriytk
Copy link
Contributor Author

scripts/m0 run-st 26motr-user-kernel-tests passes now.

@andriytk andriytk force-pushed the fix-ubuntu18-build branch 2 times, most recently from 7649c7f to dc2e369 Compare March 26, 2021 02:25
@cortx-admin

This comment has been minimized.

@cortx-admin

This comment has been minimized.

@stale stale bot removed the needs-attention label Mar 30, 2021
@cortx-admin

This comment has been minimized.

@stale stale bot added the needs-attention label Apr 5, 2021
@huanghua78
Copy link

Hello @andriytk do you have a Ubuntu-18.4 OVA?

@stale stale bot removed the needs-attention label Apr 13, 2021
@huanghua78
Copy link

Hello @andriytk do you have a Ubuntu-18.4 OVA?

https://github.com/andriytk/cortx-motr/releases/tag/ubuntu18ova

I got it.

@andriytk
Copy link
Contributor Author

andriytk commented Apr 13, 2021

@huanghua78, yes - updated the description with the note about it.

@andriytk andriytk force-pushed the fix-ubuntu18-build branch 3 times, most recently from c428e52 to bd6513f Compare April 19, 2021 09:32
libtool: link: gcc -fno-common -pipe -Wall -Werror -Wno-attributes -fno-strict-aliasing -fno-omit-frame-pointer -g -O2 -rdynamic -o be/tool/.libs/m0beck be/tool/be_tool_m0beck-beck.o  ./motr/.libs/libmotr.so -pthread
/usr/bin/ld: be/tool/be_tool_m0beck-beck.o: undefined reference to symbol 'yaml_parser_delete'
//usr/lib/x86_64-linux-gnu/libyaml-0.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Solution: add YAML_LIBS to LDADD.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
/home/ant/motr/be/extmap.c: In function ‘emap_dump’:
/home/ant/motr/be/extmap.c:158:1: error: the frame size of 1456 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
/home/ant/motr/be/extmap.c: In function ‘be_emap_invariant’:
/home/ant/motr/be/extmap.c:1051:1: error: the frame size of 1400 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
/home/ant/motr/be/extmap.c: In function ‘m0_be_emap_dump’:
/home/ant/motr/be/extmap.c:223:1: error: the frame size of 1480 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
/home/ant/motr/be/extmap.c: In function ‘m0_be_emap_obj_delete’:
/home/ant/motr/be/extmap.c:695:1: error: the frame size of 1408 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Solution: allocate large structs from heap.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
/home/ant/motr/conf/db.c: In function ‘confx_obj_dup’:
/home/ant/motr/conf/db.c:245:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
/home/ant/motr/conf/db.c: In function ‘__confdb_free’:
/home/ant/motr/conf/db.c:429:1: error: the frame size of 1192 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Solution: allocate large structs from heap.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
  CC [M]  /home/ant/motr/mdservice/md_fops.o
/home/ant/motr/mdservice/md_fops.c: In function ‘m0_mdservice_fopts_init’:
/home/ant/motr/mdservice/md_fops.c:255:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
/home/ant/motr/mdservice/md_fops.c: In function ‘m0_mdservice_rep_fopts_init’:
/home/ant/motr/mdservice/md_fops.c:335:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Solution: introduce and use M0_FOP_TYPE_INIT2() and
M0_FOP_TYPE_INIT2_DECL macro which re-use the same variable
on each M0_FOP_TYPE_INIT2() call instead of defining
the new one on the stack each time it's called.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
  CC [M]  /home/ant/motr/rpc/item.o
/home/ant/motr/rpc/item.c: In function ‘m0_rpc_item_module_init’:
/home/ant/motr/rpc/item.c:133:1: error: the frame size of 1568 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Problem: the big m0_xcode_ctx local vars are used several times.

Solution: restructure the usage of local vars and use several
int vars to store different xcode_lengths for different items
instead of several m0_xcode_ctx vars.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
  CC [M]  /home/ant/motr/addb2/ut/consumer.o
/home/ant/motr/addb2/ut/consumer.c: In function ‘data_label’:
/home/ant/motr/addb2/ut/consumer.c:202:1: error: the frame size of 1248 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Solution: decrease the size of small_record::ar_label[]
array from 10 to 4.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
@cortx-admin

This comment has been minimized.

@andriytk

This comment has been minimized.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
Explicitly use the 'dummy' pointer to emphasise the point
that the pointer is not used by the code.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
    sns-cm-repair-ut
      service-startstop                               0.47 sec   81 MiB
      service-init-fail                               0.43 sec   78 MiB
      service-start-fail                              0.46 sec   78 MiB
      iter-repair-single-file                         2.68 sec   92 MiB
      iter-repair-multi-file                          2.75 sec  103 MiB
      iter-repair-large-file-with-large-unit-size  motr[46351]:  dcf0  FATAL  [lib/assert.c:50:m0_panic]  panic: (({ typeof (timer->t_state) __x = (timer->t_state); ((__x) == (M0_TIMER_STOPPED) || ((__x) == (M0_TIMER_INITED))); })) at m0_timer_fini() (lib/timer.c:68)  [git: sage-base-1.0-349-gacd623125] /var/motr/m0ut/m0trace.46351
    Motr panic: (({ typeof (timer->t_state) __x = (timer->t_state); ((__x) == (M0_TIMER_STOPPED) || ((__x) == (M0_TIMER_INITED))); })) at m0_timer_fini() lib/timer.c:68 (errno: 4) (last failed: none) [git: sage-base-1.0-349-gacd623125] pid: 46351  /var/motr/m0ut/m0trace.46351
    motr/.libs/libmotr.so.2(m0_arch_backtrace+0x2f)[0x7fc9fb47899f]
    motr/.libs/libmotr.so.2(m0_arch_panic+0xe5)[0x7fc9fb478b75]
    motr/.libs/libmotr.so.2(+0x365f4c)[0x7fc9fb466f4c]
    motr/.libs/libmotr.so.2(m0_timer_fini+0x8e)[0x7fc9fb46f0de]
    ut/.libs/libmotr-ut.so.0(+0x25d93f)[0x7fc9fc52493f]
    ut/.libs/libmotr-ut.so.0(+0x25de92)[0x7fc9fc524e92]
    ut/.libs/libmotr-ut.so.0(m0_ut_run+0x234)[0x7fc9fc5448e4]
    ut/.libs/m0ut(main+0x1312)[0x562a4cdb36c2]

There is bug in the ut/cm.c code which may leave the timer
uninitialised sometimes when iter_ut_fom_tick() immediately
proceeds from the ITER_COMPLETE state to M0_FOM_PHASE_FINISH
state without waiting.

Solution: always initialise the timer unconditionally in
the same function where it is finalised - at iter_run().

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
@huanghua78
Copy link

What is the equivalent file of "/var/log/messages" in Ubuntu?

root@u18s:/work/cortx-motr# ./scripts/m0 run-kut
----- run_kut -----
Running kernel UT (this may take a while) ...
tail: cannot open '/var/log/messages' for reading: No such file or directory


               Unit tests status: SUCCESS
/work/cortx-motr/ut/m0kut: line 219: 49037 Terminated              tail -n 1 -F /var/log/messages
root@u18s:/work/cortx-motr# 
root@u18s:/work/cortx-motr# 

be/extmap.c Outdated Show resolved Hide resolved
Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
fop/fop.h Show resolved Hide resolved
@andriytk
Copy link
Contributor Author

andriytk commented Apr 20, 2021

equivalent file of "/var/log/messages" in Ubuntu?

/var/log/syslog, I suppose. Let me fix this...

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
@cortx-admin

This comment has been minimized.

@cortx-admin
Copy link

Jenkins CI Result : Motr#376

Motr Test Summary

Test ResultCountInfo
❌Failed1
📁

02motr-single-node/20pool-version-test

🏁Skipped5
📁

01motr-single-node/37protocol
04motr-single-node/31motr-sys-kvs-kernel-test
05motr-single-node/07multi-client-tests
05motr-single-node/39mount-fail
05motr-single-node/12sns-cc-io-tests

✔️Passed58
📁

01motr-single-node/46m0crate
01motr-single-node/01kernel-tests
01motr-single-node/00userspace-tests
01motr-single-node/03initscript-tests
01motr-single-node/30hagen-test
01motr-single-node/29confgen-test
01motr-single-node/35m0singlenode
01motr-single-node/04net-tests
01motr-single-node/05rpcping-tests
01motr-single-node/28motr-sys-kvs-test
01motr-single-node/06console-tests
01motr-single-node/52singlenode-sanity
02motr-single-node/21spiel-test
02motr-single-node/47motr-tests-user-kernel
02motr-single-node/09poolmach-tests
02motr-single-node/41motr-conf-update
02motr-single-node/08degraded-mode-tests
02motr-single-node/24m0d-fsync-test
02motr-single-node/02system-tests
02motr-single-node/22rpc-cancel-test
02motr-single-node/53clusterusage-alert
02motr-single-node/23m0d-signal-test
02motr-single-node/51kem
03motr-single-node/54sns-repair-motr-1f
03motr-single-node/59sns-repair-motr-abort
03motr-single-node/17sss-st-test
03motr-single-node/58sns-repair-motr-ios-fail
03motr-single-node/60sns-repair-motr-abort-quiesce
03motr-single-node/55sns-repair-motr-1n-1f
03motr-single-node/56sns-repair-motr-mf
03motr-single-node/61spiel-multi-confd
03motr-single-node/16conf-st-test
03motr-single-node/57sns-repair-motr-1k-1f
03motr-single-node/36spare-reservation
04motr-single-node/51motr-rmw
04motr-single-node/50motr-rm-lock-cc-io
04motr-single-node/25spiel-sns-repair-test
04motr-single-node/33motr-st
04motr-single-node/19sns-abort-test
04motr-single-node/32m0t1fs-rconfc-fail-test
04motr-single-node/34sns-repair-1n-1f
04motr-single-node/26spiel-sns-repair-quiesce-test
04motr-single-node/49motr-rpc-cancel
04motr-single-node/27sns-repair-io-fail-test
04motr-single-node/48motr-raid0-io
05motr-single-node/40motr-dgmode
05motr-single-node/42motr-utils
05motr-single-node/13sns-repair-quiesce
05motr-single-node/45motr-sns-repair-N-1
05motr-single-node/11sns-multi-tests
05motr-single-node/44motr-sns-repair
05motr-single-node/14m0t1fs-fsync-test
05motr-single-node/43motr-sync-replication
05motr-single-node/38sns-abort-quiesce-test
05motr-single-node/15m0t1fs-fwait-test
05motr-single-node/18m0mount-test
05motr-single-node/10sns-single-tests
motr-single-node/62dix-repair-st-lookup-insert

Total64🔗

CppCheck Summary

   Cppcheck: No new warnings found 👍

@madhavemuri
Copy link
Contributor

@andriytk: Have you got the chance to check on ubuntu 20.04 version,
Lustre too seems to be available for it.
https://downloads.whamcloud.com/public/lustre/lustre-2.14.0/ubuntu2004/client/

@andriytk
Copy link
Contributor Author

@madhavemuri, no. Ubuntu-20 ships with 5.4 kernel version and might require a lot of porting work in our kernel space.

The 02motr-single-node test passing usually takes 11 mins
(according to the Jenkins history) and sometimes it fails
due to the timeout, which is also happens to be 11 mins
for this test.

Increase the timeout to 15 mins to avoid the bogus failures.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
@andriytk andriytk force-pushed the fix-ubuntu18-build branch from 43b545e to 4e879b0 Compare April 22, 2021 11:39
@madhavemuri

This comment has been minimized.

@madhavemuri

This comment has been minimized.

@cortx-admin
Copy link

Jenkins CI Result : Motr#378

Motr Test Summary

Test ResultCountInfo
❌Failed0
📁

🏁Skipped5
📁

01motr-single-node/37protocol
04motr-single-node/31motr-sys-kvs-kernel-test
05motr-single-node/07multi-client-tests
05motr-single-node/39mount-fail
05motr-single-node/12sns-cc-io-tests

✔️Passed59
📁

01motr-single-node/46m0crate
01motr-single-node/01kernel-tests
01motr-single-node/00userspace-tests
01motr-single-node/03initscript-tests
01motr-single-node/30hagen-test
01motr-single-node/29confgen-test
01motr-single-node/35m0singlenode
01motr-single-node/04net-tests
01motr-single-node/05rpcping-tests
01motr-single-node/28motr-sys-kvs-test
01motr-single-node/06console-tests
01motr-single-node/52singlenode-sanity
02motr-single-node/20pool-version-test
02motr-single-node/21spiel-test
02motr-single-node/47motr-tests-user-kernel
02motr-single-node/09poolmach-tests
02motr-single-node/41motr-conf-update
02motr-single-node/08degraded-mode-tests
02motr-single-node/24m0d-fsync-test
02motr-single-node/02system-tests
02motr-single-node/22rpc-cancel-test
02motr-single-node/53clusterusage-alert
02motr-single-node/23m0d-signal-test
02motr-single-node/51kem
03motr-single-node/54sns-repair-motr-1f
03motr-single-node/59sns-repair-motr-abort
03motr-single-node/17sss-st-test
03motr-single-node/58sns-repair-motr-ios-fail
03motr-single-node/60sns-repair-motr-abort-quiesce
03motr-single-node/55sns-repair-motr-1n-1f
03motr-single-node/56sns-repair-motr-mf
03motr-single-node/61spiel-multi-confd
03motr-single-node/16conf-st-test
03motr-single-node/57sns-repair-motr-1k-1f
03motr-single-node/36spare-reservation
04motr-single-node/51motr-rmw
04motr-single-node/50motr-rm-lock-cc-io
04motr-single-node/25spiel-sns-repair-test
04motr-single-node/33motr-st
04motr-single-node/19sns-abort-test
04motr-single-node/32m0t1fs-rconfc-fail-test
04motr-single-node/34sns-repair-1n-1f
04motr-single-node/26spiel-sns-repair-quiesce-test
04motr-single-node/49motr-rpc-cancel
04motr-single-node/27sns-repair-io-fail-test
04motr-single-node/48motr-raid0-io
05motr-single-node/40motr-dgmode
05motr-single-node/42motr-utils
05motr-single-node/13sns-repair-quiesce
05motr-single-node/45motr-sns-repair-N-1
05motr-single-node/11sns-multi-tests
05motr-single-node/44motr-sns-repair
05motr-single-node/14m0t1fs-fsync-test
05motr-single-node/43motr-sync-replication
05motr-single-node/38sns-abort-quiesce-test
05motr-single-node/15m0t1fs-fwait-test
05motr-single-node/18m0mount-test
05motr-single-node/10sns-single-tests
motr-single-node/62dix-repair-st-lookup-insert

Total64🔗

CppCheck Summary

   Cppcheck: No new warnings found 👍

@huanghua78
Copy link

"./scripts/m0 run-st 52*" passed locally in DevVM.
Before that, please install genders,

apt-get install genders

@andriytk
Copy link
Contributor Author

Yes, I've updated the OVA with genders also.

@huanghua78 huanghua78 merged commit 1490598 into Seagate:main Apr 28, 2021
@andriytk andriytk deleted the fix-ubuntu18-build branch May 4, 2021 08:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants