Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-compose for each supported CDMS #10

Closed
isedwards opened this issue Aug 19, 2021 · 1 comment
Closed

Docker-compose for each supported CDMS #10

isedwards opened this issue Aug 19, 2021 · 1 comment

Comments

@isedwards
Copy link
Member

isedwards commented Aug 19, 2021

Each supported CDMS should have Dockerfile and docker-compose.yml to allow the quick creation of a test database instance for integration testing using their original database technology.

CDMS Database technology SQL DDL
CliDE PostgreSQL 13 opencdms-test-data/schemas/clide/clidedb_schema.sql
Climsoft MariaDB 10.1 opencdms-test-data/schemas/climsoft/v4/v4.1.1/climsoft_v4_all.sql
MCH MySQL 5.1 opencdms-test-data/schemas/mch/Create_MCH_English_basic_tables.sql
MIDAS Oracle XE 11g opencdms-test-data/schemas/midas/midas_core_ddl.sql
OpenCDMS / WMDR TimescaleDB with PostGIS extension N/A (DDL must ensure PostGIS is enabled)

For example: docker-compose.yml

midas_oracle:
    container_name: midas_oracle
    image: oracleinanutshell/oracle-xe-11g
    environment: 
      - ORACLE_ALLOW_REMOTE=true
    ports:
      - 1521:1521
      - 5500:5500

Allowing us to then use a simple docker-compose up -d

Instead of manually copying the DDL into the container (as shown below) and then restoring this to the database instance, we should git clone –depth 1 –branch main this public repository from within the Dockerfile and then automate the restore process.


  • get container id with docker ps
  • Copy the DDL file in /tmp/ of the container using
docker cp ./met-office-midas/ddl/2020.12.04\ dumpMIDAS_ddl.sql 885756c1abad:/tmp/
  • get into the container using docker exec -it midas_oracle bash
  • sqlplus and use system/oracle
  • then run @'/tmp/2020.12.04 dumpMIDAS_ddl.sql' to execute the DDL file.

Although building MySQL 5.1 succeeded, attempts to build Oracle XE failed and we switched to using oracleinanutshell/oracle-xe-11g. We should make a copy of the oracle-xe-11g image, and other essential publicly available images, to ensure that we do not lose access to them in the future.

@isedwards
Copy link
Member Author

Closed by #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant