Page MenuHomeSoftware Heritage

Push maven-index-exporter image to docker hub
Closed, MigratedEdits Locked

Description

We want to:

  • make the ci build the image (through [1] which sounds sensible enough)
  • out of a tag (like we do the other modules either swh or swh-dependency package)
  • out of a commit on master (tests ok then push with tag "latest")
  • Make the job declaratively installed out of the swh-jenkins-jobs declarations

Requisite:

  • Figure out how to create a swh-ci account and register it to the organization

(email: swh-ci@softwareheritage.org; login: swh-ci, ...). For now we stuck with
one user of the organization since there is quite some limitations on that number (3).

[1] https://www.jenkins.io/doc/book/pipeline/docker/#building-containers
swh organization on dockerhub: softwareheritage
inspiration: https://forge.softwareheritage.org/source/swh-docker/browse/master/images/build_images.sh

Note: To be able to login, one user should be part of the organization.

Event Timeline

ardumont triaged this task as Normal priority.Mar 28 2022, 6:36 PM
ardumont created this task.
ardumont updated the task description. (Show Details)
ardumont added a subscriber: douardda.

The job is now declared in our declarative job build [1]
Paper cuts got fixed along the way and the build is now fine [2]

[1] D7479

[2] https://jenkins.softwareheritage.org/job/DLSMAVEXP/job/build-and-push/2/console

Remains to install some new kind of hook that will be able to push the tag to trigger the jenkins build once triggered.
And document that new kind of hooks.

New hook got developed [1] and installed in the repository [2].

And a new build got triggered with it by tagging the maven-index-exporter repository
with v0.1.0 [3].

It built successfully the new docker image [4]

We now have a fresh new softwareheritage/maven-index-exporter:v0.1.0 [5]

[1]

root@tate:/srv/phabricator/hooks# diff post-receive-debian-deps post-receive-swh-docker-image-modules
5c5
< JOB_NAME="debian/deps/$PHABRICATOR_REPO_CALLSIGN/incoming-tag"
---
> JOB_NAME="$PHABRICATOR_REPO_CALLSIGN/build-and-push"
14c14
<                 --data-urlencode "GIT_TAG=$tag" \
---
>                 --data-urlencode "TAG=$tag" \

[2]

root@tate:/srv/phabricator/hooks# chmod 755 post-receive-swh-docker-image-modules
root@tate:/srv/phabricator/hooks# phabricator-setup-hook /srv/phabricator/repos/251/ post-receive-swh-docker-image-modules
Hook post-receive-swh-docker-image-modules successfully installed on /srv/phabricator/repos/251/:
lrwxrwxrwx 1 phabricator phabricator 52 Apr  1 15:14 post-receive -> ../../../hooks/post-receive-swh-docker-image-modules

[3]

$ git push origin --follow-tags
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 815 bytes | 815.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Triggered Jenkins job DLSMAVEXP/build-and-push: refs/tags/v0.1.0
To ssh://forge.softwareheritage.org/source/maven-index-exporter.git
 * [new tag]         v0.1.0 -> v0.1.0
 

[4] https://jenkins.softwareheritage.org/job/DLSMAVEXP/job/build-and-push/3/console

[5] https://hub.docker.com/layers/maven-index-exporter/softwareheritage/maven-index-exporter/v0.1.0/images/sha256-fc4c4b3a36003082f0635eb79d39bb6cf4d867bc9d6fa7e7a966c4023a19f1eb?context=explore

ardumont changed the task status from Open to Work in Progress.Apr 1 2022, 5:49 PM
ardumont moved this task from Backlog to in-progress on the System administration board.