From b4ac23a980be6d8a00f5950f157f020d4270ccf5 Mon Sep 17 00:00:00 2001 From: zubairshakoorarbisoft Date: Fri, 9 Dec 2022 02:49:18 +0500 Subject: [PATCH 1/4] feat: analyticsapi config for native image --- Makefile | 3 +++ configuration_files/edx_notes_api.yml | 36 +++++++++++++++++++++++++++ docker-compose.yml | 4 +++ 3 files changed, 43 insertions(+) create mode 100644 configuration_files/edx_notes_api.yml diff --git a/Makefile b/Makefile index 393326111a..400b737ad6 100644 --- a/Makefile +++ b/Makefile @@ -453,6 +453,9 @@ dev.shell.analyticsapi: dev.shell.insights: docker-compose exec insights env TERM=$(TERM) bash -c 'eval $$(source /edx/app/insights/insights_env; echo PATH="$$PATH";) && /bin/bash' +dev.shell.edx_notes_api: + docker-compose exec edx_notes_api env TERM=$(TERM) bash -c 'eval $$(source /edx/app/edx_notes_api/edx_notes_api_env; echo PATH="$$PATH";) && /bin/bash' + dev.shell.%: ## Run a shell on the specified service's container. docker-compose exec $* /bin/bash diff --git a/configuration_files/edx_notes_api.yml b/configuration_files/edx_notes_api.yml new file mode 100644 index 0000000000..b1563df784 --- /dev/null +++ b/configuration_files/edx_notes_api.yml @@ -0,0 +1,36 @@ +--- + +ALLOWED_HOSTS: +- localhost +CLIENT_ID: CHANGEME +CLIENT_SECRET: CHANGEME +DATABASES: + default: + ENGINE: django.db.backends.mysql + HOST: db + NAME: edx_notes_api + OPTIONS: + connect_timeout: 10 + PASSWORD: secret + PORT: '3306' + USER: notes001 +DISABLE_TOKEN_CHECK: false +ELASTICSEARCH_INDEX: edx_notes +ELASTICSEARCH_URL: http://es:9200/ +HAYSTACK_CONNECTIONS: + default: + ENGINE: notesserver.highlight.ElasticsearchSearchEngine + INDEX_NAME: edx_notes_api + URL: http://es:9200/ +JWT_AUTH: + JWT_AUTH_COOKIE_HEADER_PAYLOAD: edx-jwt-cookie-header-payload + JWT_AUTH_COOKIE_SIGNATURE: edx-jwt-cookie-signature + JWT_ISSUERS: + - AUDIENCE: SET-ME-PLEASE + ISSUER: http://127.0.0.1:8000/oauth2 + SECRET_KEY: SET-ME-PLEASE + JWT_PUBLIC_SIGNING_JWK_SET: '' +RESULTS_DEFAULT_SIZE: 25 +RESULTS_MAX_SIZE: 250 +SECRET_KEY: CHANGEME +USERNAME_REPLACEMENT_WORKER: OVERRIDE THIS WITH A VALID USERNAME \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 17cf81fe68..6f63bd44d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -390,6 +390,7 @@ services: - lms - mysql57 image: edxops/notes:${OPENEDX_RELEASE:-latest} + working_dir: /edx/app/edx_notes_api/edx_notes_api networks: default: aliases: @@ -407,6 +408,9 @@ services: ENABLE_DJANGO_TOOLBAR: 1 ELASTICSEARCH_URL: "http://edx.devstack.elasticsearch710:9200" ELASTICSEARCH_DSL: "http://edx.devstack.elasticsearch710:9200" + volumes: + - /edx/var/edx_notes_api/ + - ${PWD}/configuration_files/edx_notes_api.yml:/edx/etc/edx_notes_api.yml forum: command: bash -c 'source /edx/app/forum/ruby_env && source /edx/app/forum/devstack_forum_env && cd /edx/app/forum/cs_comments_service && bundle install && while true; do ruby app.rb -o 0.0.0.0 ; sleep 2; done' From 857ea69c65eaebf6260c8a12dc32750448af9e01 Mon Sep 17 00:00:00 2001 From: zubairshakoorarbisoft Date: Fri, 9 Dec 2022 02:49:18 +0500 Subject: [PATCH 2/4] feat: edx_notes_api config for native image --- Makefile | 3 +++ configuration_files/edx_notes_api.yml | 36 +++++++++++++++++++++++++++ docker-compose.yml | 4 +++ 3 files changed, 43 insertions(+) create mode 100644 configuration_files/edx_notes_api.yml diff --git a/Makefile b/Makefile index 393326111a..400b737ad6 100644 --- a/Makefile +++ b/Makefile @@ -453,6 +453,9 @@ dev.shell.analyticsapi: dev.shell.insights: docker-compose exec insights env TERM=$(TERM) bash -c 'eval $$(source /edx/app/insights/insights_env; echo PATH="$$PATH";) && /bin/bash' +dev.shell.edx_notes_api: + docker-compose exec edx_notes_api env TERM=$(TERM) bash -c 'eval $$(source /edx/app/edx_notes_api/edx_notes_api_env; echo PATH="$$PATH";) && /bin/bash' + dev.shell.%: ## Run a shell on the specified service's container. docker-compose exec $* /bin/bash diff --git a/configuration_files/edx_notes_api.yml b/configuration_files/edx_notes_api.yml new file mode 100644 index 0000000000..b1563df784 --- /dev/null +++ b/configuration_files/edx_notes_api.yml @@ -0,0 +1,36 @@ +--- + +ALLOWED_HOSTS: +- localhost +CLIENT_ID: CHANGEME +CLIENT_SECRET: CHANGEME +DATABASES: + default: + ENGINE: django.db.backends.mysql + HOST: db + NAME: edx_notes_api + OPTIONS: + connect_timeout: 10 + PASSWORD: secret + PORT: '3306' + USER: notes001 +DISABLE_TOKEN_CHECK: false +ELASTICSEARCH_INDEX: edx_notes +ELASTICSEARCH_URL: http://es:9200/ +HAYSTACK_CONNECTIONS: + default: + ENGINE: notesserver.highlight.ElasticsearchSearchEngine + INDEX_NAME: edx_notes_api + URL: http://es:9200/ +JWT_AUTH: + JWT_AUTH_COOKIE_HEADER_PAYLOAD: edx-jwt-cookie-header-payload + JWT_AUTH_COOKIE_SIGNATURE: edx-jwt-cookie-signature + JWT_ISSUERS: + - AUDIENCE: SET-ME-PLEASE + ISSUER: http://127.0.0.1:8000/oauth2 + SECRET_KEY: SET-ME-PLEASE + JWT_PUBLIC_SIGNING_JWK_SET: '' +RESULTS_DEFAULT_SIZE: 25 +RESULTS_MAX_SIZE: 250 +SECRET_KEY: CHANGEME +USERNAME_REPLACEMENT_WORKER: OVERRIDE THIS WITH A VALID USERNAME \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 17cf81fe68..6f63bd44d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -390,6 +390,7 @@ services: - lms - mysql57 image: edxops/notes:${OPENEDX_RELEASE:-latest} + working_dir: /edx/app/edx_notes_api/edx_notes_api networks: default: aliases: @@ -407,6 +408,9 @@ services: ENABLE_DJANGO_TOOLBAR: 1 ELASTICSEARCH_URL: "http://edx.devstack.elasticsearch710:9200" ELASTICSEARCH_DSL: "http://edx.devstack.elasticsearch710:9200" + volumes: + - /edx/var/edx_notes_api/ + - ${PWD}/configuration_files/edx_notes_api.yml:/edx/etc/edx_notes_api.yml forum: command: bash -c 'source /edx/app/forum/ruby_env && source /edx/app/forum/devstack_forum_env && cd /edx/app/forum/cs_comments_service && bundle install && while true; do ruby app.rb -o 0.0.0.0 ; sleep 2; done' From 4f92b7c9f11146d815915506b7db7881924f1cb9 Mon Sep 17 00:00:00 2001 From: zubairshakoorarbisoft Date: Wed, 14 Dec 2022 17:40:13 +0500 Subject: [PATCH 3/4] fix: new line added --- configuration_files/edx_notes_api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration_files/edx_notes_api.yml b/configuration_files/edx_notes_api.yml index b1563df784..9782f5b4c8 100644 --- a/configuration_files/edx_notes_api.yml +++ b/configuration_files/edx_notes_api.yml @@ -33,4 +33,4 @@ JWT_AUTH: RESULTS_DEFAULT_SIZE: 25 RESULTS_MAX_SIZE: 250 SECRET_KEY: CHANGEME -USERNAME_REPLACEMENT_WORKER: OVERRIDE THIS WITH A VALID USERNAME \ No newline at end of file +USERNAME_REPLACEMENT_WORKER: OVERRIDE THIS WITH A VALID USERNAME From b3c63264ea508a460073800b27644c930534163a Mon Sep 17 00:00:00 2001 From: zubairshakoorarbisoft Date: Wed, 14 Dec 2022 18:52:48 +0500 Subject: [PATCH 4/4] fix: requested changes by aht added on 14 Dec 2022 --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6f63bd44d4..0646c14308 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -389,7 +389,7 @@ services: - elasticsearch710 - lms - mysql57 - image: edxops/notes:${OPENEDX_RELEASE:-latest} + image: edxops/notes-dev:${OPENEDX_RELEASE:-latest} working_dir: /edx/app/edx_notes_api/edx_notes_api networks: default: @@ -409,7 +409,6 @@ services: ELASTICSEARCH_URL: "http://edx.devstack.elasticsearch710:9200" ELASTICSEARCH_DSL: "http://edx.devstack.elasticsearch710:9200" volumes: - - /edx/var/edx_notes_api/ - ${PWD}/configuration_files/edx_notes_api.yml:/edx/etc/edx_notes_api.yml forum: