always upload Linters image to starlord

refs DE-670
refs DE-500

For the EKS transition, we need to ensure that the Linters stage doesn’t run on the EC2 builder node and instead properly uses EKS containers. To do this, the Linters stage needs to always upload its image so that EKS can pull it.

Test Plan
1. Linters properly reports to the correct gerrit for main builds
2. Linters does not become the runtime bottleneck

Change-Id: Ibe28d47c13f965ee468b49ce6a74e3d08b75715d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264549
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
This commit is contained in:
Aaron Ogata 2021-05-10 11:59:51 -07:00
parent 2869b6e1cb
commit c16a81dd02
6 changed files with 8 additions and 14 deletions

4
Jenkinsfile vendored
View File

@ -258,12 +258,11 @@ pipeline {
RUBY = configuration.ruby() // RUBY_VERSION is a reserved keyword for ruby installs
RSPEC_PROCESSES = 4
LINTER_DEBUG_IMAGE = "${configuration.buildRegistryPath('linter-debug')}:${imageTagVersion()}-$TAG_SUFFIX"
CASSANDRA_PREFIX = configuration.buildRegistryPath('cassandra-migrations')
DYNAMODB_PREFIX = configuration.buildRegistryPath('dynamodb-migrations')
KARMA_BUILDER_PREFIX = configuration.buildRegistryPath('karma-builder')
KARMA_RUNNER_PREFIX = configuration.buildRegistryPath('karma-runner')
LINTERS_RUNNER_PREFIX = configuration.buildRegistryPath('linters-runner')
POSTGRES_PREFIX = configuration.buildRegistryPath('postgres-migrations')
RUBY_RUNNER_PREFIX = configuration.buildRegistryPath('ruby-runner')
YARN_RUNNER_PREFIX = configuration.buildRegistryPath('yarn-runner')
@ -282,6 +281,7 @@ pipeline {
CASSANDRA_MERGE_IMAGE = "$CASSANDRA_PREFIX:$IMAGE_CACHE_MERGE_SCOPE-$RSPEC_PROCESSES"
DYNAMODB_MERGE_IMAGE = "$DYNAMODB_PREFIX:$IMAGE_CACHE_MERGE_SCOPE-$RSPEC_PROCESSES"
KARMA_RUNNER_IMAGE = "$KARMA_RUNNER_PREFIX:$IMAGE_CACHE_UNIQUE_SCOPE"
LINTERS_RUNNER_IMAGE = "$LINTERS_RUNNER_PREFIX:$IMAGE_CACHE_UNIQUE_SCOPE"
POSTGRES_MERGE_IMAGE = "$POSTGRES_PREFIX:$IMAGE_CACHE_MERGE_SCOPE-$RSPEC_PROCESSES"
// This is primarily for the plugin build

View File

@ -47,14 +47,8 @@ def _getDockerInputs() {
def setupNode() {
credentials.withStarlordDockerLogin {
sh './build/new-jenkins/linters/docker-build.sh local/gergich'
if (configuration.getBoolean('upload-linter-debug-image', 'false')) {
sh """
docker tag local/gergich $LINTER_DEBUG_IMAGE
docker push $LINTER_DEBUG_IMAGE
"""
}
sh './build/new-jenkins/linters/docker-build.sh $LINTERS_RUNNER_IMAGE'
sh './build/new-jenkins/docker-with-flakey-network-protection.sh push $LINTERS_RUNNER_PREFIX'
sh "docker volume create $dockerVolumeName"
}

View File

@ -7,7 +7,7 @@ cat <<EOF | docker run \
--env SKIP_ESLINT \
--interactive \
--volume $GERGICH_VOLUME:/home/docker/gergich \
local/gergich /bin/bash -
$LINTERS_RUNNER_IMAGE /bin/bash -
set -ex
# when parent is not in \$GERRIT_BRANCH (i.e. master)
if ! git merge-base --is-ancestor HEAD~1 origin/\$GERRIT_BRANCH; then

View File

@ -2,7 +2,7 @@
set -o errexit -o errtrace -o nounset -o pipefail -o xtrace
cat <<EOF | docker run --interactive $DOCKER_INPUTS --volume $GERGICH_VOLUME:/home/docker/gergich local/gergich /bin/bash -
cat <<EOF | docker run --interactive $DOCKER_INPUTS --volume $GERGICH_VOLUME:/home/docker/gergich $LINTERS_RUNNER_IMAGE /bin/bash -
set -ex
export GERGICH_REVIEW_LABEL="Lint-Review"
gergich status

View File

@ -6,7 +6,7 @@ cat <<EOF | docker run \
$DOCKER_INPUTS \
--interactive \
--volume $GERGICH_VOLUME:/home/docker/gergich \
local/gergich /bin/bash -
$LINTERS_RUNNER_IMAGE /bin/bash -
set -ex
export COMPILE_ASSETS_NPM_INSTALL=0
export JS_BUILD_NO_FALLBACK=1

View File

@ -6,7 +6,7 @@ cat <<-EOF | docker run \
$DOCKER_INPUTS \
--interactive \
--volume $GERGICH_VOLUME:/home/docker/gergich \
local/gergich /bin/bash -
$LINTERS_RUNNER_IMAGE /bin/bash -
set -ex
read -r -a PLUGINS_LIST_ARR <<< "$PLUGINS_LIST"
rm -rf \$(printf 'gems/plugins/%s ' "\${PLUGINS_LIST_ARR[@]}")