Skip to content

Commit

Permalink
Containerize gaia-core and gaia-db (https://github.com/OHDSI/GIS/issu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jshoughtaling committed Jul 19, 2024
1 parent 57877f8 commit 7177338
Show file tree
Hide file tree
Showing 13 changed files with 12,686 additions and 10,513 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build_gaia_core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: gaia-core Docker image build

on:
push:
branches:
- main

env:
REGISTRY: ghcr.io
ORG: ohdsi

jobs:
build-and-push-images:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- dockerfile: ./docker/gaia-core/Dockerfile
image: ghcr.io/ohdsi/gaia-core
context: .
permissions:
contents: read
packages: write

steps:
- name: Checkout the code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to a container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: <SOME ADMIN USER>
password: ${{ secrets.GH_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ matrix.image }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

67 changes: 67 additions & 0 deletions .github/workflows/build_gaia_db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: gaia-db Docker image build

on:
push:
branches:
- main
paths:
- 'docker/gaia-db/**'
- 'inst/csv/**'
- 'vocabularies/**'

env:
REGISTRY: ghcr.io
ORG: ohdsi

jobs:
build-and-push-images:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- dockerfile: ./docker/gaia-db/Dockerfile
image: ghcr.io/ohdsi/gaia-db
context: .
permissions:
contents: read
packages: write

steps:
- name: Checkout the code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to a container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: <SOME ADMIN USER>
password: ${{ secrets.GH_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ matrix.image }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max

7 changes: 7 additions & 0 deletions docker/gaia-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ohdsi/broadsea-hades:4.2.1
LABEL maintainer="Tufts Medical Center <[email protected]>"
USER root

RUN Rscript -e 'remotes::install_github("OHDSI/GIS")'

#ENTRYPOINT ["/app/entrypoint.sh"]
12 changes: 12 additions & 0 deletions docker/gaia-db/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM postgis/postgis:16-3.4-alpine

RUN mkdir /csv
COPY inst/csv/data_source.csv /csv/data_source.csv
COPY inst/csv/variable_source.csv /csv/variable_source.csv
COPY vocabularies/gis_vocabs_vocabulary_stage_v1.csv /csv/gis_vocabulary_fragment.csv
COPY vocabularies/gis_vocabs_concept_class_stage_v1.csv /csv/gis_concept_class_fragment.csv
COPY vocabularies/gis_vocabs_domain_stage_v1.csv /csv/gis_domain_fragment.csv
COPY vocabularies/gis_vocabs_concept_stage_v1.csv /csv/gis_concept_fragment.csv
COPY vocabularies/gis_vocabs_relationship_stage_v1.csv /csv/gis_relationship_fragment.csv
COPY vocabularies/gis_vocabs_concept_relationship_stage_v1.csv /csv/gis_concept_relationship_fragment.csv
COPY docker/gaia-db/init.sql /docker-entrypoint-initdb.d/init.sql
10 changes: 10 additions & 0 deletions docker/gaia-db/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Dockerized GAIA-DB

You can run this container directly with the following command:

```bash
sudo docker run --rm --env POSTGRES_PASSWORD=<YOUR PASSWORD> <IMAGE NAME>:latest
```

The image contains the PostGIS extension, the backbone schema with the catalog tables loaded, and a vocabulary schema
with
Loading

0 comments on commit 7177338

Please sign in to comment.