Skip to content

Commit

Permalink
Merge pull request #305 from RADAR-base/release-0.7.9
Browse files Browse the repository at this point in the history
Release 0.7.9
  • Loading branch information
yatharthranjan authored Apr 19, 2022
2 parents 26450ba + 48ad0fe commit f64e827
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 38 deletions.
48 changes: 35 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: actions/setup-java@v2
with:
distribution: zulu
distribution: temurin
java-version: 17

- name: Setup Gradle
Expand All @@ -50,7 +50,32 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Docker build parameters
id: docker_params
run: |
echo "::set-output name=has_docker_login::${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}"
if [ "${{ github.event_name == 'pull_request' }}" = "true" ]; then
echo "::set-output name=push::false"
echo "::set-output name=load::true"
echo "::set-output name=platforms::linux/amd64"
else
echo "::set-output name=push::true"
echo "::set-output name=load::false"
echo "::set-output name=platforms::linux/amd64,linux/arm64"
fi
- name: Cache Docker layers
id: cache_buildx
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ steps.docker_params.outputs.push }}-${{ hashFiles('Dockerfile', 'java-sdk/**/*.gradle', 'java-sdk/gradle.properties', 'java-sdk/*/src/main/**', 'commons/**', 'specifications/**', 'docker/**') }}
restore-keys: |
${{ runner.os }}-buildx-${{ steps.docker_params.outputs.push }}-
${{ runner.os }}-buildx-
- name: Login to Docker Hub
if: steps.docker_params.outputs.has_docker_login == 'true'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -70,19 +95,10 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
id: cache-buildx
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', 'java-sdk/**/*.gradle', 'java-sdk/gradle.properties', 'java-sdk/*/src/main/**', 'commons/**', 'specifications/**', 'docker/**') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Cache parameters
id: cache-parameters
run: |
if [ "${{ steps.cache-buildx.outputs.cache-hit }}" = "true" ]; then
if [ "${{ steps.cache_buildx.outputs.cache-hit }}" = "true" ]; then
echo "::set-output name=cache-to::"
else
echo "::set-output name=cache-to::type=local,dest=/tmp/.buildx-cache-new,mode=max"
Expand All @@ -93,7 +109,9 @@ jobs:
with:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: ${{ steps.cache-parameters.outputs.cache-to }}
load: true
platforms: ${{ steps.docker_params.outputs.platforms }}
load: ${{ steps.docker_params.outputs.load }}
push: ${{ steps.docker_params.outputs.push }}
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta as well as fixed labels
labels: |
Expand All @@ -104,6 +122,10 @@ jobs:
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
- name: Pull docker image
if: steps.docker_params.outputs.load == 'false'
run: docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}

- name: Inspect docker image
run: docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}

Expand All @@ -121,7 +143,7 @@ jobs:
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move docker build cache
if: steps.cache-buildx.outputs.cache-hit != 'true'
if: steps.cache_buildx.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
2 changes: 1 addition & 1 deletion .github/workflows/publish_snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-java@v2
with:
distribution: zulu
distribution: temurin
java-version: 17

- name: Setup Gradle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- uses: actions/setup-java@v2
with:
distribution: zulu
distribution: temurin
java-version: 17

- name: Setup Gradle
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/scheduled_snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Snyk scheduled test
on:
schedule:
- cron: '0 2 * * 1'
jobs:
security:
runs-on: ubuntu-latest
defaults:
run:
working-directory: java-sdk

env:
REPORT_FILE: test.json
steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master

- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-sub-projects
--configuration-matching='^runtimeClasspath$'
--json-file-output=${{ env.REPORT_FILE }}
--org=radar-base
34 changes: 34 additions & 0 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Snyk test
on:
pull_request:
branches:
- master
jobs:
security:
runs-on: ubuntu-latest

defaults:
run:
working-directory: java-sdk

steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master

- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk to check for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-sub-projects
--configuration-matching='^runtimeClasspath$'
--fail-on=upgradable
--org=radar-base
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ COPY java-sdk/radar-catalog-server/src /code/java-sdk/radar-catalog-server/src

RUN gradle jar --no-watch-fs -Pprofile=docker

FROM azul/zulu-openjdk-alpine:17-jre-headless
FROM eclipse-temurin:17-jre

ENV KAFKA_SCHEMA_REGISTRY=http://schema-registry-1:8081 \
SCHEMA_REGISTRY_API_KEY="" \
Expand All @@ -36,10 +36,9 @@ ENV KAFKA_SCHEMA_REGISTRY=http://schema-registry-1:8081 \
KAFKA_CONFIG_PATH="" \
NO_VALIDATE=""

RUN apk add --no-cache \
bash \
curl \
rsync
RUN apt-get update && apt-get install -y \
rsync \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /schema

Expand Down
11 changes: 11 additions & 0 deletions commons/connector/fitbit/fitbit_resting_heart_rate.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"namespace": "org.radarcns.connector.fitbit",
"type": "record",
"name": "FitbitRestingHeartRate",
"doc": "Heart rate time-series data over a period of time from fitbit device.",
"fields": [
{ "name": "date", "type": "string", "doc": "ISO 8601 formatted local date of device (yyyy-MM-dd)." },
{ "name": "timeReceived", "type": "double", "doc": "Time that the data was received from the Fitbit API (seconds since the Unix Epoch)." },
{ "name": "restingHeartRate", "type": "int", "doc": "Resting heart rate value (bpm) for the day. A sleep stage log is required to generate this value. When a classic sleep log is recorded, this value will be missing." }
]
}
3 changes: 2 additions & 1 deletion commons/connector/fitbit/fitbit_sleep_classic.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ "name": "duration", "type": "int", "doc": "Duration at this sleep characteristic in seconds." },
{ "name": "level", "type":
{ "name": "FitbitSleepClassicLevel", "type": "enum", "symbols": ["AWAKE", "RESTLESS", "ASLEEP", "UNKNOWN"], "doc": "Level of sleep as computed by Fitbit."},
"doc": "Level of sleep as computed by Fitbit.", "default": "UNKNOWN" }
"doc": "Level of sleep as computed by Fitbit.", "default": "UNKNOWN" },
{ "name": "efficiency", "type": ["null", "int"], "doc": "Calculated sleep efficiency score (in percentage). It is a percentage of the amount of time the user was asleep (and not restless) divided by the time they spent in the bed after initially falling asleep.", "default": null }
]
}
3 changes: 2 additions & 1 deletion commons/connector/fitbit/fitbit_sleep_stage.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ "name": "duration", "type": "int", "doc": "Duration at this sleep characteristic in seconds." },
{ "name": "level", "type":
{"name": "FitbitSleepStageLevel", "type": "enum", "symbols": ["DEEP", "LIGHT", "REM", "AWAKE", "UNKNOWN"], "doc": "Level of sleep as computed by Fitbit."},
"doc": "Level of sleep as computed by Fitbit.", "default": "UNKNOWN" }
"doc": "Level of sleep as computed by Fitbit.", "default": "UNKNOWN" },
{ "name": "efficiency", "type": ["null", "int"], "doc": "Calculated sleep efficiency score (in percentage). It is a percentage of the amount of time the user was asleep (and not restless) divided by the time they spent in the bed after initially falling asleep.", "default": null }
]
}
17 changes: 4 additions & 13 deletions java-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

allprojects {
version = '0.7.8'
version = '0.7.9'
group = 'org.radarbase'
}

Expand All @@ -26,8 +26,8 @@ subprojects {
ext {
avroVersion = '1.11.0'
argparseVersion = '0.9.0'
jacksonVersion = '2.13.2'
radarJerseyVersion = "0.8.2"
jacksonVersion = '2.13.2.20220324'
radarJerseyVersion = "0.8.3"

junitVersion = '4.13.2'
confluentVersion = '7.0.1'
Expand All @@ -36,16 +36,7 @@ subprojects {
radarCommonsVersion = '0.13.2'
slf4jVersion = '1.7.36'
javaxValidationVersion = '2.0.1.Final'
logbackVersion = '1.2.10'
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.fasterxml.jackson.module' && details.requested.name == 'jackson-module-kotlin') {
details.useVersion jacksonVersion
details.because 'Fixes missing kotlin module of latest version'
}
}
logbackVersion = '1.2.11'
}

repositories {
Expand Down
6 changes: 4 additions & 2 deletions java-sdk/radar-schemas-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ dependencies {
}
api group: 'javax.validation', name: 'validation-api', version: javaxValidationVersion
api project(':radar-schemas-commons')
api ("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")

implementation ("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion")
api(platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion"))
api("com.fasterxml.jackson.core:jackson-databind")

implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
implementation(group: 'io.confluent', name: 'kafka-connect-avro-data', version: confluentVersion) {
exclude group: "org.glassfish.jersey.core", module: "jersey-common"
exclude group: "jakarta.ws.rs", module: "jakarta.ws.rs-api"
Expand Down
3 changes: 2 additions & 1 deletion java-sdk/radar-schemas-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ repositories {

dependencies {
implementation project(':radar-schemas-registration')
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion")
implementation(platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion"))
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")

implementation group: 'net.sourceforge.argparse4j', name: 'argparse4j', version: argparseVersion

Expand Down

0 comments on commit f64e827

Please sign in to comment.