Skip to content

Commit

Permalink
Improve Docker Compose scripts to prepare the dev environment (#354)
Browse files Browse the repository at this point in the history
* Don’t use cached layers when building local images

* Declare Postgres variables so that they’re set to the env file values

* Prefix container names with project name

* Correctly reference bioentity collection env vars in command script
  • Loading branch information
alfonsomunozpomer authored Aug 31, 2023
1 parent 34cf9b3 commit f2d44d4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: "3.6"

services:
gradle-cache-populator:
build: ${DOCKERFILE_PATH}
build:
context: ${DOCKERFILE_PATH}
no_cache: true
volumes:
- gradle-wrapper-dists:/gradle-wrapper-dists
- gradle-ro-dep-cache:/gradle-ro-dep-cache
Expand Down
4 changes: 3 additions & 1 deletion docker/prepare-dev-environment/postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: "3.6"

services:
postgres-populator:
build: ${DOCKERFILE_PATH}
build:
context: ${DOCKERFILE_PATH}
no_cache: true
networks:
- atlas-test-net
depends_on:
Expand Down
12 changes: 9 additions & 3 deletions docker/prepare-dev-environment/solr/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ services:
- atlas-test-net
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD
- POSTGRES_USER
- POSTGRES_DB

solr-populator:
build: ${DOCKERFILE_PATH}
build:
context: ${DOCKERFILE_PATH}
no_cache: true
networks:
- atlas-test-net
depends_on:
Expand Down Expand Up @@ -58,8 +64,8 @@ services:
./create-bioentities-schema.sh
./create-bioentities-suggesters.sh

export SOLR_COLLECTION=${SOLR_COLLECTION_BIOENTITIES}
export SCHEMA_VERSION=${SOLR_COLLECTION_BIOENTITIES_SCHEMA_VERSION}
export SOLR_COLLECTION=$${SOLR_COLLECTION_BIOENTITIES}
export SCHEMA_VERSION=$${SOLR_COLLECTION_BIOENTITIES_SCHEMA_VERSION}
for FILE in `ls /root/bioentity-properties-jsonl/*.jsonl`
do
INPUT_JSONL=$${FILE} ./solr-jsonl-chunk-loader.sh >> /dev/stdout 2>&1
Expand Down
10 changes: 5 additions & 5 deletions docker/prepare-dev-environment/solr/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ then
print_done
fi

print_stage_name "📑 Copy ${SC_ATLAS_ONTOLOGY_FILE} to ${SOLR_CLOUD_CONTAINER_1_NAME}:${SOLR_USERFILES_PATH}"
docker cp ${SC_ATLAS_ONTOLOGY_FILE} ${SOLR_CLOUD_CONTAINER_1_NAME}:${SOLR_USERFILES_PATH} >> ${LOG_FILE} 2>&1
print_stage_name "📑 Copy ${SC_ATLAS_ONTOLOGY_FILE} to ${PROJECT_NAME}-${SOLR_CLOUD_CONTAINER_1_NAME}:${SOLR_USERFILES_PATH}"
docker cp ${SC_ATLAS_ONTOLOGY_FILE} ${PROJECT_NAME}-${SOLR_CLOUD_CONTAINER_1_NAME}:${SOLR_USERFILES_PATH} >> ${LOG_FILE} 2>&1
print_done
print_stage_name "📑 Copy ${SC_ATLAS_ONTOLOGY_FILE} to ${SOLR_CLOUD_CONTAINER_2_NAME}:${SOLR_USERFILES_PATH}"
docker cp ${SC_ATLAS_ONTOLOGY_FILE} ${SOLR_CLOUD_CONTAINER_2_NAME}:${SOLR_USERFILES_PATH} >> ${LOG_FILE} 2>&1
print_stage_name "📑 Copy ${SC_ATLAS_ONTOLOGY_FILE} to ${PROJECT_NAME}-${SOLR_CLOUD_CONTAINER_2_NAME}:${SOLR_USERFILES_PATH}"
docker cp ${SC_ATLAS_ONTOLOGY_FILE} ${PROJECT_NAME}-${SOLR_CLOUD_CONTAINER_2_NAME}:${SOLR_USERFILES_PATH} >> ${LOG_FILE} 2>&1
print_done

print_stage_name "🔏 Register ${SOLR_PUBLIC_KEY} in SolrCloud"
docker exec ${SOLR_CLOUD_CONTAINER_1_NAME} ./bin/solr package add-key /run/secrets/solrcloud.der >> ${LOG_FILE} 2>&1
docker exec ${PROJECT_NAME}-${SOLR_CLOUD_CONTAINER_1_NAME} ./bin/solr package add-key /run/secrets/solrcloud.der >> ${LOG_FILE} 2>&1
print_done

print_stage_name "🌄 Stop Solr 8 cluster in Docker Compose"
Expand Down
4 changes: 3 additions & 1 deletion docker/prepare-dev-environment/volumes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: "3.6"

services:
volumes-populator:
build: ${DOCKERFILE_PATH}
build:
context: ${DOCKERFILE_PATH}
no_cache: true
volumes:
- atlas-data-bioentity-properties:/atlas-data/bioentity_properties
- atlas-data-exp:/atlas-data/exp
Expand Down

0 comments on commit f2d44d4

Please sign in to comment.