Commit Graph

88 Commits

Author SHA1 Message Date
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
Aaron Ogata 784724cf74 convert separate ruby dockerfile into multi-stage build
refs DE-164, DE-154

Test Plan:
1. Jenkins uses the ruby cached images
2. Local docker building works

Change-Id: Id78da711b69510e7b93ed67fe872432dfcabb50a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244426
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-06 18:47:28 +00:00
Aaron Ogata 10ee524b0b separate ruby image into gems / final
refs DE-164

Test Plan:
1. Ensure that the pre-merge, no-cache path works.
2. Ensure that the post-merge, no-cache path works.
3. Ensure that the cache path works.
4. Ensure that local docker setup scripts still work.

Change-Id: I1ecb6d7c37346b29816a2202e27ef1e662a3ac60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244290
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-05 17:37:18 +00:00
James Butters 1bfe6e19b9 build ruby image in docker_dev_setup
docker_dev_setup.sh broke with a recent change to how we build
our docker image. Adding the ruby docker build into the script,
then passing that image as an arg to the main Dockerfile.
Removed the default of the arg to pull from starlord since
it's not available to public.

fixes: DE-153

Test Plan
- Run docker_dev_setup.sh in a clean environment
  - script will build canvas-lms-ruby image
  - script will build alpine image using ruby image

Change-Id: Ia607f72717580bc808616f5483bb5c26342241ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243614
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
2020-07-28 18:23:47 +00:00
Derek Bender a09f6902ed Alpine canvas-lms based image
Drop-in replacement for existing Dockerfile

Closes: CCI-391

Change-Id: I9d21a74d72013be854631b2f77880eb0c47fded2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236853
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Aaron Ogata <aogata@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>
2020-07-15 17:21:56 +00:00
Benjamin Christian Nelson 9a20868030 remove unused selinimum gem
Change-Id: I0adc219a6cab442226619d5bdd0814d7f09d0d52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230713
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
2020-04-23 17:25:57 +00:00
James Butters bf5a8f5a2a use parallel_tests for more parallelization
Using the parallel_tests gem allows us to parallelize more
and a bit simpler. Removes headless stuff now that we don't
use it anymore, comments out video recording code since it
doesn't work, removes all knapsack code.

flag = none
Test Plan:
Jenkins rspec and selenium builds pass
rspec and selenium builds copy results to html publisher
rspec and selenium have nodes split into processes

Change-Id: Ibd00eba77f8193be5eadd41aef1e0617c9ae470c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/227677
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@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>
2020-03-30 21:38:47 +00:00
Derek Bender 15db56551d yarn install ENOENT fallback
Change-Id: I16ee71af83dc3efac7b5bfec03e28de13725c3a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/231987
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-03-30 16:22:24 +00:00
Derek Bender a6b6bb8974 Default Dockerfiles to 2.4-xenial
Closes: CCI-292
flag = none

Test Plan:
- rebuilding the web image uses 2.4-xenial

Change-Id: Ia601c83767e0317ad0dbee21e54755413571c44a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230371
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
2020-03-19 21:51:38 +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
Derek Bender 09a4fbc50e apt-get clean is now automatic
> Official Debian and Ubuntu images automatically run apt-get clean, so
> explicit invocation is not required.

references:
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
03e2923e42/contrib/mkimage/debootstrap (L82-L105)

Change-Id: I8d40db041e079adea69e7f085a616b68c7c0ff08
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/225823
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: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-02-14 20:55:40 +00:00
Derek Bender b3c7221e1d Fix `bundler lock --update` step in Dockerfile
Fixes: CCI-61

Creating a test plan for this patchset requires more effort than
monitoring the builds requires to see if there are any issues.

Change-Id: I4734b5ea370bf349631ea3a06fca8baa3bbdbaf5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/215509
Reviewed-by: S. Jacob Powell <spowell@instructure.com>
Tested-by: Jenkins
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2019-11-12 22:36:51 +00:00
Derek Bender ab1f2e4534 update yarn in docker to 1.19.1
Change-Id: I27be3f641eee9953130ce9b9303a9c4dbae886fd
Reviewed-on: https://gerrit.instructure.com/213343
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2019-10-17 15:21:58 +00:00
Derek Bender dc04b25729 update yarn for docker
Change-Id: Ib93ee0d2b0d2a7f3a6e5edfda4d2b80e7c1f8c97
Reviewed-on: https://gerrit.instructure.com/210538
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2019-10-14 14:45:44 +00:00
James Williams 2768dda033 use knapsack in new jenkins rspec build
closes #CORE-3292 #CORE-3293

Change-Id: Id54c8568bd1ca45929f35926e0eebdd558e68a58
Reviewed-on: https://gerrit.instructure.com/207602
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
2019-09-13 15:19:34 +00:00
Derek Bender b942bc2876 Fix yarn for initial docker-compose build
Fixes: GRADE-2257

It appears that several `yarn build:canvas` scripts in
packages/ open files with `rw` permissions that they
don't have at an early enough stage in the Dockerfile.
We were previously making all the directories writeable
but this wasn't going far enough since it was ignoring
files. I have a hunch that the files don't need to be
opened with `rw` permissions but that might be a problem
with babel or something else upstream. Since we eventually
make all files owned by docker:docker might as well do it
sooner with `COPY --chown=docker:docker`.

A follow up patchset should do add this feature to all
the other COPY directives.

Change-Id: I6a09161a34d6895284a87750091de3f82aa44e15
Reviewed-on: https://gerrit.instructure.com/197837
Tested-by: Jenkins
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2019-06-17 22:58:54 +00:00