Skip to content

[pipeline] Add option --privileged for running slave docker#1067

Merged
lguohan merged 1 commit intosonic-net:masterfrom
jimmyzhai:fix_settimeofday_failure
Jun 16, 2022
Merged

[pipeline] Add option --privileged for running slave docker#1067
lguohan merged 1 commit intosonic-net:masterfrom
jimmyzhai:fix_settimeofday_failure

Conversation

@jimmyzhai
Copy link
Copy Markdown
Contributor

@jimmyzhai jimmyzhai commented Jun 16, 2022

In azp run, the following failure always happens at the stage of make check of building syncd.

Making check in syncd
make[2]: Entering directory '/__w/1/s/syncd'
make check-TESTS
make[3]: Entering directory '/__w/1/s/syncd'
tests: tests.cpp:843: void test_watchdog_timer_clock_rollback(): Assertion `settimeofday(&currentTime, NULL) == 0' failed.
/bin/bash: line 5: 13004 Aborted (core dumped) ${dir}$tst
FAIL: tests

The execution of settimeofday(&currentTime, NULL) fails in slave docker with errno EPERM, because CAP_SYS_TIME capability is dropped in docker. Using option --privileged gives docker extended privileges for its success.

This failure has existed for a long time in azp build and is not exposed till #1050.

@jimmyzhai jimmyzhai requested review from kcudnik and lguohan June 16, 2022 02:23
@lguohan lguohan merged commit bc3487e into sonic-net:master Jun 16, 2022
@stepanblyschak
Copy link
Copy Markdown
Contributor

stepanblyschak commented Jun 16, 2022

@jimmyzhai
Copy link
Copy Markdown
Contributor Author

@qiluo-msft
Copy link
Copy Markdown
Contributor

@jimmyzhai Does it only happen in AZP? Do we need to fix document like https://github.com/Azure/sonic-buildimage/blob/master/README.buildsystem.md?

lguohan pushed a commit that referenced this pull request Jun 22, 2022
The fix #1067 is not enough. If docker user is non-root, set capability CAP_SYS_TIME for settimeofday success in syncd test, then test_watchdog_timer_clock_rollback can be run.

Co-authored-by: junhuazhai <junhuazhai@contoso.com>
qiluo-msft pushed a commit to sonic-net/sonic-swss-common that referenced this pull request Jun 22, 2022
…s' (#633)

Following sonic-net/sonic-sairedis#1067 and sonic-net/sonic-sairedis#1068, it fixes the below failure at `make check` of building syncd in step 'Compile sonic sairedis':

```
Making check in syncd
make[2]: Entering directory '/__w/1/s/syncd'
make check-TESTS
make[3]: Entering directory '/__w/1/s/syncd'
tests: tests.cpp:843: void test_watchdog_timer_clock_rollback(): Assertion `settimeofday(&currentTime, NULL) == 0' failed.
/bin/bash: line 5: 13004 Aborted (core dumped) ${dir}$tst
FAIL: tests
```
itamar-talmon pushed a commit to itamar-talmon/sonic-swss-common that referenced this pull request Jul 19, 2022
…s' (sonic-net#633)

Following sonic-net/sonic-sairedis#1067 and sonic-net/sonic-sairedis#1068, it fixes the below failure at `make check` of building syncd in step 'Compile sonic sairedis':

```
Making check in syncd
make[2]: Entering directory '/__w/1/s/syncd'
make check-TESTS
make[3]: Entering directory '/__w/1/s/syncd'
tests: tests.cpp:843: void test_watchdog_timer_clock_rollback(): Assertion `settimeofday(&currentTime, NULL) == 0' failed.
/bin/bash: line 5: 13004 Aborted (core dumped) ${dir}$tst
FAIL: tests
```
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
In azp run, the following failure always happens at the stage of `make check` of building syncd. 

```
Making check in syncd
make[2]: Entering directory '/__w/1/s/syncd'
make check-TESTS
make[3]: Entering directory '/__w/1/s/syncd'
tests: tests.cpp:843: void test_watchdog_timer_clock_rollback(): Assertion `settimeofday(&currentTime, NULL) == 0' failed.
/bin/bash: line 5: 13004 Aborted (core dumped) ${dir}$tst
FAIL: tests
```
The execution of `settimeofday(&currentTime, NULL)` fails in slave docker with errno **EPERM**, because CAP_SYS_TIME capability is dropped in docker. Using option `--privileged` gives docker extended privileges for its success.

This failure has existed for a long time in azp build and is not exposed till sonic-net#1050.
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
…net#1068)

The fix sonic-net#1067 is not enough. If docker user is non-root, set capability CAP_SYS_TIME for settimeofday success in syncd test, then test_watchdog_timer_clock_rollback can be run.

Co-authored-by: junhuazhai <junhuazhai@contoso.com>
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.

4 participants