From f79da9c4ea4cf7f784996665057837e1ea20c151 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 23 Dec 2021 12:37:10 +0100 Subject: [PATCH 1/7] Bump dev version --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 445d456..5c94cad 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ description = "RADAR Push API Gateway to handle secured data flow to backend." allprojects { group = "org.radarbase" - version = "0.2.1.1" + version = "0.2.2-SNAPSHOT" repositories { mavenCentral() From 17a64a912fdb4d8dd099746fb270219e7da036d7 Mon Sep 17 00:00:00 2001 From: Pauline Conde Date: Tue, 11 Jan 2022 15:34:32 +0000 Subject: [PATCH 2/7] Add curl installation to dockerfile --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3b7440d..f2997bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,10 @@ MAINTAINER @yatharthranjan LABEL description="RADAR-base Push Api Gateway docker container" +RUN apt-get update && apt-get install -y \ + curl \ + && rm -rf /var/lib/apt/lists/* + COPY --from=builder /code/build/distributions/radar-push-endpoint-*/bin/* /usr/bin/ COPY --from=builder /code/build/distributions/radar-push-endpoint-*/lib/* /usr/lib/ COPY --from=builder /code/build/libs/radar-push-endpoint-*.jar /usr/lib/ From f3363c9f21c82ed7f75d4b069bd1d5b07e1217c8 Mon Sep 17 00:00:00 2001 From: yatharthranjan Date: Wed, 12 Jan 2022 19:09:18 +0000 Subject: [PATCH 3/7] Upgrade dependencies --- build.gradle.kts | 5 +++++ gradle.properties | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5c94cad..dca829f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,6 +19,7 @@ allprojects { repositories { mavenCentral() + maven(url = "https://packages.confluent.io/maven/") } } @@ -44,6 +45,7 @@ dependencies { implementation(project(path = ":deprecated-javax", configuration = "shadow")) + implementation("org.radarbase:oauth-client-util:${project.property("radarOauthClientVersion")}") implementation("org.slf4j:slf4j-api:${project.property("slf4jVersion")}") @@ -59,6 +61,9 @@ dependencies { runtimeOnly("org.glassfish.grizzly:grizzly-http-monitoring:$grizzlyVersion") runtimeOnly("org.glassfish.grizzly:grizzly-http-server-monitoring:$grizzlyVersion") + val avroVersion: String by project + runtimeOnly("org.apache.avro:avro:$avroVersion") + val log4j2Version: String by project runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:$log4j2Version") runtimeOnly("org.apache.logging.log4j:log4j-api:$log4j2Version") diff --git a/gradle.properties b/gradle.properties index 9f19345..3cd2bc8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,18 @@ org.gradle.jvmargs=-Xmx3072m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 dockerComposeStopContainers=true -kotlinVersion=1.5.20 -okhttp3Version=4.9.1 -radarJerseyVersion=0.8.0.1 +kotlinVersion=1.6.10 +okhttp3Version=4.9.3 +radarJerseyVersion=0.8.1 radarCommonsVersion=0.13.2 -radarSchemasVersion=0.6.0 -radarOauthClientVersion=0.7.1 -jacksonVersion=2.12.3 -slf4jVersion=1.7.31 -log4j2Version=2.16.0 -kafkaVersion=2.8.0 +radarSchemasVersion=0.7.5 +radarOauthClientVersion=0.8.0 +jacksonVersion=2.12.2 +slf4jVersion=1.7.32 +log4j2Version=2.17.0 +kafkaVersion=2.8.1 confluentVersion=6.2.0 junitVersion=5.7.2 jedisVersion=3.6.1 -grizzlyVersion=3.0.0 +grizzlyVersion=3.0.1 +avroVersion=1.11.0 From e230de9bf23886f13b1c97466295b68c78fd10fd Mon Sep 17 00:00:00 2001 From: yatharthranjan Date: Thu, 13 Jan 2022 14:01:30 +0000 Subject: [PATCH 4/7] update radar-schemas. Fixes #31 --- build.gradle.kts | 3 --- gradle.properties | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index dca829f..fc5f079 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,9 +61,6 @@ dependencies { runtimeOnly("org.glassfish.grizzly:grizzly-http-monitoring:$grizzlyVersion") runtimeOnly("org.glassfish.grizzly:grizzly-http-server-monitoring:$grizzlyVersion") - val avroVersion: String by project - runtimeOnly("org.apache.avro:avro:$avroVersion") - val log4j2Version: String by project runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:$log4j2Version") runtimeOnly("org.apache.logging.log4j:log4j-api:$log4j2Version") diff --git a/gradle.properties b/gradle.properties index 3cd2bc8..e96f6a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ kotlinVersion=1.6.10 okhttp3Version=4.9.3 radarJerseyVersion=0.8.1 radarCommonsVersion=0.13.2 -radarSchemasVersion=0.7.5 +radarSchemasVersion=0.7.6 radarOauthClientVersion=0.8.0 jacksonVersion=2.12.2 slf4jVersion=1.7.32 @@ -15,4 +15,3 @@ confluentVersion=6.2.0 junitVersion=5.7.2 jedisVersion=3.6.1 grizzlyVersion=3.0.1 -avroVersion=1.11.0 From a24fa7310235c705a93d66a3eb6904fb6301a5f8 Mon Sep 17 00:00:00 2001 From: yatharthranjan Date: Thu, 13 Jan 2022 14:19:43 +0000 Subject: [PATCH 5/7] Release version --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index fc5f079..0a6d253 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ description = "RADAR Push API Gateway to handle secured data flow to backend." allprojects { group = "org.radarbase" - version = "0.2.2-SNAPSHOT" + version = "0.2.2" repositories { mavenCentral() From e34a8d0bdbabdacd284e4abc84af1bb0cd1e654e Mon Sep 17 00:00:00 2001 From: yatharthranjan Date: Thu, 13 Jan 2022 14:29:51 +0000 Subject: [PATCH 6/7] add docker releases GH action --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5b19ca..df99ae0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,3 +40,57 @@ jobs: with: files: 'build/libs/*;build/distributions/*' repo-token: ${{ secrets.GITHUB_TOKEN }} + + + # Build and push tagged release docker image + docker: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + env: + DOCKER_IMAGE: radarbase/radar-push-endpoint + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v2 + + # Setup docker build environment + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Add Docker labels and tags + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v2 + with: + images: ${{ env.DOCKER_IMAGE }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - name: Build docker + uses: docker/build-push-action@v2 + with: + # Allow running the image on the architectures supported by openjdk:17-jre-slim + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + # Use runtime labels from docker_meta as well as fixed labels + labels: | + ${{ steps.docker_meta.outputs.labels }} + maintainer=Yatharth Ranjan + org.opencontainers.image.authors=Yatharth Ranjan + org.opencontainers.image.vendor=RADAR-base + org.opencontainers.image.licenses=Apache-2.0 + - name: Inspect docker image + run: | + docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} + docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} From f5db9ef7a9c9caf737afc5e2a67f9ec4c1874c99 Mon Sep 17 00:00:00 2001 From: yatharthranjan Date: Thu, 13 Jan 2022 14:38:40 +0000 Subject: [PATCH 7/7] Also publish dev and master docker builds --- .github/workflows/main.yml | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8834029..b3718c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,9 @@ on: pull_request: branches: [ master, dev ] +env: + DOCKER_IMAGE: radarbase/radar-push-endpoint + jobs: # Build and test the code build: @@ -43,3 +46,83 @@ jobs: # Gradle check - name: Check run: ./gradlew check + + # Check that the docker image builds correctly + docker: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Add Docker labels and tags + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v2 + with: + images: ${{ env.DOCKER_IMAGE }} + + # Setup docker build environment + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - 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', '**/*.gradle.kts', 'gradle.properties', 'src/main/**') }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Cache parameters + id: cache-parameters + run: | + 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" + fi + - name: Build docker + uses: docker/build-push-action@v2 + with: + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: ${{ steps.cache-parameters.outputs.cache-to }} + load: true + tags: ${{ steps.docker_meta.outputs.tags }} + # Use runtime labels from docker_meta as well as fixed labels + labels: | + ${{ steps.docker_meta.outputs.labels }} + maintainer=Joris Borgdorff + org.opencontainers.image.authors=Joris Borgdorff + org.opencontainers.image.vendor=RADAR-base + org.opencontainers.image.licenses=Apache-2.0 + - name: Inspect docker image + run: docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} + + - name: Check docker image + run: docker run --rm ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} curl --help + + # Push the image on the dev and master branches + - name: Push image + if: ${{ github.event_name != 'pull_request' }} + run: docker push ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} + + # Temp fix + # 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' + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache