Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC 801: Feature enhance the Sunbird RC CLI #252

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- name: Set up properties
run: sh configure-dependencies.sh
# # debug step
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow ie holashchand
# limit-access-to-actor: true
- name: Build and test
run: make test
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow ie Sreejith-K
# limit-access-to-actor: true
# - name: Build and test
# run: make test
# test:
# runs-on: ubuntu-latest
# steps:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test: build
@docker-compose down
@rm -rf db-data-1 || echo "no permission to delete"
# test with kafka(async), events, notifications,
@docker-compose --env-file test_environments/test_with_asyncCreate_events_notifications.env up -d db clickhouse redis es keycloak registry certificate-signer certificate-api kafka zookeeper notification-ms metrics
@docker-compose --env-file test_environments/test_with_asyncCreate_events_notifications.env up -d db clickhouse redis keycloak registry certificate-signer certificate-api kafka zookeeper notification-ms metrics
@echo "Starting the test" && sh build/wait_for_port.sh 8080
@echo "Starting the test" && sh build/wait_for_port.sh 8081
@docker-compose ps
Expand Down
143 changes: 88 additions & 55 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
version: "2.4"
version: '2.4'

services:
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.13
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
- ELASTIC_PASSWORD=${ELASTIC_SEARCH_PASSWORD}
- xpack.security.enabled=${ELASTIC_SECURITY_ENABLED-false}
ports:
- "9200:9200"
- "9300:9300"
- '9200:9200'
- '9300:9300'
healthcheck:
test: [ "CMD", "curl", "-f", "localhost:9200/_cluster/health", "--header", "Authorization: Basic ZWxhc3RpYzpEa0llZFBQU0Ni" ]
test:
[
'CMD',
'curl',
'-f',
'localhost:9200/_cluster/health',
'--header',
'Authorization: Basic ZWxhc3RpYzpEa0llZFBQU0Ni',
]
interval: 30s
timeout: 10s
retries: 4
Expand All @@ -21,13 +29,13 @@ services:
volumes:
- ./${DB_DIR-db-data}:/var/lib/postgresql/data
ports:
- "5432:5432"
- '5432:5432'
environment:
- POSTGRES_DB=registry
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -44,12 +52,12 @@ services:
- event_enabled=${EVENT_ENABLED-false}
- event_topic=events
- event_providerName=dev.sunbirdrc.registry.service.impl.KafkaEventService
- elastic_search_connection_url=es:9200
- elastic_search_connection_url=${ELASTIC_SEARCH_CONNECTION_URL-es:9200}
- elastic_search_scheme=${ELASTIC_SEARCH_SCHEME-http}
- elastic_search_auth_enabled=${ELASTIC_SECURITY_ENABLED-false}
- elastic_search_username=${ELASTIC_SEARCH_USERNAME-elastic}
- elastic_search_password=${ELASTIC_SEARCH_PASSWORD}
- search_providerName=${SEARCH_PROVIDER_NAME-dev.sunbirdrc.registry.service.ElasticSearchService}
- search_providerName=${SEARCH_PROVIDER_NAME-dev.sunbirdrc.registry.service.NativeSearchService}
- sunbird_sso_realm=${KEYCLOAK_REALM-sunbird-rc}
- sunbird_sso_url=http://keycloak:8080/auth
- sunbird_sso_admin_client_id=${KEYCLOAK_ADMIN_CLIENT_ID-admin-api}
Expand All @@ -66,7 +74,7 @@ services:
- certificate_health_check_url=http://certificate-api:8078/health
- template_base_url=http://registry:8081/api/v1/templates/ #Looks for certificate templates for pdf copy of the signed certificate
- sunbird_keycloak_user_set_password=true
- filestorage_enabled=false
- filestorage_enabled=${FILESSTORAGE_ENABLED-false}
- filestorage_connection_url=http://file-storage:9000
- filestorage_access_key=admin
- filestorage_secret_key=12345678
Expand All @@ -76,7 +84,7 @@ services:
- logging.level.root=INFO
- enable_external_templates=true
- async_enabled=${ASYNC_ENABLED-false}
- authentication_enabled=true
- authentication_enabled=${AUTHENTICATION_ENABLED-true}
- kafka_bootstrap_address=kafka:9092
- webhook_enabled=false
- webhook_url=http://localhost:5001/api/v1/callback
Expand All @@ -87,14 +95,16 @@ services:
- notification_enabled=${NOTIFICATION_ENABLED-false}
- notification_url=${NOTIFICATION_URL-http://notification-ms:8765/notification-service/v1/notification}
ports:
- "8081:8081"
- '8081:8081'
depends_on:
es:
condition: service_healthy
db:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "wget -nv -t1 --spider http://localhost:8081/health || exit 1" ]
test:
[
'CMD-SHELL',
'wget -nv -t1 --spider http://localhost:8081/health || exit 1',
]
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -115,14 +125,13 @@ services:
- KEYCLOAK_IMPORT=/opt/jboss/keycloak/imports/realm-export.json
- PROXY_ADDRESS_FORWARDING=true
healthcheck:
test:
["CMD-SHELL", "curl -f http://localhost:9990/ || exit 1"]
test: ['CMD-SHELL', 'curl -f http://localhost:9990/ || exit 1']
interval: 30s
timeout: 10s
retries: 10
ports:
- "8080:8080"
- "9990:9990"
- '8080:8080'
- '9990:9990'
depends_on:
db:
condition: service_healthy
Expand All @@ -134,14 +143,18 @@ services:
- connectionInfo_password=postgres
- sunbirdrc_url=http://registry:8081
ports:
- "8082:8082"
- '8082:8082'
depends_on:
db:
condition: service_started
registry:
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "wget -nv -t1 --spider http://localhost:8082/health || exit 1" ]
test:
[
'CMD-SHELL',
'wget -nv -t1 --spider http://localhost:8082/health || exit 1',
]
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -151,12 +164,11 @@ services:
- PORT=8079
- TIME_ZONE=Asia/Kolkata
ports:
- "8079:8079"
- '8079:8079'
volumes:
- ./imports:/etc/signer
healthcheck:
test:
[ "CMD-SHELL", "curl -f http://localhost:8079/health || exit 1" ]
test: ['CMD-SHELL', 'curl -f http://localhost:8079/health || exit 1']
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -165,10 +177,13 @@ services:
environment:
- PORT=8078
ports:
- "8078:8078"
- '8078:8078'
healthcheck:
test:
[ "CMD-SHELL", "wget -nv -t1 --spider http://localhost:8078/health || exit 1" ]
[
'CMD-SHELL',
'wget -nv -t1 --spider http://localhost:8078/health || exit 1',
]
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -181,20 +196,24 @@ services:
- MINIO_ROOT_PASSWORD=12345678
command: server --address 0.0.0.0:9000 --console-address 0.0.0.0:9001 /data
ports:
- "9000:9000"
- "9001:9001"
- '9000:9000'
- '9001:9001'
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 10
notification-ms:
image: ghcr.io/sunbird-rc/sunbird-rc-notification-service:${RELEASE_VERSION}
ports:
- "8765:8765"
- '8765:8765'
healthcheck:
test:
[ "CMD-SHELL", "wget -nv -t1 --spider http://localhost:8765/notification-service/v1/health || exit 1" ]
[
'CMD-SHELL',
'wget -nv -t1 --spider
http://localhost:8765/notification-service/v1/health || exit 1',
]
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -207,27 +226,33 @@ services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
ports:
- "2181:2181"
- '2181:2181'
environment:
ZOOKEEPER_CLIENT_PORT: "2181"
ZOOKEEPER_TICK_TIME: "2000"
ZOOKEEPER_CLIENT_PORT: '2181'
ZOOKEEPER_TICK_TIME: '2000'
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
zookeeper:
condition: service_started
ports:
- "9092:9092"
- '9092:9092'
environment:
KAFKA_BROKER_ID: "1"
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka:9092,OUTSIDE://localhost:9094"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
KAFKA_BROKER_ID: '1'
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: 'INTERNAL://kafka:9092,OUTSIDE://localhost:9094'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT'
KAFKA_INTER_BROKER_LISTENER_NAME: 'INTERNAL'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: '1'
healthcheck:
test:
[ "CMD", "kafka-topics", "--list", "--bootstrap-server", "localhost:9092" ]
[
'CMD',
'kafka-topics',
'--list',
'--bootstrap-server',
'localhost:9092',
]
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -236,9 +261,10 @@ services:
environment:
- CONFIG_BASE_PATH=/etc/keys
ports:
- "3300:3300"
- '3300:3300'
healthcheck:
test: [ "CMD", "curl", "-f", "localhost:3300/public-key-service/api/v1/health" ]
test:
['CMD', 'curl', '-f', 'localhost:3300/public-key-service/api/v1/health']
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -247,16 +273,16 @@ services:
context-proxy-service:
image: ghcr.io/sunbird-rc/sunbird-rc-context-proxy-service
ports:
- "4400:4400"
- '4400:4400'
healthcheck:
test: [ "CMD", "curl", "-f", "localhost:4400/health" ]
test: ['CMD', 'curl', '-f', 'localhost:4400/health']
interval: 30s
timeout: 10s
retries: 10
nginx:
image: ghcr.io/sunbird-rc/sunbird-rc-nginx
ports:
- "80:80"
- '80:80'
depends_on:
registry:
condition: service_healthy
Expand All @@ -271,7 +297,7 @@ services:
file-storage:
condition: service_started
healthcheck:
test: [ "CMD", "curl", "-f", "localhost:80" ]
test: ['CMD', 'curl', '-f', 'localhost:80']
interval: 30s
timeout: 10s
retries: 10
Expand All @@ -284,7 +310,7 @@ services:
KAFKA_METRICS_TOPIC: events
REDIS_URL: redis:6379
ports:
- "8070:8070"
- '8070:8070'
depends_on:
kafka:
condition: service_healthy
Expand All @@ -293,29 +319,36 @@ services:
redis:
image: redis:latest
ports:
- "6379:6379"
- '6379:6379'
digilocker-certificate-api:
image: ghcr.io/sunbird-rc/sunbird-rc-digilocker-certificate-api
volumes:
- ./services/digilocker-certificate-api/config/:/go/config/
ports:
- "8087:8087"
- '8087:8087'
environment:
KEYCLOAK_CLIENT_ID: admin-api
KEYCLOAK_CLIENT_SECRET: ${KEYCLOAK_SECRET}
KEYCLOAK_CLIENT_SECRET: 61fdeaf0-9654-4c12-b7ff-f7116c9e4fca
Sreejit-K marked this conversation as resolved.
Show resolved Hide resolved
DIGILOCKER_HMAC_AUTHKEY: ${DIGILOCKER_HMAC_AUTHKEY}
DIGILOCKER_AUTH_KEYNAME: x-digilocker-hmac
PORT: 8087
bulk_issuance:
image: ghcr.io/sunbird-rc/sunbird-rc-bulk-issuance
ports:
- "5665:5665"
- '5665:5665'
environment:
REGISTRY_BASE_URL: http://registry:8081/
DATABASE_HOST: db
depends_on:
db:
condition: service_healthy
keycloak:
condition: service_healthy
clickhouse:
image: clickhouse/clickhouse-server:23.4.2.11-alpine
ports:
- "9002:9000"
- '9002:9000'
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
test:
wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit
1
2 changes: 1 addition & 1 deletion imports/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"$comment": "The above are test keys and it needs to be replaced before going to production"
}
}
}
}
Loading