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

[WIP] mongo7 upgrade #140

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
19 changes: 14 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
fail-fast: false
matrix:
include:
- python-version: '3.7'
- python-version: '3.9.19'
mongo-version: '3.6'
# - python-version: '3.7'
# mongo-version: '7.0.4'
- python-version: '3.9.19'
mongo-version: '7.0.4'
services:
mongo:
image: mongo:${{matrix.mongo-version}}
ports:
- 27017:27017
- 27018:27017
options: --name mongo${{matrix.mongo-version}}

steps:
Expand All @@ -43,6 +43,12 @@ jobs:
with:
python-version: ${{matrix.python-version}}

- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/v2.32.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

- name: Install dependencies and set up test config
shell: bash
env:
Expand All @@ -52,7 +58,7 @@ jobs:
run: |

# test mongo connection
curl http://localhost:27017
curl http://localhost:27018
returncode=$?
if [ $returncode != 0 ]; then exit $returncode; fi

Expand All @@ -77,6 +83,9 @@ jobs:
sed -i "s#^nms-admin-token.*#nms-admin-token=$KBASE_CI_TOKEN#" test/test.cfg
sed -i "s#^method-spec-admin-users.*#method-spec-admin-users=$ADMIN_USER#" test/test.cfg

# setup env variables in docker-compose_nms.yml file
echo "ADMIN_USER=$ADMIN_USER" >> $GITHUB_ENV

- name: Run tests
shell: bash
run: make test
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ setup-tests:
mkdir -p $(TESTDIR)/nms
rsync -av lib/biokbase/* $(TESTLIB)/biokbase/. --exclude *.bak-*
rsync -av kbapi_common/lib/biokbase/* $(TESTLIB)/biokbase/.
cd narrative_method_store; make; make build-classpath-list;
# cd narrative_method_store; make; make build-classpath-list;
# rsync -av narrative_method_store/lib/biokbase/* $(TESTLIB)/biokbase/.


Expand Down
2 changes: 1 addition & 1 deletion jars
Submodule jars updated 330 files
2 changes: 1 addition & 1 deletion narrative_method_store
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pymongo==3.10
pymongo==4.7.2
docker>=3.5
gitpython
pyyaml
Expand Down
47 changes: 47 additions & 0 deletions test/docker-compose_nms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3.4'

services:
nms:
image: ghcr.io/kbase/narrative_method_store:v0.3.12
platform: linux/amd64
ports:
- "7125:7125"
depends_on: ["mongo"]
environment:
# see deployment/conf/.templates for more environment variables
- method_spec_git_repo=https://github.com/kbase/narrative_method_specs_ci
- method_spec_git_repo_branch=master
- method_spec_git_repo_local_dir=narrative_method_specs_recreated_at_startup
- method_spec_git_repo_refresh_rate=2
- method_spec_cache_size=5000
- method_spec_temp_dir=narrative_method_store_temp
- method_spec_mongo_host=mongo:27017
- method_spec_mongo_dbname=method_store_repo_db
- method_spec_admin_users=${ADMIN_USER}
- endpoint_host=https://ci.kbase.us
- endpoint_base=/services
- method_spec_default_tag=dev
- auth_service_url=https://ci.kbase.us/services/auth/api/legacy/KBase/Sessions/Login
- auth_service_url_allow_insecure=false
- service_port=7125
command:
- "-wait"
- "tcp://mongo:27017"
- "-timeout"
- "120s"
- "-template"
- "/kb/deployment/conf/.templates/deployment.cfg.templ:/kb/deployment/conf/deployment.cfg"
- "-template"
- "/kb/deployment/conf/.templates/http.ini.templ:/kb/deployment/services/narrative_method_store/start.d/http.ini"
- "-template"
- "/kb/deployment/conf/.templates/server.ini.templ:/kb/deployment/services/narrative_method_store/start.d/server.ini"
- "-template"
- "/kb/deployment/conf/.templates/start_server.sh.templ:/kb/deployment/bin/start_server.sh"
- "-stdout"
- "/kb/deployment/services/narrative_method_store/logs/request.log"
- "/kb/deployment/bin/start_server.sh"

mongo:
image: "mongo:7.0.4"
ports:
- "27017:27017"
4 changes: 2 additions & 2 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# start the test NMS endpoint
echo 'Starting NMS...'
export KB_DEPLOYMENT_CONFIG=test.cfg
classpath=`cat ../narrative_method_store/dist/jar.classpath.txt`
java -cp $classpath us.kbase.narrativemethodstore.NarrativeMethodStoreServer 7125 > nms/error.log 2>&1 &
docker-compose -f docker-compose_nms.yml up -d
NMS_PID=$!

echo 'Starting Mock Auth API...'
Expand Down Expand Up @@ -62,5 +61,6 @@ kill -9 $NMS_PID
#stop Docker containers
docker stop mock-auth
docker stop registry
docker-compose -f docker-compose_nms.yml down

exit ${TEST_RETURN_CODE}
4 changes: 2 additions & 2 deletions test/test.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ test-user-2 = wstester2
test-module-repo-1 = https://github.com/kbaseIncubator/catalog_test_module
test-module-repo-2 = https://github.com/kbaseIncubator/catalog_test_module.git

# host where mongo lives, e.g. localhost:27017, for tests there should be not authentication required
mongodb-host = localhost:27017
# host where mongo lives, e.g. localhost:27018, for tests there should be not authentication required
mongodb-host = localhost:27018

# docker registry host endpoint
docker-registry-host = localhost:5000
Expand Down
Loading