Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.10.0 #101

Merged
merged 38 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ed97bab
Improve docker image build (#79)
raikbitters Jul 13, 2023
8d83175
EPMRPP-82486 || Update personal data retention policy (#82)
APiankouski Jul 24, 2023
ec72ad1
EPMRPP-85017 || Postfix for bucket names in binary storage
APiankouski Jul 25, 2023
372e1a3
EPMRPP-83085 || Implement user notification about account deletion du…
APiankouski Aug 2, 2023
5cbbce7
NotifyUserExpiration || NotifyUserExpiration job fails when sending …
APiankouski Aug 3, 2023
03f5284
Merge pull request #88 from reportportal/EPMRPP-85381_NotifyUserExpir…
APiankouski Aug 3, 2023
eba6859
NotifyUserExpiration || NotifyUserExpiration job fails when sending …
APiankouski Aug 4, 2023
b85a66b
EPMRPP-83085 || Fix date calculation
APiankouski Aug 4, 2023
14f8bef
EPMRPP-83085 || Fix delete-account-notification-template
APiankouski Aug 4, 2023
70fd5ef
EPMRPP-83085 || Fix delete-account-notification-template
APiankouski Aug 4, 2023
e2bacaa
EPMRPP-85418 || Email is not sent to user when the user is deleted by…
APiankouski Aug 7, 2023
4df7fbc
Merge pull request #90 from reportportal/EPMRPP-85418
APiankouski Aug 7, 2023
14e7fe1
EPMRPP-85418 || Email is not sent to user when the user is deleted by…
APiankouski Aug 7, 2023
4888d2e
EPMRPP-85418 || Email is not sent to user when the user is deleted by…
APiankouski Aug 7, 2023
d9c30e7
Patch Dockerfile (#92)
raikbitters Aug 8, 2023
868f59d
EPMRPP-84893 || added MessageBus to jobs-service
rkukharenka Aug 10, 2023
3ab31c7
EPMRPP-84893 || added activity events to jobs-service
rkukharenka Aug 10, 2023
4fa065c
Merge pull request #93 from reportportal/EPMRPP-84893-JOBS
rkukharenka Aug 10, 2023
85a00d6
EPMRPP-85345 || rewrite email notification
rkukharenka Aug 10, 2023
ada856c
EPMRPP-85345 || updated retention policy for users
rkukharenka Aug 11, 2023
73cef69
Merge pull request #94 from reportportal/EPMRPP-85345-JOBS
rkukharenka Aug 15, 2023
667bd56
EPMRPP-85482 || Remove creating dockerfile after release
APiankouski Aug 15, 2023
3e2a76d
EPMRPP-85482 || Remove creating dockerfile after release
APiankouski Aug 16, 2023
1b0b390
EPMRPP-84893 || added new EventObject type
rkukharenka Aug 16, 2023
b10a021
Merge pull request #96 from reportportal/EPMRPP-84893-JOBS-minor-change
rkukharenka Aug 16, 2023
8d53926
Merge branch 'develop' into master_to_develop
IvanKustau Aug 24, 2023
cb1ca17
Merge pull request #98 from reportportal/master_to_develop
IvanKustau Aug 24, 2023
d8ade74
Update Dockerfile for Release build
raikbitters Aug 24, 2023
49dd205
Merge branch 'develop' into patch/docker-for-release-build
raikbitters Aug 24, 2023
a0306d1
Update Dockerfile
raikbitters Aug 24, 2023
898eb91
Update Dockerfile
raikbitters Aug 25, 2023
c308714
Merge pull request #99 from reportportal/patch/docker-for-release-build
IvanKustau Aug 29, 2023
8e8f557
added github action rc build images
hlebkanonik Aug 31, 2023
7e744f8
changed exit-code
hlebkanonik Aug 31, 2023
4d4034c
Release 5.10.0
IvanKustau Aug 29, 2023
ffdd7e7
Create dockerhub-release.yaml
hlebkanonik Oct 2, 2023
bde18cb
Update app version
IvanKustau Oct 2, 2023
d0f0dcd
Update rc.yaml
hlebkanonik Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/dockerhub-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Retag RC Docker image

on:
pull_request_review:
types: [submitted]

env:
AWS_REGION: ${{ vars.AWS_REGION }} # set this to your preferred AWS region, e.g. us-west-1
ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} # set this to your Amazon ECR repository name
TARGET_REGISTRY: ${{ vars.TARGET_REGISTRY }} # set to target regestry (DockerHub, GitHub & etc)
TARGET_REPOSITORY: ${{ vars.TARGET_REPOSITORY }} # set to target repository
PLATFORMS: ${{ vars.BUILD_PLATFORMS }} # set target build platforms. By default linux/amd64
RELEASE_MODE: ${{ vars.RELEASE_MODE }}

jobs:
retag-image:
name: Retag and push image
runs-on: ubuntu-latest
environment: rc
if: github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
# role-to-assume: arn:aws:iam::123456789012:role/my-github-actions-role
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGESTRY_USERNAME }}
password: ${{ secrets.REGESTRY_PASSWORD }}

- name: Create variables
id: vars
run: |
echo "tag=$(echo '${{ github.event.pull_request.title }}' | sed -nE 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')" >> $GITHUB_OUTPUT

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

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

- name: Retag and Push Docker Image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.vars.outputs.tag }}
run: |
docker buildx imagetools create $ECR_REGISTRY/$ECR_REPOSITORY:latest --tag $TARGET_REGISTRY/$TARGET_REPOSITORY:$IMAGE_TAG --tag $TARGET_REGISTRY/$TARGET_REPOSITORY:latest

- name: Summarize
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.vars.outputs.tag }}
run: |
echo "## General information about the build:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- :whale: Docker image: $TARGET_REGISTRY/$TARGET_REPOSITORY:$IMAGE_TAG" >> $GITHUB_STEP_SUMMARY
echo "- :octocat: The commit SHA from which the build was performed: [$GITHUB_SHA](https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
11 changes: 1 addition & 10 deletions .github/workflows/manually-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ on:
version:
description: 'Release version'
required: true
scripts_version:
description: 'Gradle scripts version'
required: true
bom_version:
description: 'Commons bom version'
required: true

env:
GH_USER_NAME: github.actor
SCRIPTS_VERSION: ${{ github.event.inputs.scripts_version }}
BOM_VERSION: ${{ github.event.inputs.bom_version }}
RELEASE_VERSION: ${{ github.event.inputs.version }}
REPOSITORY_URL: 'https://maven.pkg.github.com/'

Expand Down Expand Up @@ -46,7 +38,6 @@ jobs:
- name: Release with Gradle
id: release
run: |
./gradlew release -PreleaseMode -Pscripts.version=${{env.SCRIPTS_VERSION}} \
-Pbom.version=${{env.BOM_VERSION}} \
./gradlew release -PreleaseMode \
-PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}} \
-PgpgPassphrase=${{secrets.GPG_PASSPHRASE}} -PgpgPrivateKey="${{secrets.GPG_PRIVATE_KEY}}"
93 changes: 93 additions & 0 deletions .github/workflows/rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build RC Docker image

on:
push:
branches:
- "rc/*"
- "hotfix/*"

env:
AWS_REGION: ${{ vars.AWS_REGION }} # set this to your preferred AWS region, e.g. us-west-1
ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} # set this to your Amazon ECR repository name
PLATFORMS: ${{ vars.BUILD_PLATFORMS }} # set target build platforms. By default linux/amd64
RELEASE_MODE: ${{ vars.RELEASE_MODE }}

jobs:
build-and-export:
name: Build and export to AWS ECR
runs-on: ubuntu-latest
environment: rc
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
# role-to-assume: arn:aws:iam::123456789012:role/my-github-actions-role
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'

- name: Create variables
id: vars
run: |
echo "tag=$(echo ${{ github.ref_name }} | tr '/' '-')" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "version=$(echo '${{ github.ref_name }}' | sed -nE 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')" >> $GITHUB_OUTPUT

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

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

- name: Build
uses: docker/build-push-action@v4
env:
VERSION: ${{ steps.vars.outputs.version }}
DATE: ${{ steps.vars.outputs.date }}
IMAGE_TAG: ${{ steps.vars.outputs.tag }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
with:
context: .
push: true
build-args: |
APP_VERSION=${{ env.VERSION }}
BUILD_DATE=${{ env.DATE }}
GITHUB_USER=${{ secrets.GH_USER }}
GITHUB_TOKEN=${{ secrets.GH_TOKEN }}
RELEASE_MODE=${{ env.RELEASE_MODE }}
platforms: ${{ env.PLATFORMS }}
tags: |
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
env:
IMAGE_TAG: ${{ steps.vars.outputs.tag }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
with:
image-ref: '${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}'
format: 'table'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

- name: Summarize
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.vars.outputs.tag }}
run: |
echo "## General information about the build:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- :gift: Docker image in Amazon ECR: ecr/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_STEP_SUMMARY
echo "- :octocat: The commit SHA from which the build was performed: [$GITHUB_SHA](https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:

env:
GH_USER_NAME: github.actor
SCRIPTS_VERSION: 5.8.0
BOM_VERSION: 5.7.6
REPOSITORY_URL: 'https://maven.pkg.github.com/'

jobs:
Expand Down Expand Up @@ -41,7 +39,6 @@ jobs:
- name: Release with Gradle
id: release
run: |
./gradlew release -PreleaseMode -Pscripts.version=${{env.SCRIPTS_VERSION}} \
-Pbom.version=${{env.BOM_VERSION}} \
./gradlew release -PreleaseMode \
-PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}} \
-PgpgPassphrase=${{secrets.GPG_PASSPHRASE}} -PgpgPrivateKey="${{secrets.GPG_PRIVATE_KEY}}"
31 changes: 24 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
FROM alpine:latest
LABEL version=5.8.2 description="EPAM Report portal. Service jobs" maintainer="Andrei Varabyeu <[email protected]>, Hleb Kanonik <[email protected]>"
ARG GH_TOKEN
RUN echo 'exec java ${JAVA_OPTS} -jar service-jobs-5.8.2-exec.jar' > /start.sh && chmod +x /start.sh && \
wget --header="Authorization: Bearer ${GH_TOKEN}" -q https://maven.pkg.github.com/reportportal/service-jobs/com/epam/reportportal/service-jobs/5.8.2/service-jobs-5.8.2-exec.jar
ENV JAVA_OPTS="-Xmx512m -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom"
FROM gradle:6.8.3-jdk11 AS build
ARG RELEASE_MODE
ARG APP_VERSION
ARG GITHUB_USER
ARG GITHUB_TOKEN
WORKDIR /usr/app
COPY . /usr/app
RUN if [ "${RELEASE_MODE}" = true ]; then \
gradle build --exclude-task test \
-PreleaseMode=true \
-PgithubUserName=${GITHUB_USER} \
-PgithubToken=${GITHUB_TOKEN} \
-Dorg.gradle.project.version=${APP_VERSION}; \
else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi

# For ARM build use flag: `--platform linux/arm64`
FROM --platform=$BUILDPLATFORM amazoncorretto:11.0.20
LABEL version=${APP_VERSION} description="EPAM Report portal. Jobs Service" maintainer="Andrei Varabyeu <[email protected]>, Hleb Kanonik <[email protected]>"
ARG APP_VERSION=${APP_VERSION}
ENV APP_DIR=/usr/app
ENV JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom"
WORKDIR $APP_DIR
COPY --from=build $APP_DIR/build/libs/service-jobs-*exec.jar .
VOLUME ["/tmp"]
EXPOSE 8080
ENTRYPOINT ./start.sh
ENTRYPOINT exec java ${JAVA_OPTS} -jar ${APP_DIR}/service-jobs-*exec.jar
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project.ext {
releaseMode = project.hasProperty("releaseMode")
}

def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/' + (releaseMode ? getProperty('scripts.version') : 'master')
def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/' + (releaseMode ? '5.10.0' : 'master')

apply from: "$scriptsUrl/build-docker.gradle"
apply from: "$scriptsUrl/build-commons.gradle"
Expand Down Expand Up @@ -54,9 +54,9 @@ ext['snakeyaml.version'] = '1.31'

dependencies {
if (releaseMode) {
implementation 'com.github.reportportal:commons-events:5.7.3'
implementation 'com.github.reportportal:commons-events:5.10.0'
} else {
implementation 'com.github.reportportal:commons-events:35a1246f'
implementation 'com.github.reportportal:commons-events:e337f8b7be'
}

implementation group: 'org.json', name: 'json', version: '20220320'
Expand All @@ -68,6 +68,7 @@ dependencies {
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'


implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down Expand Up @@ -98,7 +99,5 @@ test {
useJUnitPlatform()
}

addDockerfileToGit.dependsOn createDockerfile
beforeReleaseBuild.dependsOn addDockerfileToGit
publish.dependsOn build
publish.mustRunAfter build
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version=5.8.3
version=5.10.0
description=EPAM Report portal. Service jobs
dockerServerUrl=unix:///var/run/docker.sock
dockerPrepareEnvironment=
dockerJavaOpts=-Xmx512m -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom
dockerJavaOpts=-Xmx512m -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;

@SpringBootApplication(scanBasePackages = { "com.epam.reportportal" })
@SpringBootApplication(scanBasePackages = { "com.epam.reportportal" }, exclude = {
FlywayAutoConfiguration.class})
public class ServiceJobApplication {

public static void main(String[] args) {
Expand Down
73 changes: 73 additions & 0 deletions src/main/java/com/epam/reportportal/analyzer/AnalyzerUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright 2023 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.analyzer;

import static java.util.Optional.ofNullable;

import com.rabbitmq.http.client.domain.ExchangeInfo;
import java.util.function.Predicate;
import java.util.function.ToIntFunction;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.math.NumberUtils;

/**
* @author Andrei Piankouski
*/
public final class AnalyzerUtils {

static final String ANALYZER_KEY = "analyzer";
static final String ANALYZER_PRIORITY = "analyzer_priority";
static final String ANALYZER_INDEX = "analyzer_index";
static final String ANALYZER_LOG_SEARCH = "analyzer_log_search";
static final String ANALYZER_SUGGEST = "analyzer_suggest";
static final String ANALYZER_CLUSTER = "analyzer_cluster";

/**
* Comparing by client service priority
*/
public static final ToIntFunction<ExchangeInfo> EXCHANGE_PRIORITY = it -> ofNullable(it.getArguments()
.get(ANALYZER_PRIORITY)).map(val -> NumberUtils.toInt(val.toString(), Integer.MAX_VALUE)).orElse(Integer.MAX_VALUE);

/**
* Checks if service support items indexing. <code>false</code>
* by default
*/
public static final Predicate<ExchangeInfo> DOES_SUPPORT_INDEX = it -> ofNullable(it.getArguments()
.get(ANALYZER_INDEX)).map(val -> BooleanUtils.toBoolean(val.toString())).orElse(false);

/**
* Checks if service support logs searching. <code>false</code>
* by default
*/
public static final Predicate<ExchangeInfo> DOES_SUPPORT_SEARCH = it -> ofNullable(it.getArguments()
.get(ANALYZER_LOG_SEARCH)).map(val -> BooleanUtils.toBoolean(val.toString())).orElse(false);

/**
* Checks if service support logs searching. <code>false</code>
* by default
*/
public static final Predicate<ExchangeInfo> DOES_SUPPORT_SUGGEST = it -> ofNullable(it.getArguments()
.get(ANALYZER_SUGGEST)).map(val -> BooleanUtils.toBoolean(val.toString())).orElse(false);

/**
* Checks if service support logs cluster creation. <code>false</code>
* by default
*/
public static final Predicate<ExchangeInfo> DOES_SUPPORT_CLUSTER = it -> ofNullable(it.getArguments()
.get(ANALYZER_CLUSTER)).map(val -> BooleanUtils.toBoolean(val.toString())).orElse(false);

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ public interface IndexerServiceClient {
*/
void removeFromIndexLessThanLaunchDate(Long index, LocalDateTime lessThanDate);

/**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
First sentence of Javadoc is missing an ending period.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [reviewdog] <com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck> reported by reviewdog 🐶
Line contains a tab character.

* Delete index
*
* @param index Index to be deleted
*/
void deleteIndex(Long index);

/**
* Removes suggest index
*
* @param projectId Project/index id
*/
void removeSuggest(Long projectId);

}
Loading
Loading