• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Development environment for Meedan Check, a collaborative media annotation platform

Check

A collaborative media annotation platform.

This is a Docker Compose configuration that spins up the whole Check app locally. Tested on Linux and Mac OS X. The repo contains two Docker Compose files, one for development (docker-compose.yml) and the other for testing (docker-test.yml).

Diagram

DO NOT USE IN PRODUCTION! THIS IS ONLY MEANT AS A DEVELOPMENT ENVIRONMENT.

Quick start

  • Install docker-compose
  • Update your virtual memory settings, e.g. by setting vm.max_map_count=262144 in /etc/sysctl.conf
  • git clone --recursive [email protected]:meedan/check.git && cd check
  • bin/first-build.sh and wait (for about one hour this first time!!) for a string in the log that looks like web_1_88cd0bd245b7 | [21:07:07] [webpack:build:web:dev] Time: 83439ms
  • Open http://localhost:3333
  • Click "Create a new account with email" and enter your desired credentials
  • docker-compose exec api bash
  • bundle exec rails c
  • me = User.last; me.confirm; me.is_admin = true; me.save
  • Go back to http://localhost:3333
  • Click "I already have an account" and login using your credentials
  • Enjoy Check! 🎉

Note 1: For security reasons, not all credentials and configuration values are provided by copying .example files during the initial build. For Meedan members, you need to set your AWS_PROFILE environment variable, login to AWS (aws sso login) and then the script bin/first-build.sh will retrieve and set the required values for you. If you're not a Meedan member, you need to set at least the google_client_id and google_client_secret values in check-api/config/config.yml, here is how you can get those. Other optional features can be enabled by setting the required credentials, for example, the FACEBOOK APP ID is needed to get Facebook social metrics and to run the Facebook related tests.

Note 2: For performance reasons, some services (that are not needed to run the application with its basic functionality) are disabled by default (e.g., commented in the Docker Compose file). If you need those services, please uncomment them in docker-compose.yml. If you may need to increase the amount of memory allocated for Docker in order for it to work.

Note 3: There is a seed file you can run to create a new user and fake data, or to add fake data to an existing user. You can do that by running docker compose run api bundle exec rake db:seed. If you picked the option to create a new user it will print the user information when the script is done. If you picked the option to add data to a user, it will let you know it was successfully added when it's done.

Available services and container names

Testing

  • Start the app in test mode: docker-compose -f docker-compose.yml -f docker-test.yml up
  • Check web client: docker-compose exec web npm run test
  • Check browser extension: docker-compose -f docker-compose.yml -f docker-test.yml exec geckodriver bash -c "cd /home && chown -R root seluser" && docker-compose exec mark npm run test
  • Check service API: docker-compose exec api bundle exec rake test
  • Pender service API: docker-compose exec pender bundle exec rake test
  • Check Slack Bot: docker-compose exec check-slack-bot npm run test
  • Narcissus: docker-compose exec narcissus npm run test
  • Fetch: docker-compose exec fetch bundle exec rake test
  • Running a specific Check Web test: docker-compose exec web bash -c "cd test && rspec --example KEYWORD spec/integration_spec.rb"
  • Running a specific Check Mark test: docker-compose exec mark bash -c "cd test && rspec --example KEYWORD spec/app_spec.rb"
  • Running a specific Check API or Pender test (from within the container): bundle exec ruby -I"lib:test" test/path/to/specific_test.rb -n /.*KEYWORD.*/

Helpful one-liners and scripts

  • Update submodules to their latest commit and check if any example configuration files have been updated: ./bin/git-update.sh
  • Pack your local config files: ./bin/tar-config.sh
  • Restart a service, e.g. Check API: docker-compose run api bash -c "touch tmp/restart.txt"
  • Invoke the Rails console on a service, e.g. Check API: docker-compose run api bundle exec rails c d
  • Update the Relay schema file on Check API: docker-compose run api bundle exec rake lapis:graphql:schema
  • Update the JSON API schema file on Check API: docker-compose run api bundle exec rake jsonapi:resources:update_schema

More documentation

Upgrading databases in development environment

We have recently upgraded to Postgres version 11 from 9.5. This necessitates a migration of existing databases to the new version. The migration will create a new data volume, so make sure you have enough storage space for a second copy of your databases. To migrate run these commands:

docker-compose down
docker-compose -f docker-upgradedb.yml up
docker run --rm -v check_postgres11:/var/lib/postgresql/data -u postgres -it postgres:11 bash -c "echo host all all 0.0.0.0/0 md5 >> /var/lib/postgresql/data/pg_hba.conf"
docker-compose up --remove-orphans --abort-on-container-exit

This will leave behind your original data volume and which you can clean up by running docker volume rm check_postgres.

Troubleshooting

  • If you're having trouble starting Elasticsearch on macOS, with the error container_name exited with code 137, you will need to adjust your Docker settings, as per https://www.petefreitag.com/item/848.cfm
  • If you're getting an error starting chromedriver in test mode, like the following:
docker-compose -f docker-compose.yml -f docker-test.yml up --abort-on-container-exit
Starting check_elasticsearch_1_2e69e84ccb56 ...
Starting check_chromedriver_1_6a1e9d8f5fd4  ... error
[..]
ERROR: for chromedriver  Cannot start service chromedriver: network 16d99f6d3d81011870fece7c627230b9410bdb5d0abc2d10a32f54af9f37931f not found
ERROR: Encountered errors while bringing up the project.

try this: docker-compose -f docker-compose.yml -f docker-test.yml down

More Repositories

1

checkdesk

A platform for collaborative social media verification
PHP
55
star
2

i18n-translate-json

npm module that automatically translates node-i18n JSON files
JavaScript
38
star
3

check-web

Web client for Meedan Check, a collaborative media annotation platform
JavaScript
24
star
4

check-api

Content management API service for Meedan Check, a collaborative media annotation platform
Ruby
20
star
5

alegre

A text and media analysis service for Meedan Check, a collaborative media annotation platform
C++
15
star
6

pender

URL parsing, archiving and rendering service for Meedan Check, a collaborative media annotation platform
HTML
10
star
7

montage

A collaborative video annotation app
Python
7
star
8

watchbot

A service to watch media links and report on their status
JavaScript
6
star
9

generator-keefer

Keefer is a Yeoman generator to create React/Redux web applications that can be compiled to different platforms, following some good practices from Meedan
JavaScript
5
star
10

check-mark

Cross-platform bookmarking extension for Meedan Check, a collaborative media annotation platform
JavaScript
5
star
11

textsimilarity

Matching short text segments
Jupyter Notebook
5
star
12

bridge

Development environment for Meedan Bridge, a collaborative media translation app
Shell
3
star
13

tmkpy

C++
3
star
14

nurani

Inter-faith, multilingual dialogue system for the Cambridge Inter-Faith Programme
PHP
3
star
15

meedan.com

Meedan's organizational website
HTML
3
star
16

vframe

An image analysis service
HTML
2
star
17

covid-19-expert-database

Covid-19 Expert Database
HTML
2
star
18

montage-web

Web client for Meedan Montage, a collaborative video annotation app
HTML
2
star
19

credibilitycoalition.org

Build system for the Credibility Coalition website
HTML
2
star
20

checkdesk-bot

Checky, the friendly Checkdesk Twitter bot
JavaScript
2
star
21

check-bots

Extension bots for Meedan Check, a collaborative media annotation platform
Python
2
star
22

nurani-sronline

Scriptural Reasoning Online
PHP
2
star
23

lapis

A Rails application template for APIs that follow good practices
JavaScript
2
star
24

check-slack-bot

Slack bot for Meedan Check, a collaborative media annotation platform
JavaScript
2
star
25

check-ui

React component library for the Check ecosystem
JavaScript
2
star
26

meedan-ui-guide

A browser prototyping environment
JavaScript
2
star
27

cc-deville

cc-deville offers cache management of multiple systems via a REST api
JavaScript
1
star
28

temporal_clustering

Cython
1
star
29

fetch

A service that aggregates fact-checks from various sources and exposes them as Schema.org ClaimReviews. Part of Meedan Check, a collaborative media annotation platform.
Ruby
1
star
30

MantisBT

Meedan's dockerized use of Mantis bug tracker with customizations
PHP
1
star
31

presto

C++
1
star
32

meedan.code

Meedan's software blog
CSS
1
star
33

popupnewsroom

Pop-Up Newsroom site
JavaScript
1
star
34

bridge-client

A browser extension for Meedan Bridge, a collaborative media translation app
CSS
1
star
35

check-search

Frontend client for the similarity search APIs.
JavaScript
1
star