Skip to content

Jenkinsfile: avoid errors from find#39685

Merged
thaJeztah merged 1 commit intomoby:masterfrom
kolyshkin:jenkins-find
Aug 10, 2019
Merged

Jenkinsfile: avoid errors from find#39685
thaJeztah merged 1 commit intomoby:masterfrom
kolyshkin:jenkins-find

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

There are many errors like this one:

01:39:28.750 find: ‘bundles/test-integration/dbc77018d39a5/root/overlay2/f49953a883daceee60a481dd8e1e37b0f806d309258197d6ba0f6871236d3d47/work/work’: Permission denied

(probably caused by bad permissions)

These directories are not to be looked at when we search for logs, so
let's exclude them. While at it, let the find know we're only looking
for files.

@kolyshkin
Copy link
Copy Markdown
Contributor Author

OK, I'm not sure why but the old Jenkinsfile is used. How do I test changes to Jenkinsfile? @andrewhsu maybe you know?

@thaJeztah
Copy link
Copy Markdown
Member

@kolyshkin I think Jenkins is configured to accept jenkinsfile changes only from certain people/users

@psftw could you check?

@andrewhsu
Copy link
Copy Markdown
Contributor

@kolyshkin the Jenkinsfile changes you made to this PR looks like it took effect on the new jenkins rig ci.docker.com:
https://ci.docker.com/public/job/moby/job/PR-39685/1/execution/node/230/log/

01:48:13.445  Creating janky-bundles.tar.gz
01:48:13.445  + find bundles -not -path */root/overlay2/* -type f -name *.log -o -name *.prof -o -name integration.test
01:48:13.445  + xargs tar -czf janky-bundles.tar.gz
01:48:13.445  find: ‘bundles/test-integration/DockerDaemonSuite.TestDaemonBridgeExternal/da5cc1e78ecfb/root/overlay2/c60bef58b7f8e84cf1edf4d3aa45d9ab5292e5b9bb4d147f256d6f3cb2974801/work/work’: Permission denied
01:48:13.445  find: ‘bundles/test-integration/DockerDaemonSuite.TestDaemonBridgeExternal/da5cc1e78ecfb/root/overlay2/c60bef58b7f8e84cf1edf4d3aa45d9ab5292e5b9bb4d147f256d6f3cb2974801-init/work/work’: Permission denied

For now, the old jenkins.dockerproject.org PR check job janky is still run which does not use Jenkinsfile. The old jenkins rig will be turned off in the future when the new Jenkinsfile is properly running a PR check jobs we care about from the legacy jobs.

Copy link
Copy Markdown
Contributor

@tiborvass tiborvass left a comment

Choose a reason for hiding this comment

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

your find assumes a certain working directory, which looks incorrect (it's one level deeper) and btw will most certainly fail on my PR (#39682), so you should probably make this more robust. Does ** work for arbitrarily nested ?

@kolyshkin
Copy link
Copy Markdown
Contributor Author

My find was not doing what it should to begin with. Please see updated commit.

@kolyshkin
Copy link
Copy Markdown
Contributor Author

forgot -a to git commit --amend for the umpteenth time.

tiborvass
tiborvass previously approved these changes Aug 7, 2019
@tiborvass tiborvass dismissed their stale review August 7, 2019 21:06

accidentally approved

@kolyshkin
Copy link
Copy Markdown
Contributor Author

it works (almost... I had not anticipated root/*/overlay2 case)

[2019-08-07T20:20:20.475Z] + find bundles -path */root/overlay2 -prune -o -type f ( -name *.log -o -name *.prof -o -name integration.test ) -print

[2019-08-07T20:20:20.475Z] + xargs tar -czf janky-bundles.tar.gz

[2019-08-07T20:20:20.475Z] find: 'bundles/test-integration/DockerDaemonSuite.TestDaemonUserNamespaceRootSetting/d9ea96ae28da6/root/165536.165536/overlay2/91988bda06922abba2a956a5afe1db5713dce3f73fa9c00a601d272e49d16c7c-init/work/work': Permission denied

[2019-08-07T20:20:20.475Z] find: 'bundles/test-integration/DockerDaemonSuite.TestDaemonUserNamespaceRootSetting/d9ea96ae28da6/root/165536.165536/overlay2/9659dbdb8781fb1a2f4208303ee082e5fa7abf89c9151fd378f198e93475fedd/work/work': Permission denied

[2019-08-07T20:20:20.475Z] find: 'bundles/test-integration/DockerDaemonSuite.TestDaemonUserNamespaceRootSetting/d9ea96ae28da6/root/165536.165536/overlay2/91988bda06922abba2a956a5afe1db5713dce3f73fa9c00a601d272e49d16c7c/work/work': Permission denied

[2019-08-07T20:20:20.475Z] find: 'bundles/test-integration/DockerDaemonSuite.TestDaemonUserNamespaceRootSetting/d9ea96ae28da6/root/165536.165536/overlay2/9659dbdb8781fb1a2f4208303ee082e5fa7abf89c9151fd378f198e93475fedd-init/work/work': Permission denied

@thaJeztah
Copy link
Copy Markdown
Member

Note that there are tests with subtests that have deeper directory nesting

@kolyshkin
Copy link
Copy Markdown
Contributor Author

kolyshkin commented Aug 7, 2019

Note that there are tests with subtests that have deeper directory nesting

it does not matter for find -- it just traverses the whole directory tree (no matter how deep) looking for files to match the pattern. What I'm trying to do here is to ignore graphdriver directories (which are either */root/overlay2 or */root/*/overlay2, where * is any number of directories).

@thaJeztah
Copy link
Copy Markdown
Member

Ah, okay; that looks good (thought I'd double-check)

@kolyshkin
Copy link
Copy Markdown
Contributor Author

Ah, okay; that looks good (thought I'd double-check)

This commit is not changing anything wrt how deep find will go, except for it won't go into certain directories (whose full patch matches */root*overlay2).

@thaJeztah
Copy link
Copy Markdown
Member

Not sure what went wrong on RS1 https://jenkins.dockerproject.org/job/Docker-PRs-WoW-RS1/26308/console

Triggering again

21:54:08 No such image: sha256:f6ae774a1c32467b422c8fb40728d051d433591035023c00b39123e197873cbf
21:54:08 
21:54:08 
21:54:08 ERROR: Failed 'ERROR: Failed to build image from Dockerfile.windows' at 08/07/2019 21:54:08
21:54:08 At C:\gopath\src\github.com\docker\docker\hack\ci\windows.ps1:448 char:12
21:54:08 +            Throw "ERROR: Failed to build image from Dockerfile.window ...
21:54:08 +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21:54:08 

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Copy Markdown
Member

@kolyshkin still WIP?

@thaJeztah
Copy link
Copy Markdown
Member

needs a rebase now; probably should be copied to all stages?

@kolyshkin kolyshkin changed the title [WIP] Jenkinsfile: avoid errors from find Jenkinsfile: avoid errors from find Aug 9, 2019
There are many errors like this one:

> 01:39:28.750 find: ‘bundles/test-integration/dbc77018d39a5/root/overlay2/f49953a883daceee60a481dd8e1e37b0f806d309258197d6ba0f6871236d3d47/work/work’: Permission denied

(probably caused by bad permissions)

These directories are not to be looked at when we search for logs, so
let's exclude them. It's not super easy to do in find, here is some
kind of an explanation for find arguments

```
PATTERN ACTION OR PATTERN                           ACTION
-path X -prune -o -type f [AND] (-name A -o name B) -print
```

(here -o means OR, while AND is implicit)

While at it,
 - let the find know we're only looking for files, not directories
 - remove a subshell and || true
 - remove `-name integration.test` (there are no such files)

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Copy Markdown
Contributor Author

rebased; should be good to go but let's wait for ci

@thaJeztah
Copy link
Copy Markdown
Member

oh, nice one: https://jenkins.dockerproject.org/job/Docker-PRs/55373/console

22:20:38 #44 34.30 Err:1 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 liblzo2-2 amd64 2.08-1.2+b2
22:20:38 #44 34.30   Could not connect to cdn-fastly.deb.debian.org:80 (151.101.52.204). - connect (111: Connection refused) [IP: 151.101.52.204 80]
22:20:38 #44 34.30 Err:2 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 btrfs-progs amd64 4.7.3-1
22:20:38 #44 34.30   Unable to connect to cdn-fastly.deb.debian.org:http: [IP: 151.101.52.204 80]
22:20:38 #44 34.30 Err:3 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 btrfs-tools amd64 4.7.3-1
22:20:38 #44 34.30   Unable to connect to cdn-fastly.deb.debian.org:http: [IP: 151.101.52.204 80]
22:20:38 #44 34.31 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.08-1.2+b2_amd64.deb  Could not connect to cdn-fastly.deb.debian.org:80 (151.101.52.204). - connect (111: Connection refused) [IP: 151.101.52.204 80]
22:20:38 #44 34.31 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/b/btrfs-progs/btrfs-progs_4.7.3-1_amd64.deb  Unable to connect to cdn-fastly.deb.debian.org:http: [IP: 151.101.52.204 80]
22:20:38 #44 34.31 E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/b/btrfs-progs/btrfs-tools_4.7.3-1_amd64.deb  Unable to connect to cdn-fastly.deb.debian.org:http: [IP: 151.101.52.204 80]
22:20:38 #44 34.31 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
22:20:38 #44 ERROR: executor failed running [/bin/sh -c apt-get update && apt-get install -y --no-install-recommends 	btrfs-tools 	&& rm -rf /var/lib/apt/lists/*]: exit code: 100

@kolyshkin
Copy link
Copy Markdown
Contributor Author

exp CI restarted

@kolyshkin
Copy link
Copy Markdown
Contributor Author

kolyshkin commented Aug 10, 2019

CI error in docker-py, not sure why but def unrelated.

[2019-08-09T22:30:40.095Z] =================================== FAILURES ===================================
[2019-08-09T22:30:40.095Z] ___________________ PullImageTest.test_pull_invalid_platform ___________________
[2019-08-09T22:30:40.095Z] tests/integration/api_image_test.py:72: in test_pull_invalid_platform
[2019-08-09T22:30:40.095Z]     assert excinfo.value.status_code == 500
[2019-08-09T22:30:40.095Z] E   AssertionError: assert 400 == 500
[2019-08-09T22:30:40.095Z] E    +  where 400 = APIError(HTTPError('400 Client Error: Bad Request for url: http+docker://localhost/v1.35/images/create?fromImage=hello-world&platform=foobar',),).status_code
[2019-08-09T22:30:40.095Z] E    +    where APIError(HTTPError('400 Client Error: Bad Request for url: http+docker://localhost/v1.35/images/create?fromImage=hello-world&platform=foobar',),) = <ExceptionInfo APIError tblen=4>.value
[2019-08-09T22:30:40.095Z] =========================== short test summary info ============================

@kolyshkin
Copy link
Copy Markdown
Contributor Author

OK this one is ready, artifacts looks same as before i.e. seems to be no regression
@tiborvass PTAL

@thaJeztah
Copy link
Copy Markdown
Member

opened a PR for the failing docker-py test (my bad); #39714

@thaJeztah
Copy link
Copy Markdown
Member

Output looks good: no more errors/warnings:

[2019-08-10T00:07:54.519Z] + echo Creating janky-bundles.tar.gz
[2019-08-10T00:07:54.519Z] Creating janky-bundles.tar.gz
[2019-08-10T00:07:54.519Z] + find bundles -path */root/*overlay2 -prune -o -type f ( -name *.log -o -name *.prof ) -print
[2019-08-10T00:07:54.519Z] + xargs tar -czf janky-bundles.tar.gz
[2019-08-10T00:14:27.115Z] + echo Creating powerpc-bundles.tar.gz
[2019-08-10T00:14:27.115Z] Creating powerpc-bundles.tar.gz
[2019-08-10T00:14:27.115Z] + find bundles -path */root/*overlay2 -prune -o -type f ( -name *.log -o -name *.prof ) -print
[2019-08-10T00:14:27.115Z] + xargs tar -czf powerpc-bundles.tar.gz
[2019-08-10T00:17:35.281Z] + echo Creating s390x-bundles.tar.gz
[2019-08-10T00:17:35.281Z] Creating s390x-bundles.tar.gz
[2019-08-10T00:17:35.281Z] + xargs tar -czf s390x-bundles.tar.gz
[2019-08-10T00:17:35.281Z] + find bundles -path */root/*overlay2 -prune -o -type f ( -name *.log -o -name *.prof ) -print

Bundles look good;

Before this patch:

tree -L 6
.
└── test-integration
    ├── DockerDaemonSuite.TestBridgeIPIsExcludedFromAllocatorPool
    │   └── d40217620191d
    │       ├── docker.log
    │       └── root
    │           └── containers
    │               └── 10884243b8f8007d5b6c31fb9eac022f4862b496b5eb6a91c90af32bb0441b0f
    ├── DockerDaemonSuite.TestBuildOnDisabledBridgeNetworkDaemon
    │   └── d730bc40a1700
    │       └── docker.log
...


1157 directories, 432 files

After this patch applied:

tree -L 6
.
└── test-integration
    ├── DockerDaemonSuite.TestBridgeIPIsExcludedFromAllocatorPool
    │   └── d71777cf89af2
    │       ├── docker.log
    │       └── root
    │           └── containers
    │               └── a350ca31a47a27f279afeba23400c0a15d0f585edd7262242eacfe016084a246
    ├── DockerDaemonSuite.TestBuildOnDisabledBridgeNetworkDaemon
    │   └── d64248256e8ef
    │       └── docker.log

...


1157 directories, 432 files

@thaJeztah
Copy link
Copy Markdown
Member

I'm merging this one 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants