Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 1 addition & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ jobs:
gsutil cp gs://all-of-us-workbench-test-credentials/.npmrc .
yarn install
yarn codegen
REACT_APP_ENVIRONMENT=pr-site-$PR_SITE_NUM yarn run build --aot --no-watch --no-progress
REACT_APP_ENVIRONMENT=test yarn run build --aot --no-watch --no-progress
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go with this approach, I will delete the unused PR site configuration files.

- run:
name: Deploy
working_directory: ui
Expand All @@ -533,41 +533,6 @@ jobs:
export PR_SITE_NUM="$(expr $PR_NUM % $PR_SITE_COUNT)"

../e2ev2/src/circle-deploy-ui.sh
e2etests-deploy-api:
machine:
image: ubuntu-2204:2022.04.1
environment:
PR_SITE_COUNT: 10
steps:
- run:
name: Checkout code
command: |
git clone --branch="$CIRCLE_BRANCH" --depth=1 \
https://github.com/"$CIRCLE_PROJECT_USERNAME"/"$CIRCLE_PROJECT_REPONAME".git .
(cd aou-utils/; git submodule update --init)
- run:
name: Build
working_directory: api
command: |
# Redirection here suppresses this warning:
# *** WARNING : deprecated key derivation used.
# Using -iter or -pbkdf2 would be better.
SA_KEY_JSON="$(echo "$GCLOUD_CREDENTIALS" \
| openssl enc -d -md sha256 -aes-256-cbc -base64 -A \
-k "$GCLOUD_CREDENTIALS_KEY" 2>/dev/null)"
echo "$SA_KEY_JSON" | gcloud auth activate-service-account \
"$(echo "$SA_KEY_JSON" | jq -r .client_email)" --key-file=-

sudo apt install openjdk-8-jdk
PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:"$PATH"
gsutil cp gs://all-of-us-workbench-test-credentials/vars.env db
set -a; source db/local-vars.env; source db/vars.env; set +a
./gradlew --no-daemon :appengineStage

PR_NUM="$(echo "$CIRCLE_PULL_REQUEST" | perl -ne "/(\d+)\$/; print \$1")"
PR_SITE_NUM="$(expr $PR_NUM % $PR_SITE_COUNT)"
gcloud app deploy build/staged-app/app.yaml -q --project=all-of-us-workbench-test \
--no-promote --version=pr-$PR_SITE_NUM
e2etests-run:
machine:
image: ubuntu-2204:2022.04.1
Expand Down Expand Up @@ -860,12 +825,9 @@ workflows:
jobs:
- e2etests-deploy-ui:
<<: *filter-pr-branch
- e2etests-deploy-api:
<<: *filter-pr-branch
- e2etests-run:
requires:
- e2etests-deploy-ui
- e2etests-deploy-api

deploy-staging:
jobs:
Expand Down
19 changes: 19 additions & 0 deletions api-proxy/handlers/*.options.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const matchReq = req => req.method === 'OPTIONS'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only handler that is hand-edited. All of the OPTIONS method responses were basically identical, so I consolidated them into one file.


const headers = {
'access-control-allow-credentials': 'true',
'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET, HEAD, POST, PUT, DELETE, PATCH, TRACE, OPTIONS',
'access-control-allow-headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization',
vary: 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers',
allow: 'GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH',
'content-type': 'text/html',
server: 'Google Frontend'
}

const handleReq = (req, res) => {
if (!matchReq(req)) { return }
Object.keys(headers).forEach(h => res.setHeader(h, headers[h]))
res.status(200).mend()
}
export default handleReq
7 changes: 7 additions & 0 deletions api-proxy/handlers/|.get.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const handleReq = (req, res) => {
if (!(req.url.pathname === '/'
&& req.url.search === ''
&& req.method === 'GET')) { return }
res.mwrite(`AllOfUs Workbench API`).mend()
}
export default handleReq
102 changes: 102 additions & 0 deletions api-proxy/handlers/|v1|cdrVersionsByTier.get.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
const matchReq = req =>
req.url.pathname === '/v1/cdrVersionsByTier'
&& req.url.search === ''
&& req.method === 'GET'

const body = JSON.stringify(
{
tiers: [
{
accessTierShortName: 'controlled',
accessTierDisplayName: 'Controlled Tier',
defaultCdrVersionId: '5',
defaultCdrVersionCreationTime: 1598400591000,
versions: [
{
cdrVersionId: '5',
name: 'Synthetic Dataset in the Controlled Tier',
accessTierShortName: 'controlled',
archivalStatus: 'LIVE',
hasWgsData: true,
hasFitbitData: true,
hasCopeSurveyData: true,
creationTime: 1598400591000
}
]
},
{
accessTierShortName: 'registered',
accessTierDisplayName: 'Registered Tier',
defaultCdrVersionId: '3',
defaultCdrVersionCreationTime: 1569801600000,
versions: [
{
cdrVersionId: '4',
name: '[Removed] Synthetic Dataset v3 with Microarray',
accessTierShortName: 'registered',
archivalStatus: 'ARCHIVED',
hasWgsData: false,
hasFitbitData: true,
hasCopeSurveyData: true,
creationTime: 1598400591000
},
{
cdrVersionId: '6',
name: '[Removed] Synthetic Dataset v3 with WGS',
accessTierShortName: 'registered',
archivalStatus: 'ARCHIVED',
hasWgsData: false,
hasFitbitData: false,
hasCopeSurveyData: false,
creationTime: 1598400591000
},
{
cdrVersionId: '2',
name: 'Synthetic Dataset v2',
accessTierShortName: 'registered',
archivalStatus: 'LIVE',
hasWgsData: false,
hasFitbitData: true,
hasCopeSurveyData: true,
creationTime: 1569801600000
},
{
cdrVersionId: '3',
name: 'Synthetic Dataset v3',
accessTierShortName: 'registered',
archivalStatus: 'LIVE',
hasWgsData: false,
hasFitbitData: true,
hasCopeSurveyData: true,
creationTime: 1569801600000
},
{
cdrVersionId: '1',
name: '[Removed] Synthetic Dataset v1',
accessTierShortName: 'registered',
archivalStatus: 'ARCHIVED',
hasWgsData: false,
hasFitbitData: false,
hasCopeSurveyData: false,
creationTime: 1528243200000
}
]
}
]
}
)

const headers = {
'access-control-allow-credentials': 'true',
'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET, HEAD, POST, PUT, DELETE, PATCH, TRACE, OPTIONS',
'access-control-allow-headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization',
'content-type': 'application/json'
}

const handleReq = (req, res) => {
if (!matchReq(req)) { return }
Object.keys(headers).forEach(h => res.setHeader(h, headers[h]))
res.status(200).mwrite(body).mend()
}
export default handleReq
112 changes: 112 additions & 0 deletions api-proxy/handlers/|v1|config.get.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
const matchReq = req =>
req.url.pathname === '/v1/config'
&& req.url.search === ''
&& req.method === 'GET'

const body = JSON.stringify(
{
gsuiteDomain: 'fake-research-aou.org',
projectId: 'all-of-us-workbench-test',
firecloudURL: 'https://firecloud-orchestration.dsde-dev.broadinstitute.org',
publicApiKeyForErrorReports: 'AIzaSyDPoX4Eg7-_FVKi7JFzEKaJpZ4IMRLaER4',
shibbolethUiBaseUrl: 'https://broad-shibboleth-prod.appspot.com/dev',
enableComplianceTraining: true,
complianceTrainingHost: 'aoudev.nnlm.gov',
enableEraCommons: true,
unsafeAllowSelfBypass: true,
defaultFreeCreditsDollarLimit: 300,
enableEventDateModifier: false,
enableResearchReviewPrompt: false,
enableRasLoginGovLinking: true,
enforceRasLoginGovLinking: true,
enableGenomicExtraction: true,
enableGpu: true,
enablePersistentDisk: true,
enableUniversalSearch: true,
enableMultiReview: true,
enableDrugWildcardSearch: false,
rasHost: 'https://stsstg.nih.gov',
accessRenewalLookback: 330,
complianceTrainingRenewalLookback: 30,
rasClientId: 'e5c5d714-d597-48c8-b564-a249d729d0c9',
rasLogoutUrl: 'https://authtest.nih.gov/siteminderagent/smlogoutredirector.asp?TARGET=',
runtimeImages: [],
freeTierBillingAccountId: '013713-75CFF6-1751E5',
accessModules: [
{
name: 'ERA_COMMONS',
expirable: false,
bypassable: true,
requiredForRTAccess: false,
requiredForCTAccess: false
},
{
name: 'TWO_FACTOR_AUTH',
expirable: false,
bypassable: true,
requiredForRTAccess: true,
requiredForCTAccess: true
},
{
name: 'RAS_LINK_LOGIN_GOV',
expirable: false,
bypassable: true,
requiredForRTAccess: true,
requiredForCTAccess: true
},
{
name: 'COMPLIANCE_TRAINING',
expirable: true,
bypassable: true,
requiredForRTAccess: true,
requiredForCTAccess: true
},
{
name: 'DATA_USER_CODE_OF_CONDUCT',
expirable: true,
bypassable: true,
requiredForRTAccess: true,
requiredForCTAccess: true
},
{
name: 'PROFILE_CONFIRMATION',
expirable: true,
bypassable: false,
requiredForRTAccess: true,
requiredForCTAccess: true
},
{
name: 'PUBLICATION_CONFIRMATION',
expirable: true,
bypassable: false,
requiredForRTAccess: true,
requiredForCTAccess: true
},
{
name: 'CT_COMPLIANCE_TRAINING',
expirable: true,
bypassable: true,
requiredForRTAccess: false,
requiredForCTAccess: true
}
],
currentDuccVersions: [ 3, 4, 5 ],
enableUpdatedDemographicSurvey: true
}
)

const headers = {
'access-control-allow-credentials': 'true',
'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET, HEAD, POST, PUT, DELETE, PATCH, TRACE, OPTIONS',
'access-control-allow-headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization',
'content-type': 'application/json',
server: 'Google Frontend'
}

const handleReq = (req, res) => {
if (!matchReq(req)) { return }
Object.keys(headers).forEach(h => res.setHeader(h, headers[h]))
res.status(200).mwrite(body).mend()
}
export default handleReq
30 changes: 30 additions & 0 deletions api-proxy/handlers/|v1|disks|aou-rw-test-ca61ee0f.get.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const matchReq = req =>
req.url.pathname === '/v1/disks/aou-rw-test-ca61ee0f'
&& req.url.search === ''
&& req.method === 'GET'

const body = JSON.stringify(
{
message: 'Active PD with prefix all-of-us-pd-4451 not found in workspace aou-rw-test-ca61ee0f',
statusCode: 404,
errorClassName: 'org.pmiops.workbench.exceptions.NotFoundException',
errorCode: null,
errorUniqueId: '584d7b0f-6097-42d4-9160-1be80eab911b',
parameters: null
}
)

const headers = {
'access-control-allow-credentials': 'true',
'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET, HEAD, POST, PUT, DELETE, PATCH, TRACE, OPTIONS',
'access-control-allow-headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization',
'content-type': 'application/json'
}

const handleReq = (req, res) => {
if (!matchReq(req)) { return }
Object.keys(headers).forEach(h => res.setHeader(h, headers[h]))
res.status(404).mwrite(body).mend()
}
export default handleReq
23 changes: 23 additions & 0 deletions api-proxy/handlers/|v1|getUserTermsOfServiceStatus.get.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const matchReq = req =>
req.url.pathname === '/v1/getUserTermsOfServiceStatus'
&& req.url.search === ''
&& req.method === 'GET'

const body = JSON.stringify(
true
)

const headers = {
'access-control-allow-credentials': 'true',
'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET, HEAD, POST, PUT, DELETE, PATCH, TRACE, OPTIONS',
'access-control-allow-headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization',
'content-type': 'application/json'
}

const handleReq = (req, res) => {
if (!matchReq(req)) { return }
Object.keys(headers).forEach(h => res.setHeader(h, headers[h]))
res.status(200).mwrite(body).mend()
}
export default handleReq
Loading