Skip to content

Commit f855e52

Browse files
committed
Switch to Opal via http and 8080
1 parent e2d0fe8 commit f855e52

File tree

3 files changed

+9
-96
lines changed

3 files changed

+9
-96
lines changed

docker-compose_opal.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ services:
22
opal:
33
image: datashield/opal_citest:latest
44
ports:
5+
- 8443:8443
56
- 8080:8080
67
links:
78
- mongo
@@ -15,7 +16,7 @@ services:
1516
- ROCK_HOSTS=rock:8085
1617
- ROCK_ADMINISTRATOR_PASSWORD=foobar
1718
mongo:
18-
image: mongo:6.0.27
19+
image: mongo:8.0
1920
environment:
2021
- MONGO_INITDB_ROOT_USERNAME=root
2122
- MONGO_INITDB_ROOT_PASSWORD=foobar

opal_azure-pipelines.yml

Lines changed: 5 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
# Starts with a vanilla Opal docker composition, installs dsBase
44
# and dsBaseClient (as well as dependencies - including a fully functional
55
# Opal server).
6-
# Does checks and tests then saves results to testStatus repo.
76
#
87
# Inside the root directory $(Pipeline.Workspace) will be a file tree like:
98
# /dsBaseClient <- Checked out version of datashield/dsBaseClient
10-
# /testStatus <- Checked out version of datashield/testStatus
119
# /logs <- Where results of tests and lots are collated
1210
#
1311
# As of May 2020 this takes ~ 70 mins to run.
@@ -37,18 +35,6 @@ variables:
3735
perf.profile: 'azure-pipeline'
3836

3937

40-
#########################################################################################
41-
# Need to define all the GH repos and their access tokens, see:
42-
# https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml
43-
resources:
44-
repositories:
45-
- repository: testStatusRepo
46-
type: github
47-
endpoint: datashield-testing
48-
name: datashield/testStatus
49-
ref: master
50-
51-
5238
#########################################################################################
5339
# When and under what condition to run the pipeline.
5440
schedules:
@@ -83,11 +69,6 @@ jobs:
8369
- checkout: self
8470
path: 'dsBaseClient'
8571

86-
- checkout: testStatusRepo
87-
path: 'testStatus'
88-
persistCredentials: true
89-
condition: and(eq(variables['Build.Repository.Name'], 'datashield/dsBaseClient'), ne(variables['Build.Reason'], 'PullRequest'))
90-
9172

9273
#####################################################################################
9374
# The MySQL install that comes with the VM doesn't seem compatable with our set up
@@ -234,13 +215,13 @@ jobs:
234215
# Install dsBase.
235216
# If previous steps have failed then don't run.
236217
- bash: |
237-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
218+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'http://localhost:8080'); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
238219
239-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v6.3.5-dev'); opal.logout(opal)"
220+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v6.3.5-dev'); opal.logout(opal)"
240221
241222
sleep 60
242223
243-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.set_option(opal, 'default.datashield.privacyControlLevel', 'permissive'); opal.logout(opal)"
224+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.set_option(opal, 'default.datashield.privacyControlLevel', 'permissive'); opal.logout(opal)"
244225
245226
workingDirectory: $(Pipeline.Workspace)/dsBaseClient/tests/testthat/data_files
246227
displayName: 'Install dsBase to Opal, as set disclosure test options'
@@ -363,9 +344,9 @@ jobs:
363344
# If previous steps have failed then don't run
364345
- bash: |
365346
366-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
347+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'http://localhost:8080/'); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
367348
368-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsDanger', username = 'datashield', ref = '6.3.4'); opal.logout(opal)"
349+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.install_github_package(opal, 'dsDanger', username = 'datashield', ref = '6.3.4'); opal.logout(opal)"
369350
370351
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
371352
displayName: 'Install dsDanger package on Opal server'
@@ -526,75 +507,6 @@ jobs:
526507
displayName: 'Down Opal Docker Composition'
527508
condition: succeeded()
528509
529-
#####################################################################################
530-
# Windup phase
531-
#####################################################################################
532-
533-
#####################################################################################
534-
# Output some important version numbers to file. This gets added to the testStatus
535-
# commit so it can be parsed and used on the status table.
536-
- bash: |
537-
538-
echo 'branch:'$(branchName) >> $(datetime).txt
539-
echo 'os:'$(lsb_release -ds) >> $(datetime).txt
540-
echo 'R:'$(R --version | head -n 1) >> $(datetime).txt
541-
echo 'opal:'$(opal system --opal localhost:8443 --user administrator --password "datashield_test&" --version) >> $(datetime).txt
542-
543-
workingDirectory: $(Pipeline.Workspace)/logs
544-
displayName: 'Write versions to file'
545-
condition: succeededOrFailed()
546-
547-
548-
#####################################################################################
549-
# Checkout the testStatus repo, add the results from here, push back to GH.
550-
# TODO: Automatically pull in better email/name info from somewhere.
551-
# TODO: More debug info in commit message
552-
- bash: |
553-
554-
# Git needs some config set to be able to push to a repo.
555-
git config --global user.email "you@example.com"
556-
git config --global user.name "Azure pipeline"
557-
558-
# This repo is checked out in detatched head state, so reconnect it here.
559-
git checkout master
560-
561-
# It is possible that other commits have been made to the testStatus repo since it
562-
# was checked out. i.e. other pipeline runs might have finished.
563-
git pull
564-
565-
# Make the directories if they dont already exist
566-
mkdir --parents logs/$(projectName)/$(branchName)
567-
mkdir --parents docs/$(projectName)/$(branchName)/latest
568-
569-
cp $(Pipeline.Workspace)/logs/coveragelist.csv logs/$(projectName)/$(branchName)/
570-
cp $(Pipeline.Workspace)/logs/coveragelist.csv logs/$(projectName)/$(branchName)/$(datetime).csv
571-
572-
cp $(Pipeline.Workspace)/logs/test_results.xml logs/$(projectName)/$(branchName)/
573-
cp $(Pipeline.Workspace)/logs/test_results.xml logs/$(projectName)/$(branchName)/$(datetime).xml
574-
575-
cp $(Pipeline.Workspace)/logs/$(datetime).txt logs/$(projectName)/$(branchName)/
576-
577-
# Run the script to parse the results and build the html pages.
578-
# status.py JUnit_file.xml coverage_file.csv output_file.html local_repo_path remote_repo_name branch
579-
source/status.py logs/$(projectName)/$(branchName)/$(datetime).xml logs/$(projectName)/$(branchName)/$(datetime).csv logs/$(projectName)/$(branchName)/$(datetime).txt status.html $(Pipeline.Workspace)/$(projectName) $(projectName) $(branchName)
580-
581-
cp status.html docs/$(projectName)/$(branchName)/latest/index.html
582-
git add logs/$(projectName)/$(branchName)/coveragelist.csv
583-
git add logs/$(projectName)/$(branchName)/test_results.xml
584-
git add logs/$(projectName)/$(branchName)/$(datetime).xml
585-
git add logs/$(projectName)/$(branchName)/$(datetime).csv
586-
git add logs/$(projectName)/$(branchName)/$(datetime).txt
587-
git add docs/$(projectName)/$(branchName)/latest/index.html
588-
589-
git commit -m "Azure auto test for $(projectName)/$(branchName) @ $(datetime)" -m "Debug info:\nProjectName:$(projectName)\nBranchName:$(branchName)\nDataTime:$(datetime)"
590-
git push
591-
exit 0
592-
593-
workingDirectory: $(Pipeline.Workspace)/testStatus
594-
displayName: 'Parse test results'
595-
condition: and(eq(variables['Build.Repository.Name'], 'datashield/dsBaseClient'), ne(variables['Build.Reason'], 'PullRequest'))
596-
597-
598510
#####################################################################################
599511
# Output the environment information to the console. This is useful for debugging.
600512
# Always do this, even if some of the above has failed or the job has been cacelled.

tests/testthat/data_files/obiba_opal-upload_testing_datasets.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ upload_testing_dataset_table <- function(opal, project_name, table_name, local_f
1717
opal.table_save(opal, data, project_name, table_name, id.name = "_row_id_", force = TRUE)
1818
}
1919

20-
# opal <- opal.login('administrator','datashield_test&', url='https://192.168.56.100:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0))
21-
opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0))
20+
# opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0))
21+
opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/')
2222

2323
upload_testing_dataset_table(opal, 'ANTHRO', 'anthro1', 'ANTHRO/anthro1.rda')
2424
upload_testing_dataset_table(opal, 'ANTHRO', 'anthro2', 'ANTHRO/anthro2.rda')

0 commit comments

Comments
 (0)