Commit Graph

103 Commits

Author SHA1 Message Date
Aaron Ogata 6988472a2a upgrade node from 14.x to 16.x
refs DE-1264

Change-Id: If8b9d73a487b1914b19070a2249394e5116eb8d3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295892
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
2022-07-12 12:41:09 +00:00
Aaron Ogata b731ac6587 stop installing python2 in docker images
Change-Id: I1e6aae06c904d2fd57f2720057c7a1f1629680f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295294
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
2022-07-01 16:19:10 +00:00
Ahmad Amireh 14faf088c0 (i18n-js:4) use i18nliner-canvas from npm
refs FOO-2801
flag = none

[change-merged][build-registry-path=jenkins/canvas-lms/foo-2801]

gems/canvas_i18nliner is now a package @instructure/i18nliner-canvas and
lives in the same repo on github along with the 3 other i18nliner
libraries.. this was done to make it easier for maintainers to deal with
this code, since changing one part may break the other due to how
they're architected

the source on github: https://github.com/instructure/i18nliner-js

~ test plan ~

build is still OK, this only affects the generation of files, and those
i manually verified to be identical before and after

Change-Id: I78afa8a808f1699c10aced8466cfade066848bc9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294209
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-06-23 18:42:23 +00:00
Aaron Ogata a5774cd1d3 enable Rails 6.1 for Jenkins / Dev
Change-Id: I321560311670cd22ef356395f755ce39c99fd7ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292200
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
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>
2022-05-19 15:35:44 +00:00
James Butters 1432d3e72a Revert "Replace old config ymls with newer mutagen ymls"
This reverts commit d3fc54655d.

Reason for revert: broke M1, non-mutagen setup

Change-Id: Iddcfa0b086312b4ed22f400a61637ee248fd647d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288011
Tested-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-28 17:38:37 +00:00
James Butters d3fc54655d Replace old config ymls with newer mutagen ymls
flag = none

Test Plan:
-Jenkins passes
-running docker_dev_setup works from fresh machine
-running docker_dev_update works

Change-Id: I7852189b035683d7cb538b2a04319dd9659e2752
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287799
Reviewed-by: Bobby Buten <bobby.buten@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-03-25 15:38:49 +00:00
Aaron Ogata 0e13f0d033 replace CANVAS_RAILS6_x variables with CANVAS_RAILS
refs DE-523

Test Plan

1. Ensure CANVAS_RAILS override works
2. Ensure file override works
3. Ensure consul override works

Change-Id: I6eea63bba5c401428c02179a3d6187c8265ce33e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287849
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-24 18:14:52 +00:00
Jacob Burroughs 888baaf6e4 Allow using rails 6.1 in jenkins
Change-Id: I789009a956751510825092c084db128aaf085ec4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285337
Product-Review: Charley Kline <ckline@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-02-16 21:49:00 +00:00
Jeremy Stanley 0eb7d5b8ad install python3-lxml
in preparation for migrating qti_migration_tool to python 3

once that migration is complete, we can remove the python 2 version

refs DE-993

Change-Id: Iea25e7418c6e4bc87e639cc1883b216eea94ca6c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282813
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-01-19 17:22:06 +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
Keith T. Garner 5c2c850abf fix Dockerfile bundle directory inconsistency
At the top of the docker file we decale the bundle directory to be
different then the one we mkdir. Since its an environmental variable,
let's use that when we mkdir.

Change-Id: Ib3fdba5ccc475a0b10d7b05287f6975cde161f49
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281211
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-14 19:44:48 +00:00
Keith T. Garner a399030940 make pulsar the default again
We're back to makign installing pulsar the default again. Later test
builds broke without it.

Change-Id: Icb994b5dc5a566537c4c9ad513ab0f0b2ca2893e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281209
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-14 19:18:40 +00:00
Keith T. Garner f01fdbb2cb fix sync between dockerfiles and pulsar optional
In earlier attempts to make pulsar optional for our docker builds, the
dockerfiles that need to be in sync got out of sync. This returns them
to being in sync, and makes the pulsar gems optional which is better for
open source users.

Change-Id: Id8a02878bb61cf589670526da0626a90da530a58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281101
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-13 22:48:38 +00:00
Keith T. Garner 652292be62 change no pulsar to be the default
pulsar is on hold, so this patchset doesn't remove it from our docker
build, but makes it so you have to knowingly add it add it at docker
build time and at install_assets.sh time.

Change-Id: I1866191073b271b9309f96fb5363dc1f73e663a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281091
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-13 20:58:31 +00:00
Keith T. Garner a4b51e639c add ability to ignore pulsar at build time
This patchset adds the ability to not install the pulsar library and
gems when building canvas in docker by adding an argument to the
Dockerfile and a command line argument to install_assets.sh.

Pulsar pre-built libraries are currently x86 only. ARM64 users will want
to do the following:
  - When building canvas docker images do: --build-arg WITH_PULSAR=0
  - When installing assets: script/install_assets.sh -p

Change-Id: I738c9172050c1eff4648531b62456199673ae691
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281070
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-13 20:14:14 +00:00
Kyle Rosenbaum 02009f28c9 bump apache pulsar client version to 2.8.0
test plan:
-docker build works as expected
-apache pulsar tests pass

Change-Id: Id3cdc91becdeee2e33e3f2aa13ae46908355df38
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270985
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-08-09 18:23:30 +00:00
James Butters 00da7b9b67 upgrade ruby version in Dockerfiles
with the recent upgrade of the ruby version in our Jenkins build
we need to make our Dockerfiles match that version 2.7

[canvas-builds-refspec=2427eaa818279a3b95f5ae0169d4896ba0cb5f7d]
flag = none

Test Plan:
-Jenkins passes
-local docker dev setup still works, no regressions

Change-Id: I4a87aa401df1c8c58b733990aba619aeed2e6347
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268900
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: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-07-15 13:31:44 +00:00
James Butters 616e0296f9 Default Docker build to development env
defaulting to Production causes both prod and dev webpack
to get built taking up more space. default to Dev for the
local dev docker setup.

flag = none

Test Plan:
-Jenkins passes
-compiling assests only builds dev webpack
-after container is built, can build prod webpack and change
  RAILS_ENV

Change-Id: If9e8ff419043ae718f67b0943946806022b015ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268119
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-06-30 16:13:05 +00:00
James Butters cc32af3ccd Revert "asset install in Dockerfile"
This reverts commit 655cecbd5d.

Reason for revert: broke dev environments

Change-Id: I97f47a8ef7ac369b3cb30e448a3cfa9997c03930
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267650
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-06-29 13:36:09 +00:00
James Butters 655cecbd5d asset install in Dockerfile
move asset compiling into the Dockerfile allowing for a simpler
docker dev setup.

flag = none
closes: DE-696,DE-365

Test Plan:
-mac normal setup
-mac mutagen setup
-linux normal setup
-linux mutagen setup

Change-Id: I7e178c1ca91ee1908c4af55e03ec0010f5abce8e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266332
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: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-06-24 19:25:48 +00:00
Jacob Burroughs fd52d3387e Properly support ruby 2.7
Change-Id: Ie69cd8dc0b19dfc627afe8369e8e493744a62a8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266943
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-06-11 21:06:37 +00:00
Cody Cutrer 7fb1fd040d REQUIRE bundler 2.2.17
https: //nvd.nist.gov/vuln/detail/CVE-2020-36327
Change-Id: I0c43a92ed5c89a475794e1f73b00c528cf261750
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265630
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-05-24 22:49:05 +00:00
Ethan Vizitei edb599a264 make pulsar tests wait for pulsar stability before running
closes FOO-1894

also make the docker image only retain critical files
for pulsar dependency

Change-Id: I8b0c7138707abb2ac3b748c8b5ce8f41e2741051
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263360
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-21 18:50:03 +00:00
Ethan Vizitei 09bc72dcd7 Pulsar Dependencies
closes FOO-1828
closes FOO-1829
closes FOO-1831

- add service to run pulsar locally in pulsar.yml
- add apt-get dependencies to compile "rice" and "pulsar-client"
- add dependency on pulsar-client gem

Change-Id: Id942db70dc81fd977e907aff0702c7eda7f68820
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262287
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-04-14 15:59:45 +00:00
Ahmad Amireh 4243097b21 rename some things
fixes FOO-1265

[skip-eslint=true]
[pin-commit-analytics=7e49eefd7f59cbf43fd03bf8957bbbfa76f8d9d5]
[pin-commit-demo_site=adade2e38e46a358a4643cd3db2fe5ccffe39ec5]
[pin-commit-instructure_misc_plugin=47a3161102b0611af56d134fbd0c828ddc1b8abf]
[pin-commit-migration_tool=0dbac2f5b421d894395605ce4b583ef0f7d60b22]
[pin-commit-multiple_root_accounts=cc96d28c0d59bbe47acc64de4fdd8e1d2b029805]

Change-Id: I14c07f20bd260cf0de1f48ceb70b3c2313edf2d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-04-06 01:12:49 +00:00
Ahmad Amireh 6684592adf say PLEASE to npx when running yarn-deduplicate
because simply asking it to run yarn-deduplicate is no longer good
enough, you must now be polite when doing it[1]:

    To prevent security and user-experience problems from mistyping
    package names, npx prompts before installing anything. Suppress
    this prompt with the -y or --yes option.

we will also be updating npm to the latest to catch such issues in the
future

== test plan

running "rake canvas:compile_assets" using npm > 7 completes
without hanging indefinitely at the "install dependencies" stage

[1]: https://docs.npmjs.com/cli/v7/commands/npx#compatibility-with-older-npx-versions

Change-Id: I81e044d20143991cf6103084f44ce8d4c9011f5b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259662
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2021-03-02 21:58:31 +00:00
Cody Cutrer 62fb86ea50 raise bundler minimum requirement
because of nokogiri, we rely on multi-platform gem caching, which
only works right in bundler 2.2

Change-Id: Id207278946e849abec3418807c71e4650506a0cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259142
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-02-19 22:49:02 +00:00
Cody Cutrer f67d08e13f default to rails 6.0
you can switch back to rails 5.2 one of these ways:
 * ENV CANVAS_RAILS6_0=0
 * consul key rails6.0 with value `false`
 * touch config/RAILS5_2

Change-Id: I811884b2250b865220a1a9d84c7254f42d79e18f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257587
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-02-08 23:32:22 +00:00
Ahmad Amireh 486b0bf72c upgrade to node14
fixes FOO-1527
flag  = none

test plan: you can install node modules and run webpack

Change-Id: I33347d791b0923f4471b555c6fac303b098b1ef4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257333
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-01-27 15:33:52 +00:00
Ahmad Amireh 46f8efd61f modernize canvas_quizzes
fixes FOO-1409
flag  = none

no more client_apps, canvas_quizzes now lives as part of canvas-lms
proper inside app/jsx/, which makes the build leaner and leaves us with
one less thing to reason about

logical changes:

- converted from AMD to ES modules
- upgraded to recent react + react-router
- dropped RSVP in favor of native Promises
- used CanvasModal instead of home-grown Dialog
- removed dead code; notifications in particular were fishy as there had
  no dependents at all and did not even show up in the graph
- ported tests to Jest, added more unit ones and two integration ones
- removed "config.onError" and now throws errors where appropriate
- disabled console statements in non-dev

:: test plan ::

- create a (old-school) quiz containing all types of questions
- as 3 distinct students, take the quiz and try to randomize your
  answers

at this point it's helpful to have a reference to compare the screens; I
replicated the quiz on my production sandbox for this

- go to /courses/:id/quizzes/:id/submissions/:id/log
  - verify it looks OK
  - click on a specific question in the stream and verify the question
    inspector widget works OK
  - go back to stream and push "View table"
  - verify the table and its controls are OK

- go to /courses/:id/quizzes/:id/statistics
  - verify it looks OK
  - click on ? in the discrimination index chart and verify it displays
    a dialog with help content
  - click on "X respondents" in one of the charts and verify it displays
    a dialog with the respondent names
  - verify the interactive charts do interact as expected (no logic
    changed here so just a quick glance)
  - link to "View in SpeedGrader" for essay-like questions works

Change-Id: I79af5ff4f1479503b5e2528b613255dde5bc45d3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256118
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-01-14 22:45:10 +00:00
Andrea Cirulli 524458d77f add ruby 2.7 build
Add a ruby 2.7 build triggerable by a comment on gerrit

refs DE-387
flag = none

test-plan:
- Build passess
- Local dev builds
- Ruby 2.7 build uses the ruby2.7-passenger image for
building the application

Change-Id: I512df9344dbd77e4c592270ef260325f95d8f666
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255797
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@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-04 19:17:17 +00:00
Ahmad Amireh 45cb519d52 [node12] upgrade to node 12.19.1 (LTS)
fixes FOO-1116
flag = none

this upgrade was problematic mostly because of Node's support for ES
modules (ESM) that is still fairly recent and introduces some complexity
around packaging. This is also the reason for the considerable hack
related to @instructure packages (see inline documentation) that can be
removed once we fix things upstream

| test plan |
| --------- |

- install node 12 if needed (e.g. not on docker)
- purge your node modules:

    rm -rf {.,client_apps/*,gems/*,gems/plugins/*,packages/*}/node_modules

- make sure you can still build locally (native/docker)

    bundle exec rake canvas:compile_assets

Change-Id: If9605ac428f0ff228f8852f0becb9fbac750f1f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253166
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-12-11 03:45:31 +00:00
Aaron Ogata 185de34c53 simplify Dockerfile template generation
refs DE-411

Now that we don’t share much less code between local docker dev & Jenkins, there is no need for a complicated template to generate these files.

Change-Id: I13ef071b7e468dc04bc8d47a1c55e8d2920e09f6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254810
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-12-10 17:28:58 +00:00
James Butters a3178a0a75 improve docker_dev_setup.sh
remove redundant compiling of assets. Add setup for selenium tests with
info on how to get that setup. Reduce number of times attempting to
run migrations.

flag = none
closes: DE-364

Test Plan:
- Run docker_dev_setup.sh on clean environment
- Run docker_dev_setup.sh on linux machine
- Jenkins docker build passes

Change-Id: I0b553a820d8e472f40f1d9a71d282dac79f67027
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252024
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2020-12-09 14:53:04 +00:00
James Butters e8712d5414 update Dockerfile and Dockerfile.template
flag = none
refs: DE-203

Test Plan:
- Jenkins build passes
- Local docker build works same as before

Change-Id: I297bd187a74e823bd1c4612ea58c3c94d26bbc92
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254116
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-12-03 00:42:19 +00:00
Aaron Ogata 0070f199be share dependencies cache image between builds
refs DE-370

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

Test Plan:
1. pre-merge build uses cache
2. post-merge build uses cache for post-merge image
3. post-merge build uses cache for pre-merge image
4. post-merge build reuses webpack-builder for pre-merge

Change-Id: Ie5d5eaad2d9da1f324a87020cb70658d42b0bf94
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252353
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: Andrea Cirulli <andrea.cirulli@instructure.com>
2020-11-10 19:27:39 +00:00
Aaron Ogata 508982146e don’t install optional yarn dependencies
Change-Id: I6340550449ad69fb1e919b1f2400992aaf2ca526
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250791
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>
2020-10-22 22:05:19 +00:00
Aaron Ogata 371b85df17 don’t rebuild packages if only gems change
Change-Id: I9fcd27354796acbd0a203dbf6ec0b9fbae913bf2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249637
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-10-14 19:49:36 +00:00
Aaron Ogata 7beea9fcf6 reduce file dependencies for webpack build
refs DE-212

If a user isn’t changing any front-end related files, we can get a significant time savings by not re-building webpack. In order to do this, we have to remove the multi-layer dependencies image due to poor docker support for multi-layer caching. The dependencies build is an artifact of the ruby-only image that no longer exists, so no behavioural changes are expected.

Test Plan:
1. Ensure that the post-merge / pre-merge caches are used on post-merge build.
2. Ensure that the pre-merge cache is used on a pre-merge build.
3. Ensure that both above work on specifically the same / different nodes.

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-212]
[skip-rebase]

Change-Id: I659db8f201bfe5e4fa6d20d802a639f5a55685df
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245976
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-10-13 13:46:55 +00:00
Aaron Ogata 3c12653d23 pin passenger version to p6.0.4
Change-Id: I306ed5de986ce18f0bf512660871b04676188619
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247760
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: James Butters <jbutters@instructure.com>
2020-09-15 21:20:58 +00:00
James Butters 025e6bc34f convert alpine image into ubuntu image
We originally experimented with an Alpine image for reduction in image size. However, a number of issues with Alpine have appeared that were unanticipated.
1. Alpine uses a different memory allocator
2. Alpine package manager deletes old versions once new ones are published.

The first issue is the potential root cause behind random segmentation faults in our tests and we are reverting the Alpine change to eliminate the memory allocator difference as the cause.

Test Plan:
1. Ensure that Jenkins image caching works correctly
2. Ensure that local docker build scripts work correctly

Change-Id: I02b13d8c7117495d825a92e0a4be4e70b0e78caf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247283
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: Ryan Norton <rnorton@instructure.com>
2020-09-10 19:33:59 +00:00
Aaron Ogata c59b12fbab upgrate postgres-client version for alpine
Change-Id: Ie50d509fdda51138e59341f50d97df111f60c8e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247166
Reviewed-by: James Butters <jbutters@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>
2020-09-08 20:46:38 +00:00
Aaron Ogata e5e6fa54f1 move packages into dependencies layer for caching
refs DE-216

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

Test Plan:
1. Ensure that docker-compose build works locally
2. Ensure that packages building is cached when files aren’t changed
3. Packages build correctly when modified

Change-Id: I3e775e5d7eb51ba06078314b50bf2f8efb6d7d0b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245423
Reviewed-by: James Butters <jbutters@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>
2020-08-24 14:40:21 +00:00
Aaron Ogata 99d0010d86 minimize yarn caching dependencies
refs DE-209

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

Test Plan:
1. Ensure that `docker-compose build` works locally
2. Ensure that yarn is cached on Jenkins when run on a separate node

Change-Id: Icadf02b9e999eafd14f493ae1c0649ed0ffe58bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245336
QA-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-18 15:53:28 +00:00
Aaron Ogata 8ffaf8d925 minimize file dependencies for bundle caching
refs DE-187

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

Test Plan:
Ensure that the cache is used for bundle install when a gem changes and the build is run on a different node.

Change-Id: I43f83338a25a0774030495904b75d0825abcc5bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244748
QA-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-17 23:42:08 +00:00
Aaron Ogata f17f6bb59f drop ruby image
refs DE-187

Caching intermittently fails due to the intermediate layer in the multi-stage build. We don’t have any consumers of this image for now, so let’s work around this problem by removing it, until we can prioritize investigating why the multi-stage build isn’t using the cache for the intermediate layer.

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-187-drop-ruby-layer]

Test Plan:
1. Cache is used on a build with a file changed on a separate node.

Change-Id: I8d771ac532bcd0bacc554f02f6b129294bcfedf9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244848
QA-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-17 15:24:31 +00:00
Aaron Ogata 217b1f35de skip uglify js / source maps on pre-merge builds v2
refs DE-161

Test Plan:
1. Ensure that JS sourcemaps are skipped on pre-merge
1. Ensure that JS sourcemaps are run on post-merge
3. Ensure that Linters catch bundle size increase limits on pre-merge

Change-Id: I59607d902b191169a0415fc7673cb3a3a06dba68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243619
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
2020-08-11 21:05:54 +00:00
Aaron Ogata 38182bb44d cache yarn install for client_apps
refs DE-183

[change-merged]
[build-registry-path=jenkins/canvas-lms-de-183-pt-3]

Change-Id: I1f3523790f058593ed16c22e5b5c81f82e223ea8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244661
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-11 20:39:24 +00:00
Aaron Ogata 88a66fccf6 convert Dockerfile to template
refs DE-183

Test Plan:
1. Run the command at the top of the newly generated Dockerfile and ensure there are no changes.

Change-Id: Ice28ad169be94c39efb07d014a6bbc37e2f6c7f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244651
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-08-10 18:24:37 +00:00
Aaron Ogata c18b1c067f split yarn into own stage
Prepare for splitting pre-/post- merge webpack builds by splitting yarn into its own stage so it can continue to cache correctly

refs DE-161

Test Plan:
1. Pre-Merge Build Passes
2. Post-Merge Build Passes
3. Pre-merge build uses cache from post-merge build

Change-Id: Ib07c8934d8691b0cf7866afd56043aee503f666b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244606
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-08-10 16:14:59 +00:00