Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Jenkins pipeline to build TVM CI docker images #62

Merged
merged 2 commits into from
Aug 10, 2021

Conversation

leandron
Copy link
Contributor

This is a draft Jenkins pipeline for us to daily build TVM CI docker images.

  • The new pipeline is able to build the TVM Docker images and upload them to Docker Hub
  • It makes sure that all images are guaranteed to use the same TVM git hash, using a timestamp and short hash, e.g. ci_cpu:2021_07_14-145016-c16d61b

@leandron
Copy link
Contributor Author

@leandron
Copy link
Contributor Author

Also cc @areusch @tqchen @Mousius for reviews

 * The new pipeline is able to build the TVM Docker images and
   upload them to Docker Hub

 * It makes sure that all images are guaranteed to use the same
   TVM git hash, using a timestamp and short hash, e.g.
   ci_cpu:2021_07_14-145016-c16d61b
Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

thanks @leandron for this hard work! this will be a great improvement to the docker image build process. a couple questions inline

jenkins/JenkinsFile-rebuild-docker-images Outdated Show resolved Hide resolved
stage('Build') {
parallel {

stage('ci-cpu') {
Copy link
Contributor

Choose a reason for hiding this comment

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

just one question, is it possible to define these using e.g. a for loop over a dict mapping image name to node label?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be cool, but I couldn't find a way to do it. We could do that in pure Groovy with a shared library I think, but that open a whole new way of dealing with the jobs, so I recommend we stick with a plain Jenkinsfile like this one.

} // stages
post {
success {
discordSend description: "New images published on DockerHub with tag `${TVM_DOCKER_TAG}`. Use `docker pull tlcpackstaging/<image_type>:${TVM_DOCKER_TAG}` to download the images. Image types: `ci_arm`, `ci_cpu`, `ci_gpu`, `ci_i386`, `ci_lint`, `ci_qemu`, `ci_wasm`.",
Copy link
Contributor

Choose a reason for hiding this comment

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

would be great if we can source the list of image types from above dict

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that images are built in parallel, independently. I'm not seeing a simpler way to make them share some status.

jenkins/JenkinsFile-rebuild-docker-images Outdated Show resolved Hide resolved
webhookURL: "${DISCORD_WEBHOOK}"
}
unsuccessful {
discordSend description: "Failed to generate Docker images using TVM hash `${TVM_GIT_REPO_URL}`. See logs at ${BUILD_URL}.",
Copy link
Contributor

Choose a reason for hiding this comment

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

what if some of them succeed?

Copy link
Contributor Author

@leandron leandron Aug 6, 2021

Choose a reason for hiding this comment

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

If not all of them succeed (this happens sometimes) we consider the build as failed, because one of the goals is to have a full set of images that represent a give hash on GitHub.

As the builds run in parallel, some of them might upload images to DockerHub as a side effect, and we can use if we want to, but we won't be doing further testing on partial builds.

@leandron
Copy link
Contributor Author

leandron commented Aug 9, 2021

ping @areusch for review when you have a minute

@leandron
Copy link
Contributor Author

I have no permission to merge in this repo.
Do you mind merging this @tqchen or @icemelon ?

@areusch areusch merged commit 101f005 into tlc-pack:main Aug 10, 2021
@jroesch
Copy link

jroesch commented Aug 10, 2021

Thanks for landing this @leandron !! amazing work, really appreciate you doing this, going to be transformative for the community.

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