image: dockerImage()

in jobs/pytorch.groovy [534:563]


              image: dockerImage(buildEnvironment, '${BUILD_ENVIRONMENT}','${DOCKER_IMAGE_TAG}','${CAFFE2_DOCKER_IMAGE_TAG}'),
              commitImage: dockerImage(buildEnvironment, '${BUILD_ENVIRONMENT}', '${DOCKER_IMAGE_COMMIT_TAG}', 'pt_${CAFFE2_DOCKER_IMAGE_COMMIT_TAG}'),
              workspaceSource: "host-copy",
              script: '''
set -ex

# Reinitialize submodules
git submodule update --init --recursive || git submodule update --init --recursive || git submodule update --init --recursive

# sccache will fail for CUDA builds if all cores are used for compiling
# TODO: move this into build.sh (https://github.com/pytorch/pytorch/pull/7361)
if [[ "$BUILD_ENVIRONMENT" == *cuda* ]] && which sccache > /dev/null; then
  export MAX_JOBS=`expr $(nproc) - 1`
fi

if test -x ".jenkins/pytorch/build.sh"; then
  .jenkins/pytorch/build.sh
else
  .jenkins/build.sh
fi

# Clean up temporary build products so that the docker image we commit
# has less size
git clean -xfd

exit 0
'''
    }

    publishers {