Commit Graph

66 Commits

Author SHA1 Message Date
Aaron Ogata 5022a449b5 bump ruby default to 3.3
refs AE-1092

[ruby=3.3]

Change-Id: Ifb2e128baf03cf34d2ae5afb2e4e5541e906bcba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/355684
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2024-08-23 13:55:07 +00:00
Cody Cutrer df974bd9a9 default to Rails 7.1
closes AE-881

Change-Id: If44852d59f0ea139dbcadce4d8aed347c5b98b15
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/350881
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>
Build-Review: Cody Cutrer <cody@instructure.com>
2024-06-26 21:25:35 +00:00
Cody Cutrer 16f3cbbdc2 update bundler in dockerfiles
Change-Id: I1196ef9b43f23c390092104321b75f348273ac31
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349236
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2024-06-05 21:06:07 +00:00
Cody Cutrer 2ce06d4e7b bundle update --bundler
Change-Id: I58fb6336e936d627669f9d946789942bce377b04
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345056
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-04-16 15:11:59 +00:00
Cody Cutrer add7f4f71e bundle update --bundler
Change-Id: Ic9bb3deea7d89a48cd23e0ee8cd138cdd9e89321
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/344092
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-04-01 14:22:00 +00:00
Mysti Lilla a56ca5711d Remove SSL legacy flag
flag=none

Test plan
- Specs pass
- Rebuild Javascript assets and
  ensure you can view stuff
- Ensure yarn test:jest:coverage
  starts

Change-Id: Icb407270cb83882ae895190e3b39b2488e56e6ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/343539
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2024-03-26 16:54:22 +00:00
Cody Cutrer 369501d8dc bundle update --bundler
Change-Id: Ic337ff6da406403f4d999cfef60d40227860f523
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/340413
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jake Oeding <jake.oeding@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2024-02-14 22:30:21 +00:00
Omar Gerardo Soto-Fortuño 6905503d29 Update bundler to 2.5.3 in Dockerfiles
flag=none

test plan:
  - Specs pass.
  - Make sure you can run canvas using docker
    with this new version of the bundler.
  - If you are using inst-cli, you can do:
      inst canvas clean
      inst canvas setup

qa risk: low

Change-Id: I259119d6ec09332480f0e110d22fa233c3ac1b7e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/338012
Reviewed-by: James Butters <jbutters@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2024-01-18 15:09:37 +00:00
Dustin Cowles 1bcb60ae9e add git core ppa to Dockerfile
closes QUIZ-12806
flag=none

Test plan:
- Specs Pass
- Canvas container builds and runs
- Git at latest version (currently 2.42.0)

Change-Id: Ib63e5634c9287114f060262761e0d700b6aa09e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/332978
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
QA-Review: Dustin Cowles <dustin.cowles@instructure.com>
Product-Review: Stephen Kacsmark <skacsmark@instructure.com>
2023-11-28 19:27:22 +00:00
Cody Cutrer bd0097b762 bundle update --bundler
Change-Id: I20dc6723943fc442865dad2fb68d512d7b98459a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328959
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-09-29 15:42:35 +00:00
Jacob Burroughs 2f611b1765 Upgrade to node 18
refs AE-485

Change-Id: I32fe1a73dbed1b625a744efb47ca349ac6776035
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/327039
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-09-11 17:28:59 +00:00
jake.oeding 0f5c22ae81 update npm version in dockerfiles
fixes error during build

Change-Id: I319634a1988d05bb29f19dee6b8a994e6814d6d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326773
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
2023-09-01 15:20:08 +00:00
Aaron Ogata 23f4805460 use new node setup incantation
Change-Id: I799dc922a081745102d876189e4da56ed0a2533c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326546
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2023-08-31 14:58:08 +00:00
Cody Cutrer f4c34f6393 bundle update --bundler
also, don't set BUNDLER_VERSION env var in Docker, so that
bundler's auto-install-and-restart-with-the-correct-version
feature can work

Change-Id: I8e3722197fb3598b5c40679d997f19b3b3957ea8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326580
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>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-30 23:31:39 +00:00
Cody Cutrer b636c1c041 add a bundler binstub
refs AE-297

and also include binstubs in the path in docker

this will help ensure people are running the correct version of bundler

Change-Id: I68e7f6a43efd89ff257a9307aa4f6709acef05f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318776
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-05-30 17:34:50 +00:00
James Butters 3cdb548d6a bump ruby to 3.1.x for Jenkins and local dev
[canvas-builds-refspec=44e26dfa9b10224d86ee3f9583eefa49b5a7a39f]
[ruby=3.1]

closes: DE-1627

Change-Id: Idb7e131252223a3eaa00ec5375d385e2f17f08ec
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318548
Reviewed-by: Jacob Burroughs <jburroughs@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>
Build-Review: James Butters <jbutters@instructure.com>
2023-05-19 12:13:42 +00:00
James Butters 578e3b1bdb ARG Ruby in Dockerfile is not getting used
When building the canvas web container, references to the arg RUBY
are not set resulting in unexpected file paths. For example
GEM_HOME only creates /home/docker/.gem/ when we expected it to
create /hom/docker/.gem/2.7 by default. We need to add another
reference to the ARG RUBY after the FROM.

According to Docker: An ARG declared before a FROM is outside of a
build stage, so it can’t be used in any instruction after a FROM.
To use the default value of an ARG declared before the first FROM
use an ARG instruction without a value inside of a build stage
https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact

Test Plan:
-run `docker compose build web`
  -bash into the web container
  -echo $GEM_HOME
    -path is set to /home/docker/.gem/2.7
-run `docker compose build --build-arg RUBY=3.1 web`
  -bash into the web container
  -echo $GEM_HOME
    -path is set to /home/docker/.gem/3.1

Change-Id: I4856a8ffff3debe9deac3f3fb511d13735f41fea
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314062
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
2023-03-23 14:46:08 +00:00
Jacob Burroughs bcfffcc6e0 Move to rails 7 as the default rails version
Change-Id: I3c1fd74154a52aad96ef7ab85144dcc8dceb414a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310751
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
2023-02-10 16:26:06 +00:00
Jacob Burroughs 6fd442cf8b Complete ruby 3.1 support
Change-Id: I954402cb7016c1590748f149279865db967272a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308110
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2023-01-04 18:02:40 +00:00
Aaron Ogata 82644b8d0a remove fontforge from jenkins build images
Change-Id: Iaa14657db82953fa6203c8766cd4298dc9e1685f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295307
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Build-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-09-01 17:50:38 +00:00
James Butters 563240666b remove postgis and upgrade postgres to 14
[canvas-builds-refspec=5bdd0f9fb485ef9501bd0f34f8f669b36fa02c30]
[postgres=14]
[skip-cache]

postgis appears to be unused, so removed. Upgrade to use pg14
to match production.

Test Plan:
- Jenkins passes
- docker setup scripts work for amd and arm

Change-Id: I57e87b6a0d800d9574b2d1b7042d9b7939dc8b73
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/299570
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: James Butters <jbutters@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
2022-08-26 16:15:34 +00:00
Jacob Burroughs 53953aaf4b Replace our homegrown link finder with twitter-text
While I am at it, decaffinate and typescriptify TextHelper

fixes FOO-2987

Change-Id: I0b8f33a610bee737ea79ad24d8aec8f8e8051c49
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/299013
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Bobby Buten <bobby.buten@instructure.com>
2022-08-19 17:01:10 +00:00
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
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
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 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
Aaron Ogata 65950dbc71 split external package installation from gem installation
refs DE-545

When apt-get tries to pull a package from a server that is down or undergoing maintenance, builds that modify Gemfile can fail due to not being able to pull packages. By splitting the package installation into its own layer, external packages no longer need to be reinstalled when gems are updated.

Test Plan
1. Cache builds correctly from scratch, uploads all relevant images.
2. Cache is correctly reused when no gems are updated
3. Base cache image is reused when gems are updated, and all other images are rebuilt
4. Pre-merge build passes and uses cache as appropriate
5. Updating Dockerfile.jenkins re-builds base image

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

Change-Id: Ifd76064892817abb80dd0daebe8c2189c0338d78
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279697
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-11-29 20:57:42 +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
Ahmad Amireh 52fe84dbb2 rework handlebars dependency on brandable_css
refs FOO-1116

right now in order to build the javascript, we must run brandable_css
first for the specific purpose of injecting into handlebars templates
their corresponding stylesheet file with the checksum as reported by
brandable_css

this patch moves things around such that Rails provides this mapping of
"handlebars template" to "CSS variant file checksums" in a global
variable (Rails is privy to this information already), webpack then at
build time injects only a reference to that mapping into the template,
then our runtime brandable-css JS helper will resolve that reference
from the mapping and request the correct file based on the current
user's variant

[1] rails assigns window.BRANDABLE_CSS_HANDLEBARS_INDEX with content
like this:

    [
      [ "new_styles_normal_contrast", "new_styles_high_contrast", ... ],
      {
        "0c": ["0f4f01ab86", 0, 0, "e3e7211701", 3, ... ],
        ...
      }
    ]

the structure of the mapping is explained in brandable_css[1], it is
a bit overtuned to reduce the size as much as possible since this is
included for ALL pages even though the templates in question may never
be rendered (right now it's ~1.5kB and should never grow)

[2] webpack asks @canvas/brandable-css to loadStylesheetForJST using the
contrived id for that file (frontend_build/i18nLinerHandlebars.js:92)

[3] brandable-css/index.js will decode that structure to arrive at the
exact URL for the stylesheet for that template for the current user
variant

with this , we should be able to optimize "rake canvas:compile_assets"
to run both brandable_css and webpack in parallel, which will greatly
mitigate the performance decrease from moving from node-sass to
dart-sass

== test plan

go to some assignment's syllabus page, edit the file
app/stylesheets/jst/courses/Syllabus.scss with something fun like:

    #syllabus .day_date { background: $fire; }

rerun `npx brandable_css`, reload the page and verify it's on fire,
optionally change your setting to enable High Contrast mode, reload
the syllabus page and verify the color changes (it picks up the other
variant stylesheet)

[1]: 80af6e70af

Change-Id: Ie48cc71d4837ee02313b2d45a9ad2944725acad2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268615
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-07-14 22:19:20 +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 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
Aaron Ogata 38abe8dd28 introduce docker image sync job
refs DE-368

When the images are rebuilt, it changes the image digest causing the cache to become invalid. It can also break the build and is not easily revertable to the previous image. Work around this issue by mirroring the dockerhub image on starlord, and update it via a cron job.

Change-Id: I2f3f80ea53c7c306a126805b429781743df85aa6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256167
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-01-07 19:13:51 +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 c6de82ee4c split ruby runner into own image
[change-merged]
[build-registry-path=jenkins/canvas-lms/ruby-runner]

Test Plan:
1. Ensure that changing gems updates the whole image.
2. Ensure that changing npm updates the webpack builder image.
3. Ensure that changing webpack files are reflected in the final image.
4. Ensure that changing packages files are reflected in the final image.
5. Ensure that there are no speed regressions in fully-cached cases.
6. Ensure that caching works as expected.

Change-Id: Icef77195ff912bc0628f27eeda6780f262a8908a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252565
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-01 15:08:21 +00:00
Aaron Ogata d2d12971e7 generate pre-computed packages cache
refs DE-376

For the ruby-runner change, we will need to have the yarn packages dependencies pre-computed in a separate docker image so we can collect the MD5SUM of those changes. Also, the final ruby-runner image will not contain the packages/ directory, so we have to move it to the webpack-builder image for the JS jobs.

Change-Id: I37698e06090dcbee815651120f92bf39538e886f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253584
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-11-23 23:29:14 +00:00