Closed Bug 1644046 Opened 5 years ago Closed 5 years ago

Move Nexus-Sonatype Android build dependency to a `fetch` task

Categories

(Firefox Build System :: Task Configuration, enhancement)

enhancement

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: NarcisB, Assigned: nalexander, Mentored)

Details

Attachments

(2 files)

Started with:
https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=N_C5odL8RQeunK1v8BWzQg-1&resultStatus=testfailed%2Cbusted%2Cexception%2Crunnable&revision=2e1e58f6a3ea64c28a7b308744cf0e5196ac0bcc

Log link:
https://treeherder.mozilla.org/logviewer.html#?job_id=305397667&repo=autoland

Log snippet:
[task 2020-06-07T22:55:43.279Z] Removing intermediate container 21489dfb411e
[task 2020-06-07T22:55:43.279Z] Step 15 : RUN curl --fail --silent --location --retry 3 https://download.sonatype.com/nexus/oss/nexus-${NEXUS_VERSION}-bundle.tar.gz -o /tmp/nexus-${NEXUS_VERSION}-bundle.tar.gz
[task 2020-06-07T22:55:43.320Z] ---> Running in fd46383d450f
[task 2020-06-07T22:55:44.338Z] The command [/bin/sh -c curl --fail --silent --location --retry 3 https://download.sonatype.com/nexus/oss/nexus-${NEXUS_VERSION}-bundle.tar.gz -o /tmp/nexus-${NEXUS_VERSION}-bundle.tar.gz] returned a non-zero code: 22
kill 9

  • kill 9
    [taskcluster 2020-06-07 22:55:44.621Z] === Task Finished ===
    [taskcluster 2020-06-07 22:55:44.736Z] Artifact "public/image.tar.zst" not found at "/builds/worker/workspace/artifacts/image.tar.zst"
    [taskcluster 2020-06-07 22:55:45.015Z] Unsuccessful task run with exit code: 22 completed in 213.765 seconds
Flags: needinfo?(nalexander)

Apparently the Nexus-Sonatype archive is 400+ -- that's what exit 22 means here. It might be intermittent or for real, and locally I see:

$ curl --head https://download.sonatype.com/nexus/oss/nexus-2.12.0-01-bundle.tar.gz
HTTP/2 302
date: Sun, 07 Jun 2020 23:35:26 GMT
content-type: text/html
content-length: 138
location: https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/oss/nexus-2.12.0-01-bundle.tar.gz
server: nginx
surrogate-control: max-age=1209600

So I conclude that this is intermittent. However, we should be using fetch tasks for this, so I'll mutate this ticket to that.

Type: defect → enhancement
Flags: needinfo?(nalexander)
Summary: Android Docker image build fails with "Unsuccessful task run with exit code: 22" → Avoid Android Docker image build failure by using `fetch` task for Nexus-Sonatype

It's fairly easy to add a new fetch task -- see the many examples such as this one. But the docker image tasks don't depend on the fetch type, so this might actually be hard. Maybe Tom has an opinion on feasibility/best practice here?

Mentor: nalexander
Flags: needinfo?(mozilla)

(In reply to Nick Alexander :nalexander [he/him] from comment #1)

$ curl --head https://download.sonatype.com/nexus/oss/nexus-2.12.0-01-bundle.tar.gz

Add -L, the fastly url is 404.

(In reply to Nick Alexander :nalexander [he/him] from comment #2)

It's fairly easy to add a new fetch task -- see the many examples such as this one. But the docker image tasks don't depend on the fetch type, so this might actually be hard. Maybe Tom has an opinion on feasibility/best practice here?

Technically, it would be possible, as long as none of the docker images involved in fetches are not using fetches themselves.

However, if you turn this into a fetch task, does it still need to be burned into the docker image? Can't it be fetched like others?

(In reply to Mike Hommey [:glandium] from comment #3)

(In reply to Nick Alexander :nalexander [he/him] from comment #1)

$ curl --head https://download.sonatype.com/nexus/oss/nexus-2.12.0-01-bundle.tar.gz

Add -L, the fastly url is 404.

Gah, I even noted that we do follow redirects in the image.

(In reply to Mike Hommey [:glandium] from comment #4)

(In reply to Nick Alexander :nalexander [he/him] from comment #2)

It's fairly easy to add a new fetch task -- see the many examples such as this one. But the docker image tasks don't depend on the fetch type, so this might actually be hard. Maybe Tom has an opinion on feasibility/best practice here?

Technically, it would be possible, as long as none of the docker images involved in fetches are not using fetches themselves.

However, if you turn this into a fetch task, does it still need to be burned into the docker image? Can't it be fetched like others?

Yes, I reckon that it can be, since the dependencies task already starts the Nexus-Sonatype daemon itself. Looks like that's the sensible approach here; I can take a first pass today.

Flags: needinfo?(mozilla)
Summary: Avoid Android Docker image build failure by using `fetch` task for Nexus-Sonatype → Move Nexus-Sonatype Android build dependency to a `fetch` task

The fastly url works, now.

This brings the android-build image very close to other build
images, paving the way for it to be folded in completely. It also
makes us more resilient in the face of upstream service interruptions.

Assignee: nobody → nalexander
Status: NEW → ASSIGNED

This is probably something that we should mirror in the mobile projects.

Flags: needinfo?(jlorenzo)
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8bed4b38629 Get Sonatype nexus with fetch task rather than when building `android-build` image. r=froydnj https://hg.mozilla.org/integration/autoland/rev/496bb6dc2f9f Post: Bump Sonatype nexus to latest 2.x version. r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

(In reply to Tom Prince [:tomprince] from comment #10)

This is probably something that we should mirror in the mobile projects.

👍

I'll handle it next time we need to make some changes related to gradle and dependencies fetching.

Flags: needinfo?(jlorenzo)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: