Skip to content

Commit

Permalink
Merge pull request #693 from naver/release/3.5.3
Browse files Browse the repository at this point in the history
Release 3.5.3
  • Loading branch information
imbyungjun committed Nov 27, 2020
2 parents 813cd0a + 9ebf7d8 commit 3b4b707
Show file tree
Hide file tree
Showing 337 changed files with 2,981 additions and 3,245 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* nGrinder 3.5.2 has been released. See https://github.com/naver/ngrinder/releases
* nGrinder 3.5.3 has been released. See https://github.com/naver/ngrinder/releases

nGrinder
========
Expand Down
21 changes: 21 additions & 0 deletions RELEASE-NOTE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
3.5.3 (2020.11.27)
==================
- Changes
- Support gradle groovy script
* Maven groovy script is deprecated and can't create any more but, it can still run
- Use maven central repository to manage submodules
* Use maven central repository instead of github repository
- Support UTC
* Use linux timestamp instead of string format of date time.
- Trivial Fix
- Make several UI improvements
- Add identity information to perftest related log
- Make the H2 console optionally available
- Clean up code
- Bug fix
- #669 Prevent lazy initialize exception in spring security authentication object
- #672 Make the modified file distribution handler to be loaded first
- #681 Prevent NPE if start console is failed
- #682 Escape response body in result console
- #684 Fix unstoppable abnormal test

3.5.2 (2020.09.29)
==================
- Changes
Expand Down
63 changes: 58 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
plugins {
id "com.jfrog.bintray" version "1.8.5"
}

allprojects {
apply plugin: "idea"

group = "org.ngrinder"
version = "3.5.2"
version = "3.5.3"

idea {
module {
Expand All @@ -21,6 +25,7 @@ allprojects {
subprojects {
apply plugin: "java"
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"

compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
Expand All @@ -29,7 +34,7 @@ subprojects {
targetCompatibility = 1.8

ext {
profile = project.hasProperty('profile') ? profile : 'production'
profile = project.hasProperty("profile") ? profile : "production"
slf4j_version = "1.7.28"
spring_security_version = "5.3.4.RELEASE"
spring_boot_version = "2.3.3.RELEASE"
Expand Down Expand Up @@ -68,12 +73,60 @@ subprojects {
from components.java
artifact sourceJar
artifact javadocJar
pom {
name = "org.ngrinder:${project.name}"
description = "${project.name} module"
url = "https://github.com/naver/ngrinder"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
// Below field is required to publish to the Maven central. Please modify before publishing.
// developers {
// developer {
// id = "{please_input_your_id}"
// name = "{please_input_your_name}"
// email = "{please_input_your_email}"
// }
// }
scm {
connection = "scm:git:git://github.com/naver/ngrinder.git"
developerConnection = "scm:git:ssh://github.com/naver/ngrinder.git"
url = "https://github.com/naver/ngrinder"
}
}
}
}
repositories {
maven {
url = "file:../../ngrinder.maven.repo/releases/"
}

bintray {
user = project.hasProperty("bintrayUser") ? bintrayUser : ""
key = project.hasProperty("bintrayKey") ? bintrayKey : ""
publications = ["nGrinerModules"]
publish = true
override = true

pkg {
repo = "ngrinder"
name = project.name
userOrg = "navercorp"
licenses = ["Apache-2.0"]
websiteUrl = "https://github.com/naver/ngrinder"
issueTrackerUrl = "https://github.com/naver/ngrinder/issues"
vcsUrl = "https://github.com/naver/ngrinder.git"
labels = ["ngrinder"]
publicDownloadNumbers = true
version {
name = project.version
released = new Date()
gpg {
sign = true
passphrase = project.hasProperty("bintrayGpgPassphrase") ? bintrayGpgPassphrase : ""
}
}
}
}

}
30 changes: 28 additions & 2 deletions docker/controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
FROM jeanblanchard/java:serverjre-8
MAINTAINER JunHo Yoon "[email protected]"

RUN apk update; apk add curl bash
RUN apk update; apk add curl bash tar

ARG MAVEN_VERSION=3.6.3
ARG MAVEN_DOWNLOAD_BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

ARG GRADLE_VERSION=6.7.1
ARG GRADLE_DOWNLOAD_BASE_URL=https://services.gradle.org/distributions

# Install maven
RUN mkdir -p /usr/share/maven \
&& echo "Downloading maven" \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_DOWNLOAD_BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& echo "Unziping maven" \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz

# Install gradle
RUN mkdir -p /usr/share/gradle \
&& echo "Downloading gradle" \
&& curl -fsSL -o /tmp/gradle.zip ${GRADLE_DOWNLOAD_BASE_URL}/gradle-${GRADLE_VERSION}-bin.zip \
&& echo "Unziping gradle" \
&& unzip -d /usr/share/gradle /tmp/gradle.zip \
&& rm -f /tmp/gradle.zip

# Set up environment variables
ENV BASE_DIR=/opt \
NGRINDER_HOME=/opt/ngrinder-controller
NGRINDER_HOME=/opt/ngrinder-controller \
MAVEN_HOME=/usr/share/maven \
GRADLE_HOME=/usr/share/gradle/gradle-${GRADLE_VERSION}

ENV PATH=$PATH:$GRADLE_HOME/bin:$MAVEN_HOME/bin

# Expose ports
EXPOSE 80 16001 12000-12009
Expand Down
6 changes: 5 additions & 1 deletion docker/controller/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env bash
echo "wait a while extracting war files... It takes time for the first run."
echo "Installed build tools."
mvn -version
gradle -version

echo "Wait a while extracting war files... It takes time for the first run."
java -jar ${BASE_DIR}/ngrinder-*.war --port 80
2 changes: 1 addition & 1 deletion docker/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
echo "copying ngrinder-controller"
mkdir -p controller/binary
rm controller/binary/ngrinder*
cp ../ngrinder-controller/target/*.war controller/binary/
cp ../ngrinder-controller/build/libs/*.war controller/binary/
18 changes: 5 additions & 13 deletions ngrinder-controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ dependencies {
compile (group: "org.python", name: "jython-standalone", version: "2.5.3")
compile (group: "com.google.guava", name: "guava", version: "20.0")
compile (group: "org.springframework.security", name: "spring-security-taglibs", version: spring_security_version)

compile (group: "org.apache.maven", name: "maven-embedder", version: "3.6.3")
compile (group: "org.apache.maven", name: "maven-compat", version: "3.6.3")
compile (group: "org.eclipse.aether", name: "aether-connector-basic", version: "1.1.0")
compile (group: "org.eclipse.aether", name: "aether-transport-wagon", version: "1.1.0")
compile (group: "org.apache.maven.wagon", name: "wagon-http", version: "2.8")
compile (group: "org.apache.maven.wagon", name: "wagon-provider-api", version: "2.8")

compile (group: "org.liquibase", name: "liquibase-core", version: "3.5.3")
compile (group: "org.hibernate", name: "hibernate-jcache", version: hibernate_version)
compile (group: "com.github.ben-manes.caffeine", name: "caffeine", version: "2.6.2")
Expand All @@ -75,17 +67,17 @@ dependencies {
compile (group: "com.hazelcast", name: "hazelcast-spring", version: hazelcast_version)
compile (group: "org.kohsuke", name: "github-api", version: "1.99")
compile (group: "commons-validator", name: "commons-validator", version: "1.6")
compile (group: 'org.codehaus.groovy', name: 'groovy-jsr223', version: groovy_version)
compile group: 'com.unboundid', name: 'unboundid-ldapsdk', version: '5.1.1'
compile (group: "org.codehaus.groovy", name: "groovy-jsr223", version: groovy_version)
compile (group: "com.unboundid", name: "unboundid-ldapsdk", version: "5.1.1")

compileOnly (group: "org.projectlombok", name: "lombok", version: "1.18.8")
annotationProcessor (group: "org.projectlombok", name: "lombok", version: "1.18.8")

providedRuntime (group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: spring_boot_version)
providedRuntime (group: "org.springframework.boot", name: "spring-boot-starter-tomcat", version: spring_boot_version)

testCompile (group: 'junit', name: 'junit', version: '4.13')
testCompile (group: "junit", name: "junit", version: "4.13")
testCompile (group: "org.easytesting", name: "fest-assert", version: "1.4")
testCompile (group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: spring_boot_version)
testCompile (group: "org.springframework.boot", name: "spring-boot-starter-test", version: spring_boot_version)

testCompileOnly (group: "org.projectlombok", name: "lombok", version: "1.18.8")
testAnnotationProcessor (group: "org.projectlombok", name: "lombok", version: "1.18.8")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* 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
Expand All @@ -9,7 +9,7 @@
* 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.
* limitations under the License.
*/
package org.ngrinder.agent.controller;

Expand Down Expand Up @@ -57,7 +57,7 @@ public class AgentDownloadController {
* @param fileName file path of agent
* @param response response.
*/
@GetMapping("/{fileName:[a-zA-Z0-9\\.\\-_]+}")
@GetMapping("/{fileName:[a-zA-Z0-9.\\-_]+}")
public void download(@PathVariable String fileName, HttpServletResponse response) {
File home = config.getHome().getDownloadDirectory();
File ngrinderFile = new File(home, fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
/**
* @since 3.5.0
*/
@SuppressWarnings("unused")
@RestController
@RequestMapping("/agent/api")
@PreAuthorize("hasAnyRole('A', 'S')")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*
* @since 3.1
*/
@SuppressWarnings("unused")
@Controller
@RequestMapping("/agent")
@GlobalControllerModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public class MonitorDownloadController {
* @param fileName monitor file name.
* @param response response.
*/

@GetMapping("/{fileName:[a-zA-Z0-9\\.\\-_]+}")
@GetMapping("/{fileName:[a-zA-Z0-9.\\-_]+}")
public void download(@PathVariable String fileName, HttpServletResponse response) {
File home = config.getHome().getDownloadDirectory();
File monitorFile = new File(home, fileName);
Expand All @@ -64,6 +63,7 @@ public void download(@PathVariable String fileName, HttpServletResponse response
/**
* Download monitor.
*/
@SuppressWarnings("SpringMVCViewInspection")
@GetMapping("")
public String download(ModelMap model) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Future<SystemInfo> getAsyncSystemInfo(String ip, int port) {
* Close the monitor JXM connection to the given target.
*
* @param ip target host IP
* @return success if succeeded.
*
*/
@GetMapping("/close")
public void closeMonitorConnection(@RequestParam String ip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javax.persistence.Entity;
import javax.persistence.Table;

@SuppressWarnings("JpaDataSourceORMInspection")
@Getter
@Setter
@ToString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* 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
Expand All @@ -9,15 +9,13 @@
* 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.
* limitations under the License.
*/
package org.ngrinder.agent.repository;

import org.ngrinder.model.AgentInfo;
import org.springframework.data.jpa.domain.Specification;

import javax.persistence.criteria.*;

/**
* Agent Manager JPA Specification.
*
Expand All @@ -34,5 +32,5 @@ public abstract class AgentManagerSpecification {
public static Specification<AgentInfo> idEqual(final Long id) {
return (Specification<AgentInfo>) (root, query, cb) -> cb.equal(root.get("id"), id);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.ngrinder.infra.config.Config;
import org.ngrinder.packages.AgentPackageHandler;
import org.ngrinder.packages.PackageHandler;
Expand All @@ -14,13 +13,10 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import lombok.RequiredArgsConstructor;

import static org.apache.commons.lang.StringUtils.isNotEmpty;
import static org.ngrinder.common.util.CompressionUtils.*;
import static org.ngrinder.common.util.EncodingUtils.decodePathWithUTF8;
import static org.ngrinder.common.util.StringUtils.replaceLast;

Expand Down Expand Up @@ -137,30 +133,4 @@ protected boolean isDependentLib(File libFile, Set<String> libs) {
name = name.substring(0, (libVersionStartIndex == -1) ? name.lastIndexOf(".") : libVersionStartIndex);
return libs.contains(name);
}

static class TarArchivingZipEntryProcessor implements ZipEntryProcessor {
private TarArchiveOutputStream tao;
private FilePredicate filePredicate;
private String basePath;
private int mode;

TarArchivingZipEntryProcessor(TarArchiveOutputStream tao, FilePredicate filePredicate, String basePath, int mode) {
this.tao = tao;
this.filePredicate = filePredicate;
this.basePath = basePath;
this.mode = mode;
}

@Override
public void process(ZipFile file, ZipEntry entry) throws IOException {
try (InputStream inputStream = file.getInputStream(entry)) {
if (filePredicate.evaluate(entry)) {
addInputStreamToTar(this.tao, inputStream, basePath + FilenameUtils.getName(entry.getName()),
entry.getSize(),
this.mode);
}
}
}
}

}
Loading

0 comments on commit 3b4b707

Please sign in to comment.