Skip to content

Commit

Permalink
Merge pull request #66 from ga4gh/release/0.3.0
Browse files Browse the repository at this point in the history
Release 0.3.0 into main
  • Loading branch information
Jeremy Adams authored May 19, 2022
2 parents 6677d78 + 6a7c41c commit e182450
Show file tree
Hide file tree
Showing 53 changed files with 1,901 additions and 372 deletions.
140 changes: 140 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Standard Tests
on: [push, pull_request, workflow_dispatch] #workflow_dispatch works only if its active in the main branch
jobs:
Unit-Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setting up JDK 12
uses: actions/setup-java@v2
with:
java-version: '12'
distribution: 'adopt' #using a specific distribution of jdk12 (AdoptOpenJDK)

- name: Setting up Gradle
uses: gradle/gradle-build-action@v2

- name: Setting up Gradle Wrapper
run: "gradle wrapper"

- name: Validating Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setting up the SQLite database and Make
run: |
sqlite3 -version
make -version
make clean-all
make sqlite-db-build
make sqlite-db-populate-dev-dataset
- name: Running Tests
run: "./gradlew test --tests=org.*"

- name: After Success Submitting Code Coverage
run: | #jacocoTestReport is for testing code coverage, submits the last report to the link
./gradlew jacocoTestReport
bash <(curl -s https://codecov.io/bash)
Docker-Integration-Test:
needs: Unit-Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setting up Gradle
uses: gradle/gradle-build-action@v2

- name: Setting Up Docker Buildx #used for caching image layers, improves performance
id: buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Get and Set Version
run: |
source ci/set-docker-image-version.sh
echo "version=${DOCKER_IMG_VER}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: ./Dockerfile
push: true
tags: ga4gh/ga4gh-starter-kit-drs:test
build-args: VERSION=${{ env.version }}
cache-from: type=gha #GitHub Actions Cache Exporter
cache-to: type=gha,mode=max

- name: Running Tests
run: |
docker run --rm -d --name starter-kit-drs-test-default -p 4500:4500 -p 4501:4501 ga4gh/ga4gh-starter-kit-drs:test
docker run --rm -d --name starter-kit-drs-test-custom -p 7000:7000 -p 7001:7001 ga4gh/ga4gh-starter-kit-drs:test --config ./src/test/resources/config/test-config-01.yml
- name: Gradle Integration Test
run: ./gradlew test --tests=integration.*

Docker-Release:
needs: Docker-Integration-Test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' #Only runs if pushing to main
steps:
- uses: actions/checkout@v2

- name: Setting Up Docker Buildx #used for caching image layers, improves performance
id: buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Get and Set Version
run: |
source ci/set-docker-image-version.sh
echo "version=${DOCKER_IMG_VER}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: ./Dockerfile
push: true
tags: ga4gh/ga4gh-starter-kit-drs:${{ env.version }} #Using the correct version as the tag
build-args: VERSION=${{ env.version }}
cache-from: type=gha #GitHub Actions Cache Exporter
cache-to: type=gha,mode=max

build:
name: Create GitHub Release
needs: Docker-Integration-Test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' #Only runs if pushing to main
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get and Set Version
run: |
source ci/set-docker-image-version.sh
echo "version=${DOCKER_IMG_VER}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.version }} #will be v0.2.2 for example
release_name: GA4GH Starter Kit - DRS v${{ env.version }}
draft: false
prerelease: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ bin
*.db

gradle.properties

# Mac OS files
**/.DS_Store
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

27 changes: 21 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# BUILDER CONTAINER
##################################################

FROM openjdk:11.0.10 as builder
FROM openjdk:11.0.12 as builder

USER root

WORKDIR /usr/src/dependencies

# INSTALL MAKE
RUN apt update
RUN apt install build-essential -y
RUN apt update \
&& apt install build-essential -y

# INSTALL SQLITE3
RUN wget https://www.sqlite.org/2021/sqlite-autoconf-3340100.tar.gz \
Expand All @@ -22,11 +22,26 @@ RUN wget https://www.sqlite.org/2021/sqlite-autoconf-3340100.tar.gz \

# USER 'make' and 'sqlite3' to create the dev database
COPY Makefile Makefile
COPY settings.gradle settings.gradle
COPY build.gradle build.gradle
COPY database/sqlite database/sqlite
RUN make sqlite-db-refresh

##################################################
# GRADLE CONTAINER
##################################################

FROM gradle:7.3.3-jdk11 as gradleimage

WORKDIR /home/gradle/source

COPY build.gradle build.gradle
COPY gradlew gradlew
COPY settings.gradle settings.gradle
COPY src src

RUN gradle wrapper

RUN ./gradlew bootJar

##################################################
# FINAL CONTAINER
##################################################
Expand All @@ -40,7 +55,7 @@ ARG VERSION
WORKDIR /usr/src/app

# copy jar, dev db, and dev resource files
COPY build/libs/ga4gh-starter-kit-drs-${VERSION}.jar ga4gh-starter-kit-drs.jar
COPY --from=gradleimage /home/gradle/source/build/libs/ga4gh-starter-kit-drs-${VERSION}.jar ga4gh-starter-kit-drs.jar
COPY --from=builder /usr/src/dependencies/ga4gh-starter-kit.dev.db ga4gh-starter-kit.dev.db
COPY src/test/resources/ src/test/resources/

Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
[![Java 11+](https://img.shields.io/badge/java-11+-blue.svg?style=flat-square)](https://www.java.com)
[![Gradle 6.1+](https://img.shields.io/badge/gradle-6.1+-blue.svg?style=flat-square)](https://gradle.org/)
[![Travis (.org) branch](https://img.shields.io/travis/ga4gh/ga4gh-starter-kit-drs/master.svg?style=flat-square)](https://travis-ci.org/ga4gh/ga4gh-starter-kit-drs)
![Codecov](https://img.shields.io/codecov/c/github/ga4gh/ga4gh-starter-kit-drs?style=flat-square)
[![Gradle 7.3.2+](https://img.shields.io/badge/gradle-7.3.2+-blue.svg?style=flat-square)](https://gradle.org/)
[![GitHub Actions](https://img.shields.io/github/workflow/status/ga4gh/ga4gh-starter-kit-drs/Standard%20Tests/main)](https://github.com/ga4gh/ga4gh-starter-kit-drs/actions)
[![Codecov](https://img.shields.io/codecov/c/github/ga4gh/ga4gh-starter-kit-drs?style=flat-square)](https://app.codecov.io/gh/ga4gh/ga4gh-starter-kit-drs)

# GA4GH Starter Kit DRS

Expand Down Expand Up @@ -35,7 +35,7 @@ docker run -p 4500:4500 ga4gh/ga4gh-starter-kit-drs:latest java -jar ga4gh-start

The service can also be installed locally in cases where docker deployments are not possible, or for development of the codebase. Native installations require:
* Java 11+
* Gradle 6.1.1+
* Gradle 7.3.2+
* SQLite (for creating the dev database)

First, clone the repository from Github:
Expand Down Expand Up @@ -186,5 +186,10 @@ Multiple datasets are currently contained in this repo for development and testi

## Changelog

### v0.3.0
* DRS object batch requests
* Passport support - Passport mediated auth to DRS objects (using Starter Kit implementation of Passports)
* Auth info - Discover Passport broker(s) and visa(s) for requested controlled access DRS Objects (single object and bulk request)

### v0.2.2
* patched log4j dependencies to v2.16.0 to avoid [Log4j Vulnerability](https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidance)
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ configurations.all {

archivesBaseName = 'ga4gh-starter-kit-drs'
group 'org.ga4gh'
version '0.2.2'
version '0.3.0'

repositories {
// Use jcenter for resolving dependencies.
Expand All @@ -46,6 +46,9 @@ repositories {
}

dependencies {
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'

implementation 'com.google.guava:guava:28.1-jre'
implementation 'org.springframework.boot:spring-boot-starter-web:2.5.0'
implementation 'commons-cli:commons-cli:1.4'
Expand All @@ -62,8 +65,12 @@ dependencies {
implementation 'javax.xml.bind:jaxb-api:2.2.8'
implementation 'org.springdoc:springdoc-openapi-ui:1.2.33'
implementation 'org.xerial:sqlite-jdbc:3.8.11.2'
implementation 'com.auth0:java-jwt:3.19.1'
implementation 'org.ga4gh:ga4gh-starter-kit-common:0.5.6'

testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'

testImplementation 'org.testng:testng:7.0.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.0'
testImplementation 'org.springframework.security:spring-security-test'
Expand Down
1 change: 1 addition & 0 deletions ci/set-docker-image-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export DOCKER_IMG_VER=`cat build.gradle | grep "^version" | cut -f 2 -d ' ' | sed "s/'//g"`
Loading

0 comments on commit e182450

Please sign in to comment.