-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes
557 lines (433 loc) · 13.6 KB
/
Notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# Broadsea .env Configuration Guide
## Section 1: Basic Configuration
These settings control core Broadsea functionality:
1. `BROADSEA_HOST`:
- Set to "127.0.0.1" for local deployment
- For remote servers, use IP address or hostname (without http/https)
- Example: "my-server.company.com"
2. `HTTP_TYPE`:
- Use "http" for standard deployment
- Use "https" if you have SSL certificates configured
3. `BROADSEA_CERTS_FOLDER`:
- Only required if using HTTPS
- Set to folder path containing "broadsea.crt" and "broadsea.key"
- Example: "./certs"
4. `DOCKER_ARCH`:
- For Mac Silicon (M1/M2) users: set to "linux/arm64"
- For all others: leave as "linux/amd64"
## Section 2: Atlas Configuration
Basic Atlas web application settings:
1. `ATLAS_VERSION`:
- Set to desired Atlas version
- Example: "2.12.0"
2. `ATLAS_BASE_URL`:
- Usually "/atlas"
- Change only if you need a different URL path
3. `ATLAS_USER_AUTH_ENABLED`:
- Set to "true" to enable user authentication
- Set to "false" for development/testing
## Section 3: WebAPI Configuration
Database connection settings for WebAPI:
1. `WEBAPI_VERSION`:
- Set to match your Atlas version
- Example: "2.12.0"
2. For each database connection (CDM and Results), configure:
- `*_HOST`: Database server address
- `*_PORT`: Database port
- `*_DATABASE`: Database name
- `*_SCHEMA`: Schema name
- `*_USER`: Username
- `*_PASSWORD_FILE`: Path to file containing password
3. `WEBAPI_ADDITIONAL_JDBC_FILE_PATH`:
- Only needed for special drivers (e.g., Snowflake)
- Set to path of JDBC driver file
4. `WEBAPI_CACERTS_FILE`:
- Only needed for LDAP/Snowflake
- Path to Java keystore file
## Section 4: Atlas Security Settings
Configure if using authentication:
1. `ATLAS_SECURITY_PROVIDER_TYPE`:
- Options: "ad" (Active Directory), "db" (Database), "ldap", or others
- Example: "db" for database authentication
2. `ATLAS_SECURITY_PROVIDER_NAME`:
- Display name for login screen
- Example: "Database Security"
3. `ATLAS_SECURITY_USE_FORM`:
- Usually set to "true" for form-based login
- Set to "false" for other authentication methods
## Section 5: WebAPI Security Settings
Corresponds to Atlas security:
1. `WEBAPI_SECURITY_PROVIDER`:
- Must match Atlas settings
- Example: "AtlasRegularSecurity" for database auth
2. `SECURITY_AUTH_JDBC_ENABLED`:
- Set to "true" if using database authentication
- Set to "false" for other methods
## Section 6: Git Build Settings
Only needed if building from source:
1. `ATLAS_GIT_URL`:
- GitHub URL for Atlas source
- Can include branch/commit after "#"
2. `WEBAPI_GIT_URL`:
- GitHub URL for WebAPI source
- Can include branch/commit after "#"
## Section 7: SOLR Configuration
For vocabulary search:
1. `VOCAB_SOLR_URL`:
- URL to SOLR instance
- Example: "http://broadsea-solr:8983/solr"
2. `VOCAB_SCHEMA`:
- Schema name containing OMOP vocabulary
- Must match WebAPI configuration
## Section 8: HADES Configuration
For R environment:
1. `HADES_USER`:
- Username for RStudio
- Default is "ohdsi"
2. `HADES_PASSWORD_FILE`:
- Path to file containing RStudio password
- Example: "./secrets/hades/HADES_PASSWORD"
## Section 9: OMOP Vocabulary Loading
For loading vocabulary into PostgreSQL:
1. `UMLS_API_KEY_FILE`:
- Path to file containing UMLS API key
- Required for CPT4 processing
2. Configure database connection:
- Similar to WebAPI database settings
- Must point to target vocabulary database
## Additional Sections
The remaining sections (10-18) follow similar patterns for:
- Phoebe integration
- Ares configuration
- Broadsea content page
- OpenLDAP settings
- Shiny Server settings
- Posit Connect
- DBT configuration
- Post-processing tools
- pgAdmin settings
Remember to:
1. Store all sensitive information in separate files under ./secrets
2. Use absolute paths when referencing external files
3. Double-check all database connection settings
4. Ensure version numbers match between components
# Broadsea Secrets Configuration Guide
## Overview
Broadsea 3.5 uses Docker Secrets to handle sensitive information like passwords and API keys. Each secret should be stored in its own file within the `./secrets` directory structure. This guide explains how to set up these secret files properly.
## Directory Structure
First, create this recommended directory structure:
```
./secrets/
├── atlasdb/
│ ├── ATLASDB_PASSWORD
│ └── WEBAPI_PASSWORD
├── cdm/
│ ├── CDM_PASSWORD
│ └── RESULTS_PASSWORD
├── hades/
│ └── HADES_PASSWORD
├── ldap/
│ ├── LDAP_ADMIN_PASSWORD
│ └── LDAP_CONFIG_PASSWORD
├── omop/
│ └── VOCAB_PASSWORD
├── pgadmin/
│ └── PGADMIN_PASSWORD
└── umls/
└── UMLS_API_KEY
```
## Setting Up Secret Files
### General Rules
1. Each file should contain ONLY the secret value
2. No newlines, spaces, or special characters unless required
3. Files should not have extensions
4. Use appropriate file permissions (readable only by owner)
### Step-by-Step Instructions
1. **Create Base Directory**
```bash
mkdir -p ./secrets
```
2. **Create Subdirectories**
```bash
cd ./secrets
mkdir atlasdb cdm hades ldap omop pgadmin umls
```
3. **Set Directory Permissions**
```bash
chmod 700 ./secrets
```
4. **Create and Populate Secret Files**
#### Atlas Database Secrets
```bash
# Create ATLASDB_PASSWORD file
echo "your_atlas_db_password" > ./secrets/atlasdb/ATLASDB_PASSWORD
chmod 600 ./secrets/atlasdb/ATLASDB_PASSWORD
# Create WEBAPI_PASSWORD file
echo "your_webapi_password" > ./secrets/atlasdb/WEBAPI_PASSWORD
chmod 600 ./secrets/atlasdb/WEBAPI_PASSWORD
```
#### CDM Database Secrets
```bash
# Create CDM_PASSWORD file
echo "your_cdm_password" > ./secrets/cdm/CDM_PASSWORD
chmod 600 ./secrets/cdm/CDM_PASSWORD
# Create RESULTS_PASSWORD file
echo "your_results_password" > ./secrets/cdm/RESULTS_PASSWORD
chmod 600 ./secrets/cdm/RESULTS_PASSWORD
```
#### HADES (RStudio) Secret
```bash
# Create HADES_PASSWORD file
echo "your_rstudio_password" > ./secrets/hades/HADES_PASSWORD
chmod 600 ./secrets/hades/HADES_PASSWORD
```
#### LDAP Secrets
```bash
# Create LDAP_ADMIN_PASSWORD file
echo "your_ldap_admin_password" > ./secrets/ldap/LDAP_ADMIN_PASSWORD
chmod 600 ./secrets/ldap/LDAP_ADMIN_PASSWORD
# Create LDAP_CONFIG_PASSWORD file
echo "your_ldap_config_password" > ./secrets/ldap/LDAP_CONFIG_PASSWORD
chmod 600 ./secrets/ldap/LDAP_CONFIG_PASSWORD
```
#### OMOP Vocabulary Secret
```bash
# Create VOCAB_PASSWORD file
echo "your_vocab_password" > ./secrets/omop/VOCAB_PASSWORD
chmod 600 ./secrets/omop/VOCAB_PASSWORD
```
#### pgAdmin Secret
```bash
# Create PGADMIN_PASSWORD file
echo "your_pgadmin_password" > ./secrets/pgadmin/PGADMIN_PASSWORD
chmod 600 ./secrets/pgadmin/PGADMIN_PASSWORD
```
#### UMLS API Key
```bash
# Create UMLS_API_KEY file
echo "your_umls_api_key" > ./secrets/umls/UMLS_API_KEY
chmod 600 ./secrets/umls/UMLS_API_KEY
```
## Password Requirements
1. **Atlas/WebAPI Passwords**
- Minimum 8 characters
- Mix of uppercase, lowercase, numbers
- No special characters that need escaping in connection strings
2. **HADES (RStudio) Password**
- Minimum 8 characters
- At least one number
- At least one uppercase letter
- At least one lowercase letter
3. **LDAP Passwords**
- Minimum 12 characters
- Mix of uppercase, lowercase, numbers, special characters
- Avoid characters that need escaping in LDAP configs
4. **Database Passwords**
- Follow your database system's password requirements
- Avoid special characters that need escaping in connection strings
## Verification Steps
After creating all secret files:
1. **Check File Permissions**
```bash
ls -la ./secrets/*
```
All files should show `600` permissions.
2. **Verify File Contents**
```bash
for file in $(find ./secrets -type f); do
echo "Checking $file"
wc -l $file # Should show 1 line
done
```
3. **Update .env File**
- Ensure all paths in .env point to correct secret files
- Use absolute paths if deploying in production
## Security Best Practices
1. Never commit secret files to version control
2. Add `secrets/` to your `.gitignore` file
3. Create separate passwords for development and production
4. Rotate passwords regularly in production
5. Keep backup copies of passwords in a secure password manager
6. Consider using a secrets management service in production
## Troubleshooting
If services fail to start:
1. Check file permissions
2. Verify no extra newlines in secret files
3. Confirm paths in .env match secret file locations
4. Check for special characters that might need escaping
5. Verify file encodings are UTF-8 without BOM
# Broadsea Deployment Scenarios Guide
## Core Deployments
### 1. Local Development
```env
BROADSEA_HOST=127.0.0.1
HTTP_TYPE=http
DOCKER_ARCH=linux/amd64 # linux/arm64 for Mac Silicon
ATLAS_VERSION=2.12.0
ATLAS_USER_AUTH_ENABLED=false
CDM_HOST=host.docker.internal
CDM_PORT=5432
```
Launch: `docker compose --profile default up -d`
### 2. Basic Production
```env
BROADSEA_HOST=ohdsi.company.com
HTTP_TYPE=https
ATLAS_USER_AUTH_ENABLED=true
ATLAS_SECURITY_PROVIDER_TYPE=db
WEBAPI_SECURITY_PROVIDER=AtlasRegularSecurity
```
Launch: `docker compose --profile default --profile solr-vocab-with-import up -d`
## Cloud Deployments
### 3. AWS Deployment
```env
# Basic Configuration
BROADSEA_HOST=ohdsi.company.aws.com
HTTP_TYPE=https
BROADSEA_CERTS_FOLDER=/etc/letsencrypt/live/ohdsi.company.aws.com
# AWS Services
CDM_HOST=mycdm.xxxxx.region.rds.amazonaws.com
RESULTS_HOST=myresults.xxxxx.region.rds.amazonaws.com
WEBAPI_ADDITIONAL_JDBC_FILE_PATH=/jdbc/redshift-jdbc.jar # For Redshift
# S3 Integration
HADES_AWS_DEFAULT_REGION=us-east-1
HADES_AWS_ACCESS_KEY_ID_FILE=./secrets/aws/ACCESS_KEY
HADES_AWS_SECRET_ACCESS_KEY_FILE=./secrets/aws/SECRET_KEY
# Optional: ElastiCache for SOLR
VOCAB_SOLR_URL=http://elasticache-solr.xxxxx.region.amazonaws.com:8983/solr
```
Launch:
```bash
docker compose --profile default \
--profile solr-vocab-with-import \
--profile open-shiny-server up -d
```
### 4. Azure Deployment
```env
# Basic Configuration
BROADSEA_HOST=ohdsi.azurewebsites.net
HTTP_TYPE=https
BROADSEA_CERTS_FOLDER=/etc/ssl/azure
# Azure SQL Database
CDM_HOST=myserver.database.windows.net
CDM_PORT=1433
CDM_DATABASE=ohdsi
CDM_USER=@myserver
WEBAPI_ADDITIONAL_JDBC_FILE_PATH=/jdbc/mssql-jdbc.jar
# Azure AD Integration
ATLAS_SECURITY_PROVIDER_TYPE=azure-ad
ATLAS_SECURITY_OAUTH2_CLIENT_ID_FILE=./secrets/azure/CLIENT_ID
ATLAS_SECURITY_OAUTH2_CLIENT_SECRET_FILE=./secrets/azure/CLIENT_SECRET
# Azure Storage
HADES_AZURE_STORAGE_ACCOUNT=ohdsistore
HADES_AZURE_STORAGE_KEY_FILE=./secrets/azure/STORAGE_KEY
# Azure Cache for Redis (Optional)
VOCAB_SOLR_URL=http://mycache.redis.cache.windows.net:8983/solr
```
Launch:
```bash
docker compose --profile default \
--profile solr-vocab-with-import \
--profile azure-ad up -d
```
### 5. Google Cloud Platform Deployment
```env
# Basic Configuration
BROADSEA_HOST=ohdsi.company.cloud.goog
HTTP_TYPE=https
BROADSEA_CERTS_FOLDER=/etc/ssl/gcp
# Cloud SQL
CDM_HOST=/cloudsql/project:region:instance
CDM_PORT=5432
WEBAPI_ADDITIONAL_JDBC_FILE_PATH=/jdbc/postgres-socket-factory.jar
# GCP Authentication
ATLAS_SECURITY_PROVIDER_TYPE=google
ATLAS_SECURITY_OAUTH2_CLIENT_ID_FILE=./secrets/gcp/CLIENT_ID
ATLAS_SECURITY_OAUTH2_CLIENT_SECRET_FILE=./secrets/gcp/CLIENT_SECRET
# Google Cloud Storage
HADES_GCP_PROJECT_ID=my-project
HADES_GCP_BUCKET=ohdsi-data
HADES_GCP_KEY_FILE=./secrets/gcp/SERVICE_ACCOUNT.json
# Cloud Memorystore (Optional)
VOCAB_SOLR_URL=http://memorystore-solr.company.internal:8983/solr
```
Launch:
```bash
docker compose --profile default \
--profile solr-vocab-with-import \
--profile gcp-auth up -d
```
## Specialized Deployments
### 6. High-Performance Research
```env
HADES_MEMORY_LIMIT=32g
HADES_CPU_LIMIT=16
CDM_MAX_CONNECTIONS=200
```
Launch: `docker compose --profile default --profile jupyter-notebook up -d`
### 7. ETL Development
```env
# Perseus Configuration
PERSEUS_DB_HOST=host.docker.internal
PERSEUS_DB_NAME=perseus
WR_CDM_SCHEMA=cdm_staging
```
Launch: `docker compose --profile perseus --profile white-rabbit up -d`
### 8. Evidence Platform
```env
# Application Settings
OPEN_SHINY_SERVER_PORT=3838
JUPYTER_PORT=8888
ACHILLES_CDM_SCHEMA=cdm
```
Launch:
```bash
docker compose --profile default \
--profile open-shiny-server \
--profile jupyter-notebook \
--profile achilles up -d
```
## Deployment Checklist
### Pre-deployment
- [ ] Verify secrets files
- [ ] Check cloud resource limits
- [ ] Configure network security
- [ ] Set up monitoring
- [ ] Plan backup strategy
### Security Configurations
- [ ] Enable appropriate authentication
- [ ] Set up SSL certificates
- [ ] Configure network policies
- [ ] Implement access controls
- [ ] Plan secret rotation
### Monitoring Setup
```bash
# Container status
docker compose ps
# Logs
docker compose logs -f
# Resource usage
docker stats
```
### Cloud-Specific Considerations
#### AWS
- Use Security Groups for network isolation
- Consider ECS/EKS for container orchestration
- Implement AWS CloudWatch monitoring
- Use AWS Secrets Manager for secrets
#### Azure
- Use Network Security Groups
- Consider AKS for container orchestration
- Implement Azure Monitor
- Use Azure Key Vault for secrets
#### GCP
- Use VPC Firewall Rules
- Consider GKE for container orchestration
- Implement Cloud Monitoring
- Use Secret Manager for secrets
### Performance Optimization
- Monitor container metrics
- Adjust resource limits
- Scale horizontally when needed
- Implement load balancing
- Use cloud-native caching services