Git Product home page Git Product logo

tutor-forum's People

Contributors

codewithemad avatar ghassanmas avatar ian2012 avatar kdmccormick avatar keithgg avatar regisb avatar xitij2000 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

tutor-forum's Issues

Multi-tenant Elasticsearch

I was playing with the Harmony project and they mentioned that it's now achievable since openedx/edx-search#130 and openedx/cs_comments_service#404, but I didn't find any configurations related to a Prefix for elastic indices. Is this feature implemented or only cs_comment support it and should we modify the plugin?
I've got the same question for tutor-discovery and any other plugins which are using Elastic Search.

mongodb+srv urls with querystring parameters cause the forum to fail

mongodb+srv urls are introduced in this PR: #10
But querystring parameters will not work in the forum because of the way the MONGOHQ_URLvariable is generated:

MONGOHQ_URL="$MONGODB_HOST/$MONGODB_DATABASE"

We need to modify the definition of MONGOHQ_URL such that querystring parameters are supported. If possible, we should take this opportunity to get rid of the forum entrypoint entirely.

Tutor Forum Docker does not connect with mongoDB cluster

I am trying to connect the forum docker with MongoDB cluster.
The configurations are -

environment:
  SEARCH_SERVER: "http://elasticsearch:9200"      
  MONGODB_USERNAME: "mongouser"
  MONGODB_PASSWORD: "password"
  MONGODB_HOST: "mongo_primary_host_url"
  MONGODB_PORT: 27017
  MONGODB_DATABASE: "cs_comments_service"
  MONGOID_USE_SSL: true
  MONGOID_SSL_VERIFY: true
  MONGOID_READ_MODE: "primary"
  MONGOID_AUTH_MECH: ":mongodb_x509"
  MONGOID_SSL_CA_CERT: "My_certificate_path_in_the_forum_docker"
  MONGOID_TIMEOUT: 10

This is the error i get in the forum.

tutor_local-forum-1 | Waiting for mongodb/elasticsearch…
tutor_local-forum-1 | 2022/06/13 08:47:46 Waiting for: tcp://mongo_primary_host_url:27017
tutor_local-forum-1 | 2022/06/13 08:47:46 Waiting for: http://elasticsearch:9200/
tutor_local-forum-1 | 2022/06/13 08:47:46 Connected to tcp://mongo_primary_host_url:27017
tutor_local-forum-1 | 2022/06/13 08:47:46 Received 200 from http://elasticsearch:9200/
tutor_local-forum-1 | W, [2022-06-13T08:47:47.948442 #17] WARN – : Overwriting existing field _id in class User.
tutor_local-forum-1 | W, [2022-06-13T08:47:47.977085 #17] WARN – : MONGODB | Unsupported client option ‘max_retries’. It will be ignored.
tutor_local-forum-1 | W, [2022-06-13T08:47:47.977157 #17] WARN – : MONGODB | Unsupported client option ‘retry_interval’. It will be ignored.
tutor_local-forum-1 | W, [2022-06-13T08:47:47.977173 #17] WARN – : MONGODB | Unsupported client option ‘timeout’. It will be ignored.
tutor_local-forum-1 | /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/server_selector/selectable.rb:110:in select_server': No server is available matching preference: #<Mongo::ServerSelector::Primary:0x47181947531780 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015 (Mongo::Error::NoServerAvailable) tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/collection/view/iterable.rb:41:in block in each’
tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/retryable.rb:44:in read_with_retry' tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/collection/view/iterable.rb:40:in each’
tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/query_cache.rb:227:in each' tutor_local-forum-1 | from /app/cs_comments_service/app.rb:175:in map’
tutor_local-forum-1 | from /app/cs_comments_service/app.rb:175:in <top (required)>' tutor_local-forum-1 | from config/unicorn_tcp.rb:4:in require’
tutor_local-forum-1 | from config/unicorn_tcp.rb:4:in reload' tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/lib/unicorn/configurator.rb:84:in instance_eval’
tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/lib/unicorn/configurator.rb:84:in reload' tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/lib/unicorn/configurator.rb:77:in initialize’
tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/lib/unicorn/http_server.rb:77:in new' tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/lib/unicorn/http_server.rb:77:in initialize’
tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/bin/unicorn:126:in new' tutor_local-forum-1 | from /app/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/unicorn-5.3.1/bin/unicorn:126:in <top (required)>’
tutor_local-forum-1 | from ./bin/unicorn:16:in load' tutor_local-forum-1 | from ./bin/unicorn:16:in ’

Can follow the previous conversation here.

To create a MongoDB cluster

First we need to enable replSet.

mongod --port 27017 --replSet rs0

or you can add it in the configuration file /etc/mongod.conf.

replication:
  replSetName: rs0

Make sure the three nodes are having the same replSetName.

Follow this link to setup replset.

Enable authentication and ssl/tls certificated.

security:
   authorization: enabled
tls:
mode: requireTLS
certificateKeyFile: /etc/ssl/mongodb.pem

Follow these links to setup authentication and ssl/tls.

https://hevodata.com/learn/mongodb-configuration-file/

https://www.mongodb.com/docs/manual/tutorial/configure-ssl/

Make sure to have all the 3 nodes to have the security, authentication and ssl/tls enabled.

After the nodes are ready to connect in replset state.
Connect the nodes with each other.

To connect all the 3 nodes with each other. Login to one of the Mongodb shell.

rs.initiate()
rs.add('ip1:port1')
rs.add('ip2:port2')
rs.add('ip3:port3')
rs.status()

Follow this to connect all the three nodes.

Note - I am working on a completly cloud based cluster. I do not need to manually setup everything. But for development purposes we need to do them manually.

Modifications to the Docker image entrypoint cause long image rebuilds

When we make small changes to the docker-entrypoint.sh script (as we did in this PR #10), the Docker image needs to be rebuilt almost from scratch. This because the following statement:

COPY ./bin /app/bin

is located before the rest of the Dockerfile instructions (including git clone ... etc.).

I suggest either to:

  1. Move the COPY statement closer to the ENTRYPOINT statement.
  2. Switch to a layer-based build.

Building the forum image fails on arm64

Building the image fails on Arm based arch/(e.g Apple silicon), due to gem lock file not supporting the platform/arch.
Docker build error:

 => ERROR [stage-0 10/12] RUN bundle install                                                                                                                                 0.3s
------                                                                                                                                                                            
 > [stage-0 10/12] RUN bundle install:                                                                                                                                            
#14 0.280 Your bundle only supports platforms ["x86_64-linux"] but your local platform is                                                                                         
#14 0.280 aarch64-linux. Add the current platform to the lockfile with `bundle lock
#14 0.280 --add-platform aarch64-linux` and try again.
------
executor failed running [/bin/sh -c bundle install]: exit code: 16

To reproduce, just build the image tutor images build forum on a device which is not Arch x86.
The suggested fix above does fix it, however it's better to resolve the issue upstream @ https://github.com/openedx/cs_comments_service.

tutor-forum upgrade to Ruby 3.3

From https://discuss.openedx.org/t/tutor-cs-comment-service-mongo-and-ruby-upgrade/12472 :

We just tested and landed this change 3 which has confirmed that the latest version of cs_comment_service will work with Ruby 3.3 and Mongo 7.
I don’t know what is involved but the relevant tutor code and images should be updated.
If this is using the same Mongo instance as the LMS/CMS, then maybe hold off on the mongo upgrade there until chore: add mongo 7 to testing matrix by DanielVZ96 · Pull Request #34213 · openedx/edx-platform · GitHub 1 merges which will hopefully be soon!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.