Commit Graph
32 Commits
Author SHA1 Message Date
evazion 440bbbb288 Update nokogiri gem.
Fix gem version conflicts described in 20abd8a5f. Nokogiri couldn't be
upgraded past 1.10.9 because 1.11.0 causes a build failure in Nokogumbo
2.0.2, but we couldn't stay on 1.10.9 either because it has a hard
requirement on Ruby <2.7 and we require Ruby >=2.7. This made `bundle
update` fail with a Gemfile conflict.

The fix is to disable libxml2 support when building Nokogumbo. Nokogumbo
wants to use the same version of libxml2 as Nokogiri, but Nokogiri
1.11.0 changed how it reports which version of libxml2 it's using, which
causes Nokogumbo's build to fail. Disabling libxml2 may reduce
performance of Nokogumbo ([1]).

While we're at it, we also make Nokogiri use the system version of
libxml2 instead of its own bundled version. Nokogiri really wants
us to use its own patched version of libxml2 instead of the system
version, but the patches it applies look relatively minor and don't seem
relevant to us ([2]). Using the system version reduces build time during CI.

This adds libxml2 and libxslt as OS-level dependencies of Danbooru. You
may need to do `sudo apt-get install libxml2-dev libxslt-dev` to install
these libraries after this commit.

[1]: https://github.com/rubys/nokogumbo#flavors-of-nokogumbo
[2]: https://github.com/sparklemotion/nokogiri/tree/master/patches/libxml2
2020-06-19 02:27:15 -05:00
evazion 04c8c25976 tests: initialize pawoo credentials in github tests. 2020-06-10 22:49:28 -05:00
evazion 5919fa0ca1 tests: enable parallel tests. 2020-06-10 22:26:47 -05:00
evazion 5e63a7cf77 Add test workflow. 2020-06-10 17:52:13 -05:00
evazion 8b5b320be7 docker: fix file permission problems.
Store the app in /home/danbooru/app instead of in /app so that we have
permission to write inside the app dir. /app was owned by root, which
prevented the danbooru user from writing to it.
2020-06-09 17:50:47 -05:00
evazion 3033bb4530 Update danbooru Dockerfile.
Split into build stage and runtime stage to reduce image size.
2020-06-09 01:07:42 -05:00
evazion 6d78d22571 Update docker test configuration. 2020-06-07 17:14:41 -05:00
evazion 2c6567b5d2 Remove uses of the read replica database.
https://danbooru.donmai.us/forum_topics/9127?page=283#forum_post_160508

There was a recent outage that was caused by the read replica
(yukinoshita.donmai.us) being temporarily unavailable. The pg driver in
rails got hardstuck trying to connect to the replica, which brought down
the whole site. The app servers stopped responding and could only be
brought down with SIGKILL. Even try to boot the rails console didn't
work.

We only really used this to calculate tag counts inside Post.fast_count,
which wasn't really beneficial since the read replica is slower than the
main database.
2019-10-22 12:15:46 -05:00
evazion 059e061b15 tests: fixup comment vote, post controller tests.
Use git clean to delete stale files from an earlier checkout. These
files interfered with various things (specifically, a comment vote test
failed because there was an old comment_votes/create.json.erb template
hanging around that changed the behavior of the POST /comment_votes endpoint).
2019-09-09 15:06:24 -05:00
evazion dfe2b831a3 cache: replace memcache with redis.
Drop memcache. Use redis for all caching instead.
2019-08-22 23:15:34 -05:00
evazion 4833b8a63c Fix the circleci build. 2019-08-14 16:42:37 -05:00
evazion e29e5fe984 Fix #4131: Upgrade to Ruby 2.6.
Upgrade procedure:

    $ echo 2.6.3 > .ruby-version

    # upgrade ruby-build to know about the latest ruby versions.
    # see also: github.com/rkh/rbenv-update
    $ cd ~/.rbenv/plugins/ruby-build && git pull

    # install the version of ruby specified in .ruby-version.
    # see also: github.com/capistrano/rbenv/issues/83
    $ rbenv install --skip-existing

    # update the shell to use the latest version of ruby by default.
    $ rbenv global 2.6.3

    # update rubygems and bundler
    $ gem update --system

    # update the lockfile to use the latest version of bundler
    $ bundle update --bundler
2019-08-14 12:25:50 -05:00
evazion 853becbcfc circleci: try to fix the build. 2019-08-08 01:07:57 -05:00
nothink 72ceb484ce Update INSTALL.debian, for Debian 9(stretch) 2019-08-05 23:29:12 +09:00
Albert Yi d10b898dd6 add dependency for redis image on docker compose config 2019-01-24 13:25:40 -08:00
Albert Yi ad3ab4c9a3 add redis image to docker compose config 2019-01-24 13:24:43 -08:00
Albert Yi 897d3d3a99 add production2 env for testing new servers 2018-10-03 11:23:26 -07:00
Albert Yi 762dc3da24 Refactor sources 2018-08-24 12:10:51 -07:00
Albert Yi b596ecb868 update docker file 2018-08-01 14:23:41 -07:00
Albert Yi 7f895bd91f fix specs 2018-07-02 15:19:19 -07:00
Albert Yi f4d5932a66 update dockerfiles 2018-06-25 17:29:01 -07:00
Albert Yi 2d8fcf820e udpates to ci dockerfiles 2018-06-25 16:06:39 -07:00
Albert Yi 9c148fada4 update ci dockerfile to build and install vips 2018-06-25 15:39:23 -07:00
Albert Yi 660693ccef include apt-get clean in dockerfile 2018-06-05 16:13:26 -07:00
Albert Yi f938718677 wip 2018-05-11 16:26:24 -07:00
Albert Yi c6ae060d28 include circle ci env vars in docker env 2018-05-11 13:16:36 -07:00
Albert Yi 6839249e9d add logic for persisting pixiv sessions in tests 2018-05-10 13:59:57 -07:00
Albert Yi 780d899c85 move passwords to env 2018-05-09 15:15:33 -07:00
Albert Yi c144159dd9 fix tests 2018-05-09 14:36:03 -07:00
Albert Yi 59dde72924 fix pixiv tests, install ffmpeg 2018-05-09 14:11:34 -07:00
Albert Yi 0f2e6a9a1b fix tests 2018-05-09 12:45:37 -07:00
Albert Yi 79ea6f7e6c Add Docker and Travis config files to enable CI tests
Also fixes some Rails 6.0 deprecation warnings
2018-05-09 09:56:38 -07:00