Commit Graph

63 Commits

Author SHA1 Message Date
Jacob Burroughs 9a9fdf3a65 Remove auditor cassandra support
Also remove the engine experiment, because that never really went
anywhere for canvas and was just one more "different" thing

[fsc-max-nodes=15]
[fsc-timeout=45]

Change-Id: Ib990deb94bf5e25d587d554f64c535c9b96cce26
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314469
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-04-03 15:40:22 +00:00
Aaron Ogata 1e6312a404 move nodeLabel out of canvas-builds
refs DE-1359

Change-Id: I09cbcb708f9f8451a205b4fc470c27224bac49c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313499
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>
Build-Review: Aaron Ogata <aogata@instructure.com>
2023-03-16 19:41:00 +00:00
Aaron Ogata 983bc779d3 allow node label to be overridden for testing
refs DE-1258

[canvas-builds-refspec=2b6856c05a90d298d5c25fb613233df9bc22af12]

Change-Id: Ic529fc5afce5a06c94a7efc71f8da01a55142c69
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295032
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-06-29 14:41:05 +00:00
Bobby Buten 8be4bb35c3 purge pulsar from canvas
refs DE-966
flag=none

TEST PLAN:
  ensure build completes and all tests run successfully

Change-Id: I82ef402eb790fafce53393b17b4695c9151e1745
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
QA-Review: Bobby Buten <bobby.buten@instructure.com>
Product-Review: Bobby Buten <bobby.buten@instructure.com>
2022-01-03 20:37:22 +00:00
Ethan Vizitei eab0f468e0 reset message bus settings to avoid state pollution from specs
refs FOO-2423
flag=none

TEST PLAN:
  1) run pulsar specs lots of times with many seeds
  2) they don't fail.

Change-Id: Ide7fbaebee5ddac37bf2db03d8699f32d1b57d56
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275315
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-06 17:13:21 +00:00
Ethan Vizitei 2846be5b64 flip pulsar specs back off to keep build healthy
refs FOO-2423

Change-Id: I6bf908eb8df716e63675bbcdd93392dbd7c3d6c9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275271
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-05 22:14:38 +00:00
Ethan Vizitei c7c41a6747 speed up pulsar tests
refs FOO-2423
flag=none

Patch multiple sources of unintentionally shared
state between specs, and reduce
intentional wait periods in
the pulsar consumer process.

TEST PLAN:

  1) execute pulsar tests in vendor gems build
  2) runtime is cut down to less than 4 minutes

Change-Id: I9a4d990b01f2c20ea78f4a59926dffbd91d3b32f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275183
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-05 20:35:26 +00:00
James Butters 4d004744be skip pulsar until more stable
Change-Id: I334ed7e2e4050c9d730f01dae70d7e6ef58d6d8b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270702
Tested-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2021-08-04 17:06:14 +00:00
Kyle Rosenbaum 5677d7531d remove docker_base podTemplate usage, cleanup nodeRequirements usage
refs DE-718

test plan:
  - EC2 builds continue to work as expected

Change-Id: Ibed627a4e1d4b1e40520036df2b8a4e1d29d5fcc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267159
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-06-22 15:19:48 +00:00
Aaron Ogata 682da3f865 convert vendored gems to extendedStage
refs DE-716

Change-Id: I7b3da7250a5c7ba815bae54ce91505c5b9b2a70b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267160
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-06-15 18:21:22 +00:00
Aaron Ogata 4a69c8c99f remove broken vendored gems html reports
refs DE-716

Test Plan
1. Vendored gems passes
2. When vendored gems fails, the build summary report has equivalent UX to today

Change-Id: Ie2b78fa7f14736816f44d276e0442e6695a9dfa6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-06-15 16:53:17 +00:00
Andrea Cirulli 70bb73c35b add jenkins file to the groovy linter stage
refs DE-690
flag = none

test-plan:
- Build passes
- Build trigger groovy linter stage if a change to Jenkinsfile is
made
- Build fails if a Jenkinsfile has linter issues

Change-Id: Ifdabb4f28f6124afcb6621844375a8de4b35d453
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265279
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-05-19 20:51:13 +00:00
Ethan Vizitei 159084865a further expand retry conditions
Change-Id: If6fd3bf52ddcbf9995e2cc0e833ea2b28abfa8bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265026
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-05-19 17:54:39 +00:00
Andrea Cirulli 796257539e fix linter rules
Fix following linter issues:
- ParameterName
- CouldBeSwitchStatement
- UnusedMethodParameter

refs DE-690
flag = none

test-plan:
- Build passes
- QA build that triggers FSC and executes the spec changed

Change-Id: I11baf5094e96d33bc6be7f5f03d680f34cc1d026
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265266
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2021-05-19 15:43:33 +00:00
Andrea Cirulli f4757ca66a fix linter issues
Fix the following linter issues:
- UnusedVariable
- ClosureAsLastMethodParameter
- CatchException
- UnnecessaryGString
- ImplicitClosureParameter

test-plan:
- Build passes
- FSC qa build passes and it executes the changed test

Change-Id: I9f814e8f3466cd6a271a3b24afc410c32fc66022
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265218
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
2021-05-18 20:11:48 +00:00
Andrea Cirulli 3f057e9c0c fix jenkins files linter issues
Fix linter issues related to variable name, space after closing bracket.

refs DE-690
flag = none

test-plan:
- Build passes
- QA build with spec change executes fsc stage

Change-Id: I6f985fb3dfa8627703a27325b1eb25fae4585505
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265188
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-05-18 18:58:33 +00:00
Andrea Cirulli 67d6ccc360 fix jenkins file linter issues autofixable
refs DE-690
flag = none

test-plan:
- Build passes

Change-Id: Ie748a1e585ce8e3ec4978c7a5faa45dab524a905
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265184
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-05-18 16:48:15 +00:00
Ethan Vizitei 9f6dc1c1a3 include docker logs for pulsar container anytime it fails to bootstrap
Change-Id: Idb04c183ab2ef163690e61ad1c5e846bd0a8afb8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264163
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-05-04 16:19:33 +00:00
Ethan Vizitei 117c6dbc1c match pulsar retry strategy to failure pattern
Change-Id: Ib91b2ce81159f07f313d532b68ee41529877775e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263758
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-04-28 16:03:59 +00:00
Kyle Rosenbaum 1e43e05241 add podTemplate and container definition to all applicable stages
refs DE-558, DE-582

[use-kubernetes]
[canvas-builds-refspec=24d3d83e8034ac6ad5380936498e1dcf01ab50eb]

modify the existing nodeRequirements to add podTemplate and
container definitions. initially, the podTemplate to be used
is docker-in-docker. the "use-kubernetes" flag must be set
as well.

test plan:
- build executes on k8s nodes in EKS when "use-kubernetes"
flag is set.
- build executes on EC2 when "use-kubernetes" flag is not set.

Change-Id: I13c68e5420bbf414532518eaf69ac82f9310bfbf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-27 19:47:25 +00:00
Kyle Rosenbaum 0d0bf81b9a mirror apachepulsar/pulsar:latest to starlord
this will fix pulsar failures related to rate limiting

Change-Id: I3486e41106d6a3e7aae6b8747febc88c2642101d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263762
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-27 17:39:03 +00:00
Ethan Vizitei b43a724c27 idea for retrying on failed pulsar boot in jenkins
Change-Id: I90900c9a939374d937f72ca6a034eb6dc4f524d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263565
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-04-26 15:48:07 +00:00
Aaron Ogata a03e821d17 improve pulsar bootstrap pre-execution check
refs DE-639

Pulsar has 2 services internally, dispatcher and admin server, make
sure both are ready before executing the admin work.

Test Plan
1. The build passes
2. Build is monitored for rest of day for any further intermittent failures

Change-Id: I14f9911285070e727003dc8c0ade5aa067388594
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263430
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-04-22 15:22:20 +00:00
Kyle Rosenbaum 16469f7cfa add support for EKS container to protectedNode requirements
refs DE-558, DE-582

[canvas-builds-refspec=f9c80c0ac4b80de60ac50633523e30d5c2eb28b1]

modify the existing nodeRequirements call to pass a Map containing
the label as well as the possibility of container or podTemplate
params. this change only modifies the existing nodeRequirements to
continue using EC2 agents, not EKS.

test plan:
- builds still work as expected acquiring nodes

Change-Id: I0458a13a4c85e37aeb2f5dc56347e27101705646
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263208
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2021-04-20 21:51:16 +00:00
Aaron Ogata b7b9d8cc4d remove redundant node clean-up code
refs DE-338

The protectedNode() function now handles automatic cleanup before / after a node is used, so much of the code here can be removed.

Test Plan:
1. Main build passes, FSC passes

[canvas-builds-refspec=81cc926fe89d6efd9f604d0c573630318fb4eb86]

Change-Id: Ie21d242aabe9826353f05149abb304a85223cebc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-04-19 16:37:23 +00:00
Ethan Vizitei a0624c197c MessageBus integration vector
refs FOO-1835
refs FOO-1850
closes FOO-1862

TEST PLAN:
  1) MessageBus specs actually run in build

Change-Id: Iaec6b7206830bd2d6d28177d8fc3b9aa4680a800
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262754
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-04-15 22:14:38 +00:00
Aaron Ogata 5d1fb9b734 convert on*Result -> onStageEnded
refs DE-628

Test Plan:
1. Build summary report works for sub-jobs and normal stages
2. Sub-jobs run cleanupFn

[canvas-builds-refspec=82ccf7ae185871e45c658f225cc664ef05cda74d]

Change-Id: I9d4476b75e6488bcc388a89e9f7cf87150d0ae6d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262951
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-04-15 13:54:20 +00:00
Aaron Ogata 3027dcdbd7 rename handler to hooks
refs DE-628

[canvas-builds-refspec=a5aca2425b1f885f5fcb4298479c0081d73065ff]

Change-Id: I0581d820fc521fb4857c04a28804be1c9a2d19a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262947
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-04-14 22:50:58 +00:00
Aaron Ogata b3f6ee3b54 fix allow-stages directive
refs DE-621

Change-Id: I77e620defe993e37425cfd1f6e9c78d2574fb922
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262904
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-04-14 17:37:00 +00:00
Aaron Ogata 1a2b0052f1 convert extendedStage -> protectedNode to nodeRequirements() pattern
refs DE-621

Make the stage configuration aware of its node requirements for future EKS support and allowing nospot to be removed.

Test Plan:
1. RSpec / Selenium build works
2. Contract Tests works
3. JS works
4. FSC works
5. Vendored Gems works

[canvas-builds-refspec=480f3570a6a6ebee5cedaecbb3a089476a008215]

Change-Id: I6cb63df20abe8c1f913db4f1b21bb01bd4d30312
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262898
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>
2021-04-14 15:23:01 +00:00
Aaron Ogata a9af520c70 remove cleanupFn usage from Vendored Gems job
refs DE-624

As part of making extendedStage() aware of stage node requirements, we need to remove consumers of the cleanupFn() functionality and replace them with extendedStage() compatible patterns.

Test Plan:
1. Vendored Gems behaves correctly

Change-Id: I81d2e003abe64fd0414ee9434cf61c602bda9f08
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262862
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-13 22:19:02 +00:00
Aaron Ogata e18887bf26 move docker cleanup to protectedNode() handler
refs DE-624

As part of making extendedStage() aware of stage node requirements, we need to remove consumers of the cleanupFn() functionality and replace them with extendedStage() compatible patterns.

Test Plan:
1. All stages execute correctly

[canvas-builds-refspec=07f1a75ee23f8f6a9a1bbe062316373b761e7a30]

Change-Id: Ica11b78ebead5c9239dea112677a077654c7090d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262814
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-13 18:02:41 +00:00
Aaron Ogata 28454e524d work around flakey starlord token issue
refs DE-579

Change-Id: I0889b9e34c27a667ffa0573982bb77a37f103dc3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261023
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-03-18 18:20:52 +00:00
Ethan Vizitei b33b74151b stage 1: audits engine extract
refs FOO-1644
[fsc-propagate=false]

  - create engines directory
  - put one empty-ish engine in there
  - add general engines dependency to
     gemfile construction
  - update build pipeline to run tests all engines
     just like gems
  - add engines directory to jenkins-cache build
  - get rspec running successfully with a dummy app
     inside the audit engine
  - stop failing with no message if environment
     unloadable in css config
  - generally set pattern in build artifacts and in
     code organization for pulling out an engine

Change-Id: I8650f5e0aa7d72556d2f02156886d2b503a111fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258988
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-03-04 20:27:06 +00:00
Aaron Ogata 3e92cc4498 move execute function under libraryScript
refs DE-442

[canvas-builds-refspec=eecea52ff75a74be10cd0d2c1434dc917bd726af]

Change-Id: I7412d590e1c08a47eb48b1fd82af9eaf0d5eb145
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256507
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-01-12 00:32:08 +00:00
Andrea Cirulli 4d672c2f6a add global timeout and reevaluate all timeouts
Add timeout to all builds and set the proper values for the existing
timeouts

refs DE-307
flag = none

test-plan:
- Force the build to timeout and check that jenkins fails the build

Change-Id: I2e3ae36f828da1bc047bf5a2cfbc79c167b84d5f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256171
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-01-11 21:24:03 +00:00
James Butters cc45c56cb3 always checkout master code
we want to always checkout master code for testing on jenkins, unless
there are changes to our build scripts then pull the gerrit refspec.

flag = none

Test Plan:
- Normal Jenkins build passes.
- changes to docker-compose.new-jeknins* causes sub builds
  to checkout code from gerrit refspec.
- changes to any file in build/new-jenkins/ causes sub
  builds to checkout code from gerrit refspec.
- Normal build with no changes to Jenkinsfile*, build/new-jenkins/,
  or docker-compose.new-jenkins* sub builds checkout master.

Change-Id: If1224a44b52b00f0f056b9552cd562809fc7eaa8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252999
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-11-18 21:48:19 +00:00
Andrea Cirulli ba4ad02c38 abstract checkout code in jenkinsfiles
refs DE-351
flag = none

test-plan:
- Build passes
- Test FSC is working

Change-Id: Id3844dd12600e5d3a80d267bf67916c4d43d2548
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251743
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2020-11-04 20:58:00 +00:00
James Butters 986c935bdf checkout Jenkinsfile from master
These changes need to be accompanied by changes
to Jenkins config:
  - main-canvas-postgres-12-ruby-2.6 and
  main-canvas-postgres-12-ruby-2.6-postmerge, SCM
  refspec changed to master
  - sub-builds scm changed from canvas-lms-refspec
  to JENKINSFILE_REFSPEC defaulting to master
  - add Jenkins parameter JENKINSFILE_REFSPEC to sub-builds
  - add new Jenkins build for main Jenkinsfile changes
  - main build don't trigger on Jenkinsfile changes using
    forbidden path.

Testing once merged:
- verify builds without Jenkinfile changes pull the master
  version of Jenkinsfile
  - verify sub-builds as well
- verify gerrit with Jenkinsfile changes triggers new build
  - verify sub-builds get Jenkinsfiles from gerrit not master
  - test a combination of Jenkinsfiles, not just the main one
  - verify main build is not triggered
- run a plugin build without canvas-lms-refspec
- run a plugin build with canvas-lms-refspec

Change-Id: Ic6be8b446f80d57f7b0f25c77e6cffb959e03236
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251634
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
2020-11-03 03:08:08 +00:00
Aaron Ogata 2dcc3df114 introduce canvas-builds-refspec commit flag
refs DE-349

[canvas-builds-refspec=f04c7902ccabadb61cee13fa93f09b1184925b84]

Test Plan:
1. Build pulls master when flag does not exist
2. Build pulls specified commit when flag exists
3. Build pulls master for post-merge when flag exists

Change-Id: I365efd3a305d08f7a3df76fd44799756104b4c1f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251635
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-11-02 19:33:54 +00:00
Aaron Ogata 1bfb887395 cache migrations by md5sum
refs DE-23

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-23-test]

flag = none

Test Plan:
1. Jenkins pre-merge build with a new migration re-builds migrations
2. Jenkins pre-merge build with migrations cached does not re-build
3. Jenkins post-merge build with migrations cached re-builds migrations
4. skip-cache directive does not use the cached migration
5. Jenkins non-main builds works as expected
6. Jenkins FSC works as expected

Change-Id: I3221400a15220884740ad5136de7185a88ae2b39
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241013
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-10-08 16:39:18 +00:00
Aaron Ogata 6611328c13 protect vendored-gems against spot instance failures
refs DE-139

[skip-docker-build]

Test Plan:
1. Ensure job passes with 0 node removals
2. Ensure job retries upon node removal
3. Ensure job runs finally / clean-up block(s) correctly

Change-Id: I5a5111c6630abff21beec7b2bd72cee92b969074
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243217
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-07-27 18:09:50 +00:00
Rex Fleischer c5c3820042 use shared library for configuration
fixes: CCI-389

Test-Plan:
we need to run all the builds that we can for this:
- the current build needs to pass
- main-for-plugins needs to be ran
- master-bouncer
- dive?
- translations

Change-Id: Iae7f9dad7668b90653a0b9a8edc20ec69fa109c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240345
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ryan Norton <rnorton@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-06-18 18:36:49 +00:00
Derek Bender 0f40402dfb Add timestamps to all builds
Closes: CCI-368

flag = none

Test Plan:
- All builds now have timestamps in the logs

Change-Id: I76f6b329c1b7f04511c6f63643964d6ccc8aa350
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236719
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-05-08 22:20:37 +00:00
Derek Bender 11c01f4b66 Configure databases in a unified manner
This patchset removes the much duplicated database.yml and instead
defaults to a DATABASE_URL scheme. There is however still present a
docker-compose/config/new-jenkins/database.yml file to temporarily allow
our internal portal service to still function until such time we can
reconfigure it.

To set up custom connection options all that is needed is setting
DATABASE_URL. See examples of this in docker-compose.yml and
docker-compose.new-jenkins.yml.

Test Plan
=========

Image:
- pulling canvas-lms:master image boots without database errors

Repo:
- given default dev environment where
  COMPOSE_FILE=docker-compose.yml:docker-compose.override.yml

- build the web and postgres images: docker-compose build web postgres
  (feel free to comment out `yarn install` and `compile_assets` in the
  Dockerfile since we won't be needing them for this test and this
  speeds things up)

- set a custom DATABASE_URL to change the database name and echo it to
  see it gets into the image correctly:

    $ docker run -it -e \
      DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
      $(docker-compose ps -q web) bash -c "echo \$DATABASE_URL"
    => postgres://postgres:sekret@postgres/canvas_custom_env

    $ docker-compose run --rm -e \
    DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
    web bash -c "echo \$DATABASE_URL"
    => postgres://postgres:sekret@postgres/canvas_custom_env

- Test that setting a custom database name via DATABASE_URL can create
  the database

    $ docker-compose run --rm -e \
    DATABASE_URL=postgres://postgres:sekret@postgres/canvas_custom_env \
    web bash -c "bin/rails db:create"
    => Created database 'canvas_custom_env'

- This patchset boots on portal

Change-Id: Ic6f3819550df94b6c98b17ef05ac2029a578cfe4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234213
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-04-28 22:42:21 +00:00
Derek Bender 7e452e280e setup postgres extensions on all test dbs
Closes: CCI-345

Test Plan:
- set your COMPOSE_FILE to docker-compose.new-jenkins.yml
- remove any existing database volumes via
  `docker rm canvas-lms_pg_data` or `docker-compose down -v`
  which will remove all volumes in the project.

- update the image with `docker-compose build postgres`
- start the container

    $ docker-compose up --detach postgres

- create a second database:

    $ docker-compose exec -T postgres createdb -U postgres \
      -T template1 canvas_test1

- check both databases:

    $ seq 0 1 | parallel "docker-compose exec -T postgres psql -x \
      -U postgres \
      -d canvas_test{} \
      -c \"SELECT * FROM pg_available_extensions \
        WHERE name = 'pg_collkey';\"

- Expect two records to be present:

    -[ RECORD 1 ]-----+-------------------------------
    name              | pg_collkey
    default_version   | 0.5.1
    installed_version | 0.5.1
    comment           | ICU collation function wrapper

    -[ RECORD 1 ]-----+-------------------------------
    name              | pg_collkey
    default_version   | 0.5.1
    installed_version | 0.5.1
    comment           | ICU collation function wrapper

Change-Id: If1417df3edab788372927b16632e146069a6829e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-27 18:25:57 +00:00
Derek Bender 7c97f93a18 disable spring in ci, again
Closes: CCI-344

Test Plan: No mention of spring in any stage that uses
build/new-jenkins/docker-compose-create-migrate-database.sh

Change-Id: Iafe5bb635bf936f83fdad1170398bb8852ebb804
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235312
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-27 15:27:13 +00:00
Derek Bender 24f95643bf Disable Spring in CI
Closes: CCI-339
flag=none

test plan: spring is not referenced in builds

Change-Id: I6c3fb84f7e5d84d6507698b77495b8d376867fb3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234826
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-22 21:33:01 +00:00
Derek Bender 68d03c9e94 Add verbose flags to builds
Closes: CCI-248
flag = none

Test Plan: builds pass

Change-Id: Ia0421d4036eb1655a10497363e0327779c69746b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229446
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
2020-03-18 13:41:00 +00:00
Derek Bender 78123c4cb6 Multiple rubies and postgres on Jenkins
Closes: CCI-214
flag = none

Test plan:
- The following builds pass:
  - main-canvas
  - main-for-coverage
  - main-canvas-postgres-12
  - main-canvas-ruby-2.6
  - main-canvas-postgres-12-ruby-2.6

Change-Id: I253d0cc8f0a808d8453fd3cbe1cfc3400ec8b12a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/227304
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-03-10 22:30:51 +00:00