-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from TheJacksonLaboratory/feature/docker
Docker, HPO-WEB integration support
- Loading branch information
Showing
60 changed files
with
1,327 additions
and
1,319,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Deploy Graph Container | ||
on: | ||
workflow_dispatch: | ||
env: | ||
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }} | ||
GCLOUD_REGION: us-east1 | ||
GCLOUD_GCR: us-docker.pkg.dev | ||
GCLOUD_REGISTRY_PROJECT_ID: ${{ secrets.GCLOUD_REGISTRY_PROJECT_ID }} | ||
GCLOUD_REGISTRY_IMAGE_ENV: docker | ||
GCLOUD_REGISTRY_IMAGE_PROJECT: ontology | ||
SERVICE_NAME: ontology-annotation-network | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Authenticate to Google Cloud | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GCLOUD_SA_KEY }}' | ||
|
||
- name: Setup Google Cloud CLI | ||
uses: 'google-github-actions/setup-gcloud@v1' | ||
- name: Get project version | ||
run: | | ||
echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
- name: Maven Verify | ||
run: mvn clean package -pl oan-etl -am | ||
|
||
- name: Docker Login | ||
run: | | ||
gcloud auth configure-docker "${GCLOUD_GCR}" | ||
- name: Start our builder database container | ||
run: | | ||
docker pull neo4j:community-bullseye | ||
docker run -d --name=builder-neo4j -p7474:7474 -p7687:7687 -v ./neo4j/data:/data --env NEO4J_AUTH=neo4j/password neo4j:community-bullseye | ||
- name: Fetch our data | ||
run: sh oan-etl/update.sh oan-etl/data/ | ||
|
||
- name: Load our neo4j data | ||
run: | | ||
java -jar oan-etl/target/oan-etl-${PROJECT_VERSION}.jar -d=oan-etl/data | ||
docker stop builder-neo4j | ||
- name: Build And Push Docker Image | ||
env: | ||
TESTCONTAINERS_RYUK_DISABLED: true | ||
run: | | ||
echo "DOCKER_IMAGE=${GCLOUD_GCR}/${GCLOUD_REGISTRY_PROJECT_ID}/${GCLOUD_REGISTRY_IMAGE_ENV}/${GCLOUD_REGISTRY_IMAGE_PROJECT}/$SERVICE_NAME:PROJECT_VERSION" >> $GITHUB_ENV | ||
docker build . --tag=${DOCKER_IMAGE} | ||
docker push "${DOCKER_IMAGE}" | ||
- name: Tag Artifact Registry | ||
run: | | ||
gcloud artifacts docker tags add "${DOCKER_IMAGE}" "${GCLOUD_GCR}/${GCLOUD_REGISTRY_PROJECT_ID}/${GCLOUD_REGISTRY_IMAGE_ENV}/${GCLOUD_REGISTRY_IMAGE_PROJECT}/$SERVICE_NAME:latest" | ||
- name: Deploy Cloud Run | ||
run: | | ||
DOCKER_IMAGE_REPOSITORY=$(docker images --format "{{.Repository}}" | grep ontology-annotation-network-etl) | ||
DOCKER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" "${DOCKER_IMAGE_REPOSITORY}" ) | ||
gcloud run deploy $SERVICE_NAME --quiet \ | ||
--image "${DOCKER_IMAGE}" --project "${GCLOUD_PROJECT_ID}" \ | ||
--region "${GCLOUD_REGION}" --platform managed --allow-unauthenticated --format json \ | ||
--memory 2Gi --cpu 2 --min-instances 1 --max-instances 5 --no-cpu-throttling --ingress internal-and-cloud-load-balancing --service-account "${GCLOUD_SERVICE_ACCOUNT}" | ||
echo "Invoke endpoint:" | ||
gcloud run services list --platform managed --format json | jq -r \ | ||
'.[] | select(.metadata.name == "google-cloud-run-maven-test") | .status.address.url' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build Ontology Annotation Network Rest | ||
on: | ||
workflow_dispatch: | ||
env: | ||
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }} | ||
GCLOUD_REGION: us-east1 | ||
GCLOUD_GCR: us-docker.pkg.dev | ||
GCLOUD_REGISTRY_PROJECT_ID: ${{ secrets.GCLOUD_REGISTRY_PROJECT_ID }} | ||
GCLOUD_REGISTRY_IMAGE_ENV: docker | ||
GCLOUD_REGISTRY_IMAGE_PROJECT: ontology | ||
SERVICE_NAME: ontology-annotation-rest | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Authenticate to Google Cloud | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GCLOUD_SA_KEY }}' | ||
|
||
- name: Setup Google Cloud CLI | ||
uses: 'google-github-actions/setup-gcloud@v1' | ||
- name: Get project version | ||
run: | | ||
echo "PROJECT_VERSION=$(./gradlew properties -q | awk '/^version:/ {print $2}')" >> $GITHUB_ENV | ||
- name: Maven Verify | ||
run: mvn clean package -pl oan-rest -am | ||
|
||
- name: Docker Login | ||
run: | | ||
gcloud auth configure-docker "${GCLOUD_GCR}" | ||
- name: Build And Push Docker Image | ||
env: | ||
TESTCONTAINERS_RYUK_DISABLED: true | ||
run: | | ||
echo "DOCKER_IMAGE=${GCLOUD_GCR}/${GCLOUD_REGISTRY_PROJECT_ID}/${GCLOUD_REGISTRY_IMAGE_ENV}/${GCLOUD_REGISTRY_IMAGE_PROJECT}/$SERVICE_NAME:PROJECT_VERSION" >> $GITHUB_ENV | ||
cd oan-rest/ | ||
docker build . --build-arg="VERSION_ARG=${PROJECT_VERSION}" --build-arg="MICRONAUT_ENV_ARG=production" --tag=${DOCKER_IMAGE} | ||
docker push "${DOCKER_IMAGE}" | ||
- name: Tag Artifact Registry | ||
run: | | ||
gcloud artifacts docker tags add "${DOCKER_IMAGE}" "${GCLOUD_GCR}/${GCLOUD_REGISTRY_PROJECT_ID}/${GCLOUD_REGISTRY_IMAGE_ENV}/${GCLOUD_REGISTRY_IMAGE_PROJECT}/$SERVICE_NAME:latest" | ||
- name: Deploy Cloud Run | ||
run: | | ||
DOCKER_IMAGE_REPOSITORY=$(docker images --format "{{.Repository}}" | grep ontology-annotation-network-rest) | ||
DOCKER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" "${DOCKER_IMAGE_REPOSITORY}" ) | ||
gcloud run deploy $SERVICE_NAME --quiet \ | ||
--image "${DOCKER_IMAGE}" --project "${GCLOUD_PROJECT_ID}" \ | ||
--region "${GCLOUD_REGION}" --platform managed --allow-unauthenticated --format json \ | ||
--memory 2Gi --cpu 2 --min-instances 1 --max-instances 5 --no-cpu-throttling --service-account "${GCLOUD_SERVICE_ACCOUNT}" | ||
echo "Invoke endpoint:" | ||
gcloud run services list --platform managed --format json | jq -r \ | ||
'.[] | select(.metadata.name == "google-cloud-run-maven-test") | .status.address.url' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ out/ | |
.factorypath | ||
|
||
oan-etl/data/ | ||
oan-rest/dependency-reduced-pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Set up running image | ||
FROM neo4j:community-bullseye | ||
|
||
COPY ./neo4j/data/ /data | ||
RUN neo4j-admin dbms set-initial-password password | ||
EXPOSE 7474 7687 | ||
|
||
CMD ["neo4j", "start", "-d neo4j"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.