Skip to content

Commit

Permalink
Experimental commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmatej committed Jan 25, 2022
1 parent 41cc894 commit 1ffb6cc
Show file tree
Hide file tree
Showing 27 changed files with 665 additions and 550 deletions.
192 changes: 110 additions & 82 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env.label = "glassfish-ci-pod-${UUID.randomUUID().toString()}"

// list of test ids
def jobs = [
"verifyPhase",
"cdi_all",
"ql_gf_full_profile_all",
"ql_gf_web_profile_all",
Expand Down Expand Up @@ -61,104 +62,73 @@ def parallelStagesMap = jobs.collectEntries {
}

def generateStage(job) {
if (job == 'verifyPhase') {
return {
podTemplate(label: env.label) {
node(label) {
stage("${job}") {
container('glassfish-ci') {
// do the scm checkout
retry(10) {
sleep 60
checkout scm
}

// run the test
unstash 'build-bundles'

try {
retry(3) {
timeout(time: 2, unit: 'HOURS') {
sh """
export CLASSPATH=$WORKSPACE/glassfish6/javadb
./appserver/tests/gftest.sh run_test ${job}
"""
}
}
} finally {
// archive what we can...
archiveArtifacts artifacts: "${job}-results.tar.gz"
junit testResults: 'results/junitreports/*.xml', allowEmptyResults: false
}
}
podTemplate(label: env.label) {
node(label) {
stage("${job}") {
container('glassfish-mvn-tests') {
checkout scm
timeout(time: 1, unit: 'HOURS') {
sh """
mvn clean install -Pstaging # install because we don't sync repo yet, TBD
"""
junit testResults: '**/*-reports/*.xml', allowEmptyResults: false
}
}
}
}
}
}
} else {
return {
podTemplate(label: env.label) {
node(label) {
stage("${job}") {
container('glassfish-ant-tests') {
checkout scm
unstash 'build-bundles'
try {
timeout(time: 1, unit: 'HOURS') {
sh """
export CLASSPATH=$WORKSPACE/glassfish6/javadb
./appserver/tests/gftest.sh run_test ${job}
"""
}
} finally {
archiveArtifacts artifacts: "${job}-results.tar.gz"
junit testResults: 'results/junitreports/*.xml', allowEmptyResults: false
}
}
}
}
}
}
}
}

pipeline {

options {
// keep at most 50 builds
buildDiscarder(logRotator(numToKeepStr: '10'))

// preserve the stashes to allow re-running a test stage
preserveStashes()

// issue related to default 'implicit' checkout, disable it
skipDefaultCheckout()

// abort pipeline if previous stage is unstable
skipStagesAfterUnstable()

// show timestamps in logs
timestamps()

// global timeout, abort after 6 hours
timeout(time: 6, unit: 'HOURS')
}

agent {
kubernetes {
label "${env.label}"
defaultContainer 'glassfish-ci'
yaml """
apiVersion: v1
kind: Pod
metadata:
spec:
volumes:
- name: "jenkins-home"
emptyDir: {}
- name: maven-repo-shared-storage
persistentVolumeClaim:
claimName: glassfish-maven-repo-storage
- name: settings-xml
secret:
secretName: m2-secret-dir
items:
- key: settings.xml
path: settings.xml
- name: settings-security-xml
secret:
secretName: m2-secret-dir
items:
- key: settings-security.xml
path: settings-security.xml
- name: maven-repo-local-storage
emptyDir: {}
containers:
- name: jnlp
image: jenkins/jnlp-slave:alpine
image: jenkins/inbound-agent:4.11-1-alpine-jdk11
imagePullPolicy: IfNotPresent
env:
- name: JAVA_TOOL_OPTIONS
value: -Xmx1G
value: "-Xmx768m -Xss768k"
resources:
limits:
memory: "1Gi"
cpu: "1"
- name: glassfish-ci
- name: glassfish-build
# Docker image defined in this project in [glassfish]/etc/docker/Dockerfile
image: ee4jglassfish/ci:tini-jdk-11.0.10
args:
Expand All @@ -183,13 +153,55 @@ spec:
mountPath: "/home/jenkins/.m2/repository/org/glassfish/main"
env:
- name: "MAVEN_OPTS"
value: "-Duser.home=/home/jenkins"
value: "-Duser.home=/home/jenkins -Xmx1g -Xss768k"
- name: "MVN_EXTRA"
value: "--batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
resources:
limits:
memory: "7Gi"
cpu: "3"
memory: "12Gi"
cpu: "8"
requests:
memory: "8Gi"
cpu: "8"
- name: glassfish-mvn-tests
inheritFrom: glassfish-build
resources:
# Some maven verify checks are multithreaded
limits:
memory: "6Gi"
cpu: "2"
requests:
memory: "6Gi"
cpu: "2"
- name: glassfish-ant-tests
inheritFrom: glassfish-build
resources:
limits:
memory: "4Gi"
cpu: "1"
requests:
memory: "4Gi"
cpu: "1"
volumes:
- name: "jenkins-home"
emptyDir: {}
- name: maven-repo-shared-storage
persistentVolumeClaim:
claimName: glassfish-maven-repo-storage
- name: settings-xml
secret:
secretName: m2-secret-dir
items:
- key: settings.xml
path: settings.xml
- name: settings-security-xml
secret:
secretName: m2-secret-dir
items:
- key: settings-security.xml
path: settings-security.xml
- name: maven-repo-local-storage
emptyDir: {}
"""
}
}
Expand All @@ -204,6 +216,25 @@ spec:
PORT_HTTPS=8181
}

options {
buildDiscarder(logRotator(numToKeepStr: '10'))

// to allow re-running a test stage
preserveStashes()

// issue related to default 'implicit' checkout, disable it
skipDefaultCheckout()

// abort pipeline if previous stage is unstable
skipStagesAfterUnstable()

// show timestamps in logs
timestamps()

// global timeout, abort after 6 hours
timeout(time: 6, unit: 'HOURS')
}

stages {
stage('build') {
agent {
Expand All @@ -212,13 +243,9 @@ spec:
}
}
steps {
container('glassfish-ci') {
container('glassfish-build') {
timeout(time: 1, unit: 'HOURS') {

// do the scm checkout
checkout scm

// do the build
sh '''
echo Maven version
mvn -v
Expand All @@ -229,10 +256,11 @@ spec:
echo Uname
uname -a
bash -xe ./gfbuild.sh build_re_dev
mvn clean install -Pfastest,staging -T4C
./gfbuild.sh archive_bundles
date --iso-8601=seconds
'''
archiveArtifacts artifacts: 'bundles/*.zip'
// junit testResults: 'test-results/build-unit-tests/results/junitreports/test_results_junit.xml'
stash includes: 'bundles/*', name: 'build-bundles'
}
}
Expand Down
Empty file.
50 changes: 16 additions & 34 deletions appserver/ejb/ejb-container/src/main/java/com/sun/ejb/EJBUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,25 +443,22 @@ private static ClassLoader getBusinessIntfClassLoader(String businessInterface)
return java.security.AccessController.doPrivileged(action);
}

public static void serializeObjectFields(
Object instance,
ObjectOutputStream oos)
throws IOException {

// warning: accessed by reflection (AsmSerializableBeanGenerator)
public static void serializeObjectFields(Object instance, ObjectOutputStream oos) throws IOException {
serializeObjectFields(instance, oos, true);
}

public static void serializeObjectFields(
Object instance,
ObjectOutputStream oos,
boolean usesSuperClass)

// warning: accessed by reflection (AsmSerializableBeanGenerator)
public static void serializeObjectFields(Object instance, ObjectOutputStream oos, boolean usesSuperClass)
throws IOException {

Class clazz = (usesSuperClass)? instance.getClass().getSuperclass() : instance.getClass();
final ObjectOutputStream objOutStream = oos;

// Write out list of fields eligible for serialization in sorted order.
for(Field next : getSerializationFields(clazz)) {
for (Field next : getSerializationFields(clazz)) {

final Field nextField = next;
final Object theInstance = instance;
Expand Down Expand Up @@ -489,41 +486,26 @@ public java.lang.Object run() throws Exception {
}

objOutStream.writeObject(value);
} catch(Throwable t) {
if( _logger.isLoggable(FINE) ) {
_logger.log(FINE, "=====> failed serializing field: " + nextField +
" =====> of class: " + clazz + " =====> using: " + oos.getClass() +
" =====> serializing value of type: " + ((value == null)? null : value.getClass().getName()) +
" ===> Error: " + t);
_logger.log(FINE, "", t);
} catch (Throwable t) {
if (_logger.isLoggable(FINE)) {
_logger.log(FINE,
"Failed serializing field: " + nextField + " of " + clazz
+ " using: " + oos.getClass() + " serializing value of type: "
+ (value == null ? null : value.getClass().getName()) + ", cause: " + t);
}
IOException ioe = new IOException();
Throwable cause = (t instanceof InvocationTargetException) ?
((InvocationTargetException)t).getCause() : t;
ioe.initCause( cause );
throw ioe;
throw new IOException(t instanceof InvocationTargetException ? t.getCause() : t);
}
}
}

// note: accessed by reflection!
public static void deserializeObjectFields(
Object instance,
ObjectInputStream ois)
throws IOException {

public static void deserializeObjectFields(Object instance, ObjectInputStream ois) throws IOException {
deserializeObjectFields(instance, ois, null, true);

}

// note: accessed by reflection!
public static void deserializeObjectFields(
Object instance,
ObjectInputStream ois,
Object replaceValue,
boolean usesSuperClass)
throws IOException {

public static void deserializeObjectFields(Object instance, ObjectInputStream ois, Object replaceValue,
boolean usesSuperClass) throws IOException {
Class clazz = (usesSuperClass)? instance.getClass().getSuperclass() : instance.getClass();
if( _logger.isLoggable(FINE) ) {
_logger.log(FINE, "=====> Deserializing class: " + clazz);
Expand Down
Loading

0 comments on commit 1ffb6cc

Please sign in to comment.