Skip to content
Draft
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
1 change: 0 additions & 1 deletion compose/.env.schema

This file was deleted.

15 changes: 0 additions & 15 deletions compose/compose.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions docker-compose/.env.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IMAGE_RDPC_GATEWAY=
IMAGE_PLATFORM_GATEWAY=
53 changes: 53 additions & 0 deletions docker-compose/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: '3'

services:
# RDPC Gateway
rdpc-gateway:
image: '${IMAGE_RDPC_GATEWAY}'
ports:
- 4000:4000
environment:
# Gateway Server Configuration
PORT: 4000
# RDPC-Gateway Services
WORKFLOW_API_URL: http://localhost:8088
SONG_SEARCH_URL: http://localhost:8081
# ARGO Clinical Services
CLINICAL_GQL_URL: http://localhost:3001
CLINICAL_API_URL: http://localhost:3002

# Platform Gateway
platform-gateway:
image: '${IMAGE_PLATFORM_GATEWAY}'
ports:
- 4001:4001
depends_on:
- elasticsearch
environment:
PORT: 4001
ELASTICSEARCH_HOST: 'http://elasticsearch:9200'
ELASTICSEARCH_PROGRAM_DONOR_DASHBOARD_INDEX: donor_submission_summary
DEV_RECAPTCHA_DISABLED: true

# Elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
ports:
- 9200:9200
volumes:
- es_data:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node
- 'ES_JAVA_OPTS=-Xms512m -Xmx2048m'

# Kibana
kibana:
image: docker.elastic.co/kibana/kibana:7.10.2
depends_on:
- elasticsearch
ports:
- 5601:5601

volumes:
es_data:
driver: local
4 changes: 4 additions & 0 deletions docker-compose/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ES

`file_centric` index needs to exist
`npx ts-node --project tsconfig.json fileCentricEsInit.ts`
82 changes: 82 additions & 0 deletions docker-compose/scripts/fileCentricEsInit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright (c) 2024 The Ontario Institute for Cancer Research. All rights reserved
*
* This program and the accompanying materials are made available under the terms of
* the GNU Affero General Public License v3.0. You should have received a copy of the
* GNU Affero General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import { Client } from '@elastic/elasticsearch';
import indexSettings from './file_centric/file_mapping.json';
import indexData from './file_centric/sample_file_centric.json';

(async () => {
const TEST_INDEX = 'file_centric';
const ELASTICSEARCH_HOST = 'http://localhost:9200';
const esClient = new Client({
node: ELASTICSEARCH_HOST,
ssl: {
rejectUnauthorized: false,
},
});
try {
await esClient.ping();
} catch (err) {
console.log(`failing to ping elasticsearch at ${ELASTICSEARCH_HOST}: `, err);
throw err;
}
try {
console.log(`deleting index ${TEST_INDEX}`);
await esClient.indices.delete({
index: TEST_INDEX,
});
} catch (err) {
console.log(`could not delete index ${TEST_INDEX}: `, err);
if ((await esClient.indices.exists({ index: TEST_INDEX })).body) {
throw err;
}
}

console.log(`creating index ${TEST_INDEX}`);

await esClient.indices.create({
index: TEST_INDEX,
body: indexSettings,
});

console.log('index created');

await Promise.all(
indexData.map((doc, index) => {
console.log(`doc_${index}`);
return esClient.index({
index: TEST_INDEX,
refresh: 'wait_for',
body: {
...doc,
donors: [doc.donors].map((donor) => ({
...donor,
specimens: [donor.specimens].map((specimen) => ({
...specimen,
samples: [specimen.samples],
})),
})),
repositories: [doc.repositories],
},
});
}),
);

console.log('Complete!');
})();
Loading